Search in sources :

Example 6 with Gene2GOAssociation

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());
}
Also used : VocabCharacteristic(ubic.gemma.model.common.description.VocabCharacteristic) Gene2GOAssociation(ubic.gemma.model.association.Gene2GOAssociation) Test(org.junit.Test) BaseSpringContextTest(ubic.gemma.core.testing.BaseSpringContextTest)

Example 7 with Gene2GOAssociation

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();
}
Also used : Gene2GOAssociation(ubic.gemma.model.association.Gene2GOAssociation) Criteria(org.hibernate.Criteria)

Aggregations

Gene2GOAssociation (ubic.gemma.model.association.Gene2GOAssociation)7 VocabCharacteristic (ubic.gemma.model.common.description.VocabCharacteristic)3 Gene (ubic.gemma.model.genome.Gene)3 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)1 ArrayBlockingQueue (java.util.concurrent.ArrayBlockingQueue)1 GZIPInputStream (java.util.zip.GZIPInputStream)1 Criteria (org.hibernate.Criteria)1 Before (org.junit.Before)1 Test (org.junit.Test)1 Authentication (org.springframework.security.core.Authentication)1 SecurityContext (org.springframework.security.core.context.SecurityContext)1 Transactional (org.springframework.transaction.annotation.Transactional)1 BaseSpringContextTest (ubic.gemma.core.testing.BaseSpringContextTest)1 GOEvidenceCode (ubic.gemma.model.association.GOEvidenceCode)1 AnnotationValueObject (ubic.gemma.model.common.description.AnnotationValueObject)1