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);
}
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);
}
Aggregations