use of ubic.gemma.model.genome.gene.GeneProduct in project Gemma by PavlidisLab.
the class PersistentDummyObjectHelper method getTestPersistentGene.
public Gene getTestPersistentGene(Taxon t) {
Gene gene = Gene.Factory.newInstance();
gene.setName(RandomStringUtils.randomNumeric(PersistentDummyObjectHelper.RANDOM_STRING_LENGTH) + "_test");
gene.setOfficialName(RandomStringUtils.randomNumeric(PersistentDummyObjectHelper.RANDOM_STRING_LENGTH) + "_test");
gene.setOfficialSymbol(RandomStringUtils.randomNumeric(PersistentDummyObjectHelper.RANDOM_STRING_LENGTH).toUpperCase());
if (t == null) {
gene.setTaxon(PersistentDummyObjectHelper.getTestNonPersistentTaxon());
} else {
gene.setTaxon(t);
}
GeneProduct gp = GeneProduct.Factory.newInstance();
gp.setGene(gene);
gp.setName(RandomStringUtils.randomNumeric(5) + "_test");
gene.getProducts().add(gp);
return (Gene) persisterHelper.persist(gene);
}
Aggregations