Search in sources :

Example 66 with ExpressionExperiment

use of ubic.gemma.model.expression.experiment.ExpressionExperiment in project Gemma by PavlidisLab.

the class GeoConverterTest method testConvertGSE5091.

/*
     * Problem with QT being interpreted as String instead of Double.
     */
@SuppressWarnings("unchecked")
@Test
public void testConvertGSE5091() throws Exception {
    GeoFamilyParser parser = new GeoFamilyParser();
    try (InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GSE5091Short/GSE5091_family.soft.gz"))) {
        parser.parse(is);
    }
    GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE5091");
    DatasetCombiner datasetCombiner = new DatasetCombiner();
    GeoSampleCorrespondence correspondence = datasetCombiner.findGSECorrespondence(series);
    series.setSampleCorrespondence(correspondence);
    Object result = this.gc.convert(series);
    assertNotNull(result);
    Collection<ExpressionExperiment> ees = (Collection<ExpressionExperiment>) result;
    assertEquals(1, ees.size());
    ExpressionExperiment ee = ees.iterator().next();
    Collection<QuantitationType> quantitationTypes = ee.getQuantitationTypes();
    for (QuantitationType quantitationType : quantitationTypes) {
        // log.info(quantitationType);
        if (quantitationType.getName().equals("VALUE")) {
            /*
                 * Here's the problem. Of course it works fine...
                 */
            assertEquals(PrimitiveType.DOUBLE, quantitationType.getRepresentation());
            assertTrue(quantitationType.getIsPreferred());
            return;
        }
    }
    fail("Expected to find 'VALUE' with type Double");
}
Also used : GZIPInputStream(java.util.zip.GZIPInputStream) GeoSeries(ubic.gemma.core.loader.expression.geo.model.GeoSeries) GZIPInputStream(java.util.zip.GZIPInputStream) InputStream(java.io.InputStream) QuantitationType(ubic.gemma.model.common.quantitationtype.QuantitationType) StandardQuantitationType(ubic.gemma.model.common.quantitationtype.StandardQuantitationType) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment) Test(org.junit.Test) BaseSpringContextTest(ubic.gemma.core.testing.BaseSpringContextTest)

Example 67 with ExpressionExperiment

use of ubic.gemma.model.expression.experiment.ExpressionExperiment 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 68 with ExpressionExperiment

use of ubic.gemma.model.expression.experiment.ExpressionExperiment 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 69 with ExpressionExperiment

use of ubic.gemma.model.expression.experiment.ExpressionExperiment in project Gemma by PavlidisLab.

the class ExonArrayDataAddIntegrationTest method testAddAffyExonRat.

@Test
public void testAddAffyExonRat() {
    if (!hasApt) {
        log.warn("Test skipped due to lack of Affy Power Tools executable");
        return;
    }
    // GSE33597
    ExpressionExperiment ee;
    try {
        geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGenerator());
        Collection<?> results = geoService.fetchAndLoad("GSE33597", false, false, false);
        ee = (ExpressionExperiment) results.iterator().next();
    } catch (AlreadyExistsInSystemException e) {
        ee = (ExpressionExperiment) ((List<?>) e.getData()).get(0);
    }
    dataUpdater.addAffyExonArrayData(ee);
    experimentService.load(ee.getId());
}
Also used : GeoDomainObjectGenerator(ubic.gemma.core.loader.expression.geo.GeoDomainObjectGenerator) AlreadyExistsInSystemException(ubic.gemma.core.loader.util.AlreadyExistsInSystemException) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment) AbstractGeoServiceTest(ubic.gemma.core.loader.expression.geo.AbstractGeoServiceTest) Test(org.junit.Test)

Example 70 with ExpressionExperiment

use of ubic.gemma.model.expression.experiment.ExpressionExperiment in project Gemma by PavlidisLab.

the class ExonArrayDataAddIntegrationTest method testAddAffyExonHuman.

@Test
public void testAddAffyExonHuman() {
    if (!hasApt) {
        log.warn("Test skipped due to lack of Affy Power Tools executable");
        return;
    }
    // GSE22498
    ExpressionExperiment ee;
    try {
        geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGenerator());
        Collection<?> results = geoService.fetchAndLoad("GSE22498", false, false, false);
        ee = (ExpressionExperiment) results.iterator().next();
    } catch (AlreadyExistsInSystemException e) {
        ee = (ExpressionExperiment) ((List<?>) e.getData()).get(0);
    }
    dataUpdater.addAffyExonArrayData(ee);
    experimentService.load(ee.getId());
}
Also used : GeoDomainObjectGenerator(ubic.gemma.core.loader.expression.geo.GeoDomainObjectGenerator) AlreadyExistsInSystemException(ubic.gemma.core.loader.util.AlreadyExistsInSystemException) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment) AbstractGeoServiceTest(ubic.gemma.core.loader.expression.geo.AbstractGeoServiceTest) Test(org.junit.Test)

Aggregations

ExpressionExperiment (ubic.gemma.model.expression.experiment.ExpressionExperiment)214 Test (org.junit.Test)71 BaseSpringContextTest (ubic.gemma.core.testing.BaseSpringContextTest)42 InputStream (java.io.InputStream)36 GeoSeries (ubic.gemma.core.loader.expression.geo.model.GeoSeries)29 AlreadyExistsInSystemException (ubic.gemma.core.loader.util.AlreadyExistsInSystemException)29 GZIPInputStream (java.util.zip.GZIPInputStream)28 ArrayDesign (ubic.gemma.model.expression.arrayDesign.ArrayDesign)26 HashSet (java.util.HashSet)25 BioAssaySet (ubic.gemma.model.expression.experiment.BioAssaySet)25 GeoDomainObjectGeneratorLocal (ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal)23 AbstractGeoServiceTest (ubic.gemma.core.loader.expression.geo.AbstractGeoServiceTest)22 BioAssay (ubic.gemma.model.expression.bioAssay.BioAssay)20 Collection (java.util.Collection)18 StopWatch (org.apache.commons.lang3.time.StopWatch)18 ExperimentalFactor (ubic.gemma.model.expression.experiment.ExperimentalFactor)18 Taxon (ubic.gemma.model.genome.Taxon)14 Before (org.junit.Before)12 RawExpressionDataVector (ubic.gemma.model.expression.bioAssayData.RawExpressionDataVector)12 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)11