Search in sources :

Example 21 with PhysicalLocation

use of ubic.gemma.model.genome.PhysicalLocation in project Gemma by PavlidisLab.

the class GeneCoreServiceTest method testLoadGeneDetails.

@Test
public void testLoadGeneDetails() {
    Gene gene = Gene.Factory.newInstance();
    Integer id = Integer.parseInt(RandomStringUtils.randomNumeric(5));
    gene.setNcbiGeneId(id);
    gene.setName("test_genedao");
    gene.setOfficialName("test_genedao");
    gene.setOfficialSymbol("test_genedao");
    Taxon human = taxonService.findByCommonName("human");
    gene.setTaxon(human);
    PhysicalLocation pl1 = PhysicalLocation.Factory.newInstance();
    Chromosome chromosome = new Chromosome("X", null, this.getTestPersistentBioSequence(), human);
    chromosome = (Chromosome) persisterHelper.persist(chromosome);
    pl1.setChromosome(chromosome);
    pl1.setNucleotide(10000010L);
    pl1.setNucleotideLength(1001);
    pl1.setStrand("-");
    gene.setPhysicalLocation(pl1);
    gene = geneDao.create(gene);
    Long idWeWant = gene.getId();
    gene.setId(null);
    Gene g = geneDao.find(gene);
    assertNotNull(g);
    assertEquals(idWeWant, g.getId());
    GeneValueObject gvo = geneCoreService.loadGeneDetails(idWeWant);
    assertEquals(gvo.getName(), g.getName());
    geneDao.remove(g);
}
Also used : Gene(ubic.gemma.model.genome.Gene) Taxon(ubic.gemma.model.genome.Taxon) Chromosome(ubic.gemma.model.genome.Chromosome) PhysicalLocation(ubic.gemma.model.genome.PhysicalLocation) Test(org.junit.Test) BaseSpringContextTest(ubic.gemma.core.testing.BaseSpringContextTest)

Example 22 with PhysicalLocation

use of ubic.gemma.model.genome.PhysicalLocation in project Gemma by PavlidisLab.

the class PersistentDummyObjectHelper method getTestPersistentBlatResult.

public BlatResult getTestPersistentBlatResult(BioSequence querySequence, Taxon taxon) {
    BlatResult br = BlatResult.Factory.newInstance();
    if (taxon == null) {
        taxon = this.getTestPersistentTaxon();
    }
    Chromosome chromosome = new Chromosome("XXX", null, this.getTestPersistentBioSequence(taxon), taxon);
    assert chromosome.getSequence() != null;
    chromosome = (Chromosome) persisterHelper.persist(chromosome);
    assert chromosome != null;
    assert chromosome.getSequence() != null;
    br.setTargetChromosome(chromosome);
    assert br.getTargetChromosome().getSequence() != null;
    br.setQuerySequence(querySequence);
    br.setTargetStart(1L);
    br.setTargetEnd(1000L);
    PhysicalLocation targetAlignedRegion = PhysicalLocation.Factory.newInstance();
    targetAlignedRegion.setChromosome(br.getTargetChromosome());
    targetAlignedRegion.setNucleotide(10000010L);
    targetAlignedRegion.setNucleotideLength(1001);
    targetAlignedRegion.setStrand("-");
    return (BlatResult) persisterHelper.persist(br);
}
Also used : Chromosome(ubic.gemma.model.genome.Chromosome) BlatResult(ubic.gemma.model.genome.sequenceAnalysis.BlatResult) PhysicalLocation(ubic.gemma.model.genome.PhysicalLocation)

Aggregations

PhysicalLocation (ubic.gemma.model.genome.PhysicalLocation)22 Chromosome (ubic.gemma.model.genome.Chromosome)9 Gene (ubic.gemma.model.genome.Gene)7 Taxon (ubic.gemma.model.genome.Taxon)7 HashSet (java.util.HashSet)5 GeneProduct (ubic.gemma.model.genome.gene.GeneProduct)4 BlatAssociation (ubic.gemma.model.genome.sequenceAnalysis.BlatAssociation)4 BlatResult (ubic.gemma.model.genome.sequenceAnalysis.BlatResult)4 Collection (java.util.Collection)3 Test (org.junit.Test)3 BaseSpringContextTest (ubic.gemma.core.testing.BaseSpringContextTest)3 BioSequence2GeneProduct (ubic.gemma.model.association.BioSequence2GeneProduct)3 HashMap (java.util.HashMap)2 DatabaseEntry (ubic.gemma.model.common.description.DatabaseEntry)2 ArrayList (java.util.ArrayList)1 Before (org.junit.Before)1 Transactional (org.springframework.transaction.annotation.Transactional)1 GeneServiceImpl (ubic.gemma.core.genome.gene.service.GeneServiceImpl)1 CompositeSequence (ubic.gemma.model.expression.designElement.CompositeSequence)1 CompositeSequenceValueObject (ubic.gemma.model.expression.designElement.CompositeSequenceValueObject)1