Search in sources :

Example 1 with ExternalDatabase

use of ubic.gemma.model.common.description.ExternalDatabase in project Gemma by PavlidisLab.

the class DiffExMetaAnalyzerServiceTest method addGenes.

/**
 * Add gene annotations. Requires removing old sequence associations.
 */
private void addGenes() throws Exception {
    // fill this in with whatever.
    ExternalDatabase genbank = edService.findByName("genbank");
    assert genbank != null;
    Taxon human = taxonService.findByCommonName("human");
    assert human != null;
    File annotationFile = new File(this.getClass().getResource("/data/loader/expression/geo/meta-analysis/human.probes.for.import.txt").toURI());
    ArrayDesign gpl96 = arrayDesignService.findByShortName("GPL96");
    assertNotNull(gpl96);
    ArrayDesign gpl97 = arrayDesignService.findByShortName("GPL97");
    assertNotNull(gpl97);
    arrayDesignService.removeBiologicalCharacteristics(gpl96);
    arrayDesignProbeMapperService.processArrayDesign(gpl96, human, annotationFile, genbank, false);
    arrayDesignService.removeBiologicalCharacteristics(gpl97);
    arrayDesignProbeMapperService.processArrayDesign(gpl97, human, annotationFile, genbank, false);
    tableMaintenanceUtil.updateGene2CsEntries();
}
Also used : ExternalDatabase(ubic.gemma.model.common.description.ExternalDatabase) ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign) Taxon(ubic.gemma.model.genome.Taxon) File(java.io.File)

Example 2 with ExternalDatabase

use of ubic.gemma.model.common.description.ExternalDatabase in project Gemma by PavlidisLab.

the class BibliographicReferenceServiceImplTest method setUp.

@Before
public void setUp() {
    brdao = createMock(BibliographicReferenceDao.class);
    svc = new BibliographicReferenceServiceImpl(brdao);
    ExternalDatabase extDB = ExternalDatabase.Factory.newInstance();
    extDB.setName("PUBMED");
    de = DatabaseEntry.Factory.newInstance();
    de.setAccession("12345");
    de.setExternalDatabase(extDB);
}
Also used : ExternalDatabase(ubic.gemma.model.common.description.ExternalDatabase) BibliographicReferenceDao(ubic.gemma.persistence.service.common.description.BibliographicReferenceDao) Before(org.junit.Before)

Example 3 with ExternalDatabase

use of ubic.gemma.model.common.description.ExternalDatabase in project Gemma by PavlidisLab.

the class ExpressionExperimentBibRefFinderTest method testLocatePrimaryReference.

@Test
public void testLocatePrimaryReference() throws Exception {
    ExpressionExperimentBibRefFinder finder = new ExpressionExperimentBibRefFinder();
    ExpressionExperiment ee = ExpressionExperiment.Factory.newInstance();
    DatabaseEntry de = DatabaseEntry.Factory.newInstance();
    ExternalDatabase ed = ExternalDatabase.Factory.newInstance();
    ed.setName("GEO");
    de.setAccession("GSE3023");
    de.setExternalDatabase(ed);
    ee.setAccession(de);
    try {
        BibliographicReference bibref = null;
        for (int i = 0; i < 3; i++) {
            bibref = finder.locatePrimaryReference(ee);
            if (bibref != null)
                break;
            Thread.sleep(1000);
        }
        assertNotNull(bibref);
        assertEquals("Differential gene expression in anatomical compartments of the human eye.", bibref.getTitle());
    } catch (Exception e) {
        checkCause(e);
    }
}
Also used : ExternalDatabase(ubic.gemma.model.common.description.ExternalDatabase) DatabaseEntry(ubic.gemma.model.common.description.DatabaseEntry) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment) BibliographicReference(ubic.gemma.model.common.description.BibliographicReference) IOException(java.io.IOException) Test(org.junit.Test)

Example 4 with ExternalDatabase

use of ubic.gemma.model.common.description.ExternalDatabase in project Gemma by PavlidisLab.

the class ExpressionExperimentBibRefFinderTest method testLocatePrimaryReferenceInvalidGSE.

@Test
public void testLocatePrimaryReferenceInvalidGSE() throws Exception {
    ExpressionExperimentBibRefFinder finder = new ExpressionExperimentBibRefFinder();
    ExpressionExperiment ee = ExpressionExperiment.Factory.newInstance();
    DatabaseEntry de = DatabaseEntry.Factory.newInstance();
    ExternalDatabase ed = ExternalDatabase.Factory.newInstance();
    ed.setName("GEO");
    de.setAccession("GSE30231111111111111");
    de.setExternalDatabase(ed);
    ee.setAccession(de);
    try {
        BibliographicReference bibref = finder.locatePrimaryReference(ee);
        assert (bibref == null);
    } catch (Exception e) {
        checkCause(e);
    }
}
Also used : ExternalDatabase(ubic.gemma.model.common.description.ExternalDatabase) DatabaseEntry(ubic.gemma.model.common.description.DatabaseEntry) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment) BibliographicReference(ubic.gemma.model.common.description.BibliographicReference) IOException(java.io.IOException) Test(org.junit.Test)

Example 5 with ExternalDatabase

use of ubic.gemma.model.common.description.ExternalDatabase in project Gemma by PavlidisLab.

the class ShellDelegatingBlat method getSearchedGenome.

public static ExternalDatabase getSearchedGenome(Taxon taxon) {
    BlattableGenome genome = ShellDelegatingBlat.inferBlatDatabase(taxon);
    ExternalDatabase searchedDatabase = ExternalDatabase.Factory.newInstance();
    searchedDatabase.setType(DatabaseType.SEQUENCE);
    searchedDatabase.setName(genome.toString().toLowerCase());
    return searchedDatabase;
}
Also used : ExternalDatabase(ubic.gemma.model.common.description.ExternalDatabase)

Aggregations

ExternalDatabase (ubic.gemma.model.common.description.ExternalDatabase)23 DatabaseEntry (ubic.gemma.model.common.description.DatabaseEntry)11 Taxon (ubic.gemma.model.genome.Taxon)5 Test (org.junit.Test)4 ExpressionExperiment (ubic.gemma.model.expression.experiment.ExpressionExperiment)4 HashMap (java.util.HashMap)3 Gene (ubic.gemma.model.genome.Gene)3 BioSequence (ubic.gemma.model.genome.biosequence.BioSequence)3 BlatResult (ubic.gemma.model.genome.sequenceAnalysis.BlatResult)3 IOException (java.io.IOException)2 Collection (java.util.Collection)2 HashSet (java.util.HashSet)2 Before (org.junit.Before)2 BaseSpringContextTest (ubic.gemma.core.testing.BaseSpringContextTest)2 BibliographicReference (ubic.gemma.model.common.description.BibliographicReference)2 ArrayDesign (ubic.gemma.model.expression.arrayDesign.ArrayDesign)2 JSONObject (com.sdicons.json.model.JSONObject)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1 GeoRecord (ubic.gemma.core.loader.expression.geo.model.GeoRecord)1