use of ubic.gemma.model.association.Gene2GOAssociation in project Gemma by PavlidisLab.
the class GeneSetServiceTest method testFindByGoId.
@Test
public void testFindByGoId() {
VocabCharacteristic oe = VocabCharacteristic.Factory.newInstance();
oe.setValueUri(GeneOntologyService.BASE_GO_URI + GeneSetServiceTest.GOTERM_INDB);
oe.setValue(GeneSetServiceTest.GOTERM_INDB);
Gene2GOAssociation g2Go1 = Gene2GOAssociation.Factory.newInstance(g, oe, GOEvidenceCode.EXP);
gene2GoService.create(g2Go1);
oe = VocabCharacteristic.Factory.newInstance();
oe.setValueUri(GeneOntologyService.BASE_GO_URI + GeneSetServiceTest.GOTERM_INDB);
oe.setValue(GeneSetServiceTest.GOTERM_INDB);
Gene2GOAssociation g2Go2 = Gene2GOAssociation.Factory.newInstance(g3, oe, GOEvidenceCode.EXP);
gene2GoService.create(g2Go2);
GeneSet gset = this.geneSetSearch.findByGoId(GeneSetServiceTest.GOTERM_QUERY, g3.getTaxon());
assertEquals(2, gset.getMembers().size());
}
use of ubic.gemma.model.association.Gene2GOAssociation in project Gemma by PavlidisLab.
the class Gene2GOAssociationDaoImpl method find.
@Override
public Gene2GOAssociation find(Gene2GOAssociation gene2GOAssociation) {
BusinessKey.checkValidKey(gene2GOAssociation);
Criteria queryObject = this.getSessionFactory().getCurrentSession().createCriteria(Gene2GOAssociation.class);
BusinessKey.addRestrictions(queryObject, gene2GOAssociation);
return (Gene2GOAssociation) queryObject.uniqueResult();
}
Aggregations