Search in sources :

Example 11 with GeoSeries

use of ubic.gemma.core.loader.expression.geo.model.GeoSeries in project Gemma by PavlidisLab.

the class GeoConverterTest method testParseGSE44625.

/*
     * bug 3415. The samples do not have the same quantitation types. In some it is "detection pval" and others
     * "raw_value". We would reject "detection pval" but if the qt already has the name "raw_value" we won't. The way
     * the current setup works, we sort of throw up our hands and keep the data, even though it is messed up.
     * <p>
     * This tests that behaviour. If we start rejecting the data, this test will fail (note that rejecting the data is
     * not unreasonable).
     */
@Test
public void testParseGSE44625() throws Exception {
    InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GSE44625.soft.gz"));
    GeoFamilyParser parser = new GeoFamilyParser();
    parser.parse(is);
    GeoParseResult result = (GeoParseResult) parser.getResults().iterator().next();
    GeoSeries series = result.getSeries().values().iterator().next();
    DatasetCombiner datasetCombiner = new DatasetCombiner(false);
    GeoSampleCorrespondence correspondence = datasetCombiner.findGSECorrespondence(series);
    series.setSampleCorrespondence(correspondence);
    Object convert = this.gc.convert(series);
    ExpressionExperiment ee = (ExpressionExperiment) ((Collection<?>) convert).iterator().next();
    assertEquals(2, ee.getQuantitationTypes().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 12 with GeoSeries

use of ubic.gemma.core.loader.expression.geo.model.GeoSeries in project Gemma by PavlidisLab.

the class GeoConverterTest method testConvertGSE2122SAGE.

// No SAGE allowed
@SuppressWarnings("unchecked")
@Test
public void testConvertGSE2122SAGE() throws Exception {
    InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse2122shortSage/GSE2122.soft.gz"));
    GeoFamilyParser parser = new GeoFamilyParser();
    parser.parse(is);
    GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE2122");
    DatasetCombiner datasetCombiner = new DatasetCombiner();
    GeoSampleCorrespondence correspondence = datasetCombiner.findGSECorrespondence(series);
    series.setSampleCorrespondence(correspondence);
    Object result = this.gc.convert(series);
    Collection<ExpressionExperiment> ees = (Collection<ExpressionExperiment>) result;
    // SAGE, rejected
    assertEquals(0, ees.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 13 with GeoSeries

use of ubic.gemma.core.loader.expression.geo.model.GeoSeries 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 14 with GeoSeries

use of ubic.gemma.core.loader.expression.geo.model.GeoSeries 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 15 with GeoSeries

use of ubic.gemma.core.loader.expression.geo.model.GeoSeries in project Gemma by PavlidisLab.

the class GeoConverterTest method testConvertGSE106.

/*
     * caused "GSM3059 had no platform assigned"
     *
     */
@Test
public void testConvertGSE106() throws Exception {
    InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse106Short/GSE106.soft.gz"));
    GeoFamilyParser parser = new GeoFamilyParser();
    parser.parse(is);
    GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE106");
    DatasetCombiner datasetCombiner = new DatasetCombiner();
    GeoSampleCorrespondence correspondence = datasetCombiner.findGSECorrespondence(series);
    series.setSampleCorrespondence(correspondence);
    Object result = this.gc.convert(series);
    assertNotNull(result);
}
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) Test(org.junit.Test) BaseSpringContextTest(ubic.gemma.core.testing.BaseSpringContextTest)

Aggregations

Test (org.junit.Test)38 GeoSeries (ubic.gemma.core.loader.expression.geo.model.GeoSeries)38 GZIPInputStream (java.util.zip.GZIPInputStream)37 InputStream (java.io.InputStream)36 BaseSpringContextTest (ubic.gemma.core.testing.BaseSpringContextTest)33 ExpressionExperiment (ubic.gemma.model.expression.experiment.ExpressionExperiment)29 Collection (java.util.Collection)6 RawExpressionDataVector (ubic.gemma.model.expression.bioAssayData.RawExpressionDataVector)6 QuantitationType (ubic.gemma.model.common.quantitationtype.QuantitationType)5 StandardQuantitationType (ubic.gemma.model.common.quantitationtype.StandardQuantitationType)5 HashSet (java.util.HashSet)3 Set (java.util.Set)3 ArrayDesign (ubic.gemma.model.expression.arrayDesign.ArrayDesign)3 BioAssay (ubic.gemma.model.expression.bioAssay.BioAssay)3 GeoDataset (ubic.gemma.core.loader.expression.geo.model.GeoDataset)2 Taxon (ubic.gemma.model.genome.Taxon)2 BioSequence (ubic.gemma.model.genome.biosequence.BioSequence)2 Transactional (org.springframework.transaction.annotation.Transactional)1 ByteArrayConverter (ubic.basecode.io.ByteArrayConverter)1 ExpressionDataSVD (ubic.gemma.core.analysis.preprocess.svd.ExpressionDataSVD)1