Search in sources :

Example 61 with ExpressionExperiment

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

the class GeoConverterTest method testConvertGSE2982.

@SuppressWarnings("unchecked")
@Test
public void testConvertGSE2982() throws Exception {
    InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse2982Short/GSE2982_family.soft.gz"));
    GeoFamilyParser parser = new GeoFamilyParser();
    parser.parse(is);
    GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE2982");
    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();
    boolean ok = false;
    for (RawExpressionDataVector dedv : ee.getRawExpressionDataVectors()) {
        QuantitationType qt = dedv.getQuantitationType();
        if (qt.getIsPreferred()) {
            ok = true;
            assertEquals("VALUE", qt.getName());
            assertEquals(StandardQuantitationType.AMOUNT, qt.getType());
            assertTrue(qt.getIsRatio());
        }
    }
    assertTrue(ok);
}
Also used : GeoSeries(ubic.gemma.core.loader.expression.geo.model.GeoSeries) GZIPInputStream(java.util.zip.GZIPInputStream) InputStream(java.io.InputStream) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment) GZIPInputStream(java.util.zip.GZIPInputStream) RawExpressionDataVector(ubic.gemma.model.expression.bioAssayData.RawExpressionDataVector) QuantitationType(ubic.gemma.model.common.quantitationtype.QuantitationType) StandardQuantitationType(ubic.gemma.model.common.quantitationtype.StandardQuantitationType) Test(org.junit.Test) BaseSpringContextTest(ubic.gemma.core.testing.BaseSpringContextTest)

Example 62 with ExpressionExperiment

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

the class GeoConverterTest method testFetchAndLoadGSE8294.

/*
     * Ends up with too few vectors, because of a problem with the quantitation type guesser.
     */
@Test
public void testFetchAndLoadGSE8294() throws Exception {
    InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GSE8294_family.soft.gz"));
    GeoFamilyParser parser = new GeoFamilyParser();
    parser.parse(is);
    GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE8294");
    DatasetCombiner datasetCombiner = new DatasetCombiner(false);
    GeoSampleCorrespondence correspondence = datasetCombiner.findGSECorrespondence(series);
    series.setSampleCorrespondence(correspondence);
    Set<?> result = (Set<?>) this.gc.convert(series);
    ExpressionExperiment e = (ExpressionExperiment) result.iterator().next();
    assertEquals(66, e.getRawExpressionDataVectors().size());
}
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) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment) Test(org.junit.Test) BaseSpringContextTest(ubic.gemma.core.testing.BaseSpringContextTest)

Example 63 with ExpressionExperiment

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

the class GeoConverterTest method testConvertGSE404.

/*
     * Gets no 'preferred' quantitation type. - it should find one.
     */
@SuppressWarnings("unchecked")
@Test
public void testConvertGSE404() throws Exception {
    InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse404Short/GSE404_family.soft.gz"));
    GeoFamilyParser parser = new GeoFamilyParser();
    parser.parse(is);
    GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE404");
    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;
    ExpressionExperiment ee = ees.iterator().next();
    boolean ok = this.checkQts(ee);
    assertTrue(ok);
}
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) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment) Test(org.junit.Test) BaseSpringContextTest(ubic.gemma.core.testing.BaseSpringContextTest)

Example 64 with ExpressionExperiment

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

the class GeoConverterTest method testConvertGSE4229IMAGE.

/*
     * See bug 3328 - we don't want to use IMAGE clone IDs
     */
@Test
public void testConvertGSE4229IMAGE() throws Exception {
    InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse4229Short/GSE4229.soft.gz"));
    GeoFamilyParser parser = new GeoFamilyParser();
    parser.parse(is);
    GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE4229");
    DatasetCombiner datasetCombiner = new DatasetCombiner();
    GeoSampleCorrespondence correspondence = datasetCombiner.findGSECorrespondence(series);
    series.setSampleCorrespondence(correspondence);
    Object result = this.gc.convert(series);
    assertNotNull(result);
    @SuppressWarnings("unchecked") Collection<ExpressionExperiment> ees = (Collection<ExpressionExperiment>) result;
    ExpressionExperiment ee = ees.iterator().next();
    ArrayDesign platform = ee.getBioAssays().iterator().next().getArrayDesignUsed();
    BioSequence seq = platform.getCompositeSequences().iterator().next().getBiologicalCharacteristic();
    assertNotNull(seq.getSequenceDatabaseEntry());
    String acc = seq.getSequenceDatabaseEntry().getAccession();
    assertEquals("Genbank", seq.getSequenceDatabaseEntry().getExternalDatabase().getName());
    assertTrue(!acc.startsWith("IMAGE"));
}
Also used : GeoSeries(ubic.gemma.core.loader.expression.geo.model.GeoSeries) BioSequence(ubic.gemma.model.genome.biosequence.BioSequence) GZIPInputStream(java.util.zip.GZIPInputStream) InputStream(java.io.InputStream) ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment) GZIPInputStream(java.util.zip.GZIPInputStream) Test(org.junit.Test) BaseSpringContextTest(ubic.gemma.core.testing.BaseSpringContextTest)

Example 65 with ExpressionExperiment

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

the class GeoConverterTest method testGSE44903.

/*
     * bug 3393/1709 - case change in probe names messing things up.
     */
@Test
public final void testGSE44903() throws Exception {
    InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GSE44903.soft.gz"));
    GeoFamilyParser parser = new GeoFamilyParser();
    parser.parse(is);
    GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE44903");
    DatasetCombiner datasetCombiner = new DatasetCombiner(false);
    GeoSampleCorrespondence correspondence = datasetCombiner.findGSECorrespondence(series);
    series.setSampleCorrespondence(correspondence);
    Set<?> result = (Set<?>) this.gc.convert(series);
    ExpressionExperiment e = (ExpressionExperiment) result.iterator().next();
    /*
         * This is the current condition, because the probes are not matched up.
         */
    assertEquals(0, e.getRawExpressionDataVectors().size());
}
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) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment) Test(org.junit.Test) BaseSpringContextTest(ubic.gemma.core.testing.BaseSpringContextTest)

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