Search in sources :

Example 21 with GeoSeries

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

the class DatasetCombinerTest method testFindGSE3193.

/*
     * Has multiple platforms, but no GES's are defined
     */
@Test
public void testFindGSE3193() throws Exception {
    GeoFamilyParser parser = new GeoFamilyParser();
    try (InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GSE3193Short/GSE3193_family.soft.gz"))) {
        parser.parse(is);
    }
    GeoParseResult parseResult = ((GeoParseResult) parser.getResults().iterator().next());
    // GeoDataset gd = parseResult.getDatasets().values().iterator().next();
    GeoSeries gse = parseResult.getSeries().values().iterator().next();
    DatasetCombiner datasetCombiner = new DatasetCombiner();
    GeoSampleCorrespondence result = datasetCombiner.findGSECorrespondence(gse);
    DatasetCombinerTest.log.debug(result);
    Iterator<Set<String>> it = result.iterator();
    int numBioMaterials = 0;
    while (it.hasNext()) {
        it.next();
        // assertTrue( c.size() == 1 );
        numBioMaterials++;
    }
    // note, i'm not at all sure these are right! this used to be 60.
    assertEquals(57, numBioMaterials);
}
Also used : GZIPInputStream(java.util.zip.GZIPInputStream) Set(java.util.Set) HashSet(java.util.HashSet) GeoSeries(ubic.gemma.core.loader.expression.geo.model.GeoSeries) GZIPInputStream(java.util.zip.GZIPInputStream) InputStream(java.io.InputStream) Test(org.junit.Test)

Example 22 with GeoSeries

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

the class DatasetCombinerTest method testFindGSE88.

@Test
public void testFindGSE88() throws Exception {
    GeoFamilyParser parser = new GeoFamilyParser();
    try (InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GSE88Short/GDS184.soft.gz"))) {
        parser.parse(is);
    }
    try (InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GSE88Short/GSE88_family.soft.gz"))) {
        parser.parse(is);
    }
    GeoParseResult parseResult = ((GeoParseResult) parser.getResults().iterator().next());
    GeoDataset gd = parseResult.getDatasets().values().iterator().next();
    GeoSeries gse = parseResult.getSeries().values().iterator().next();
    gd.getSeries().add(gse);
    gds = new HashSet<>();
    gds.add(gd);
    DatasetCombiner datasetCombiner = new DatasetCombiner();
    GeoSampleCorrespondence result = datasetCombiner.findGSECorrespondence(gds);
    DatasetCombinerTest.log.debug(result);
    Iterator<Set<String>> it = result.iterator();
    int numBioMaterials = 0;
    while (it.hasNext()) {
        Collection<String> c = it.next();
        assertTrue(c.size() == 1);
        numBioMaterials++;
    }
    assertEquals(31, numBioMaterials);
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) GeoSeries(ubic.gemma.core.loader.expression.geo.model.GeoSeries) GZIPInputStream(java.util.zip.GZIPInputStream) InputStream(java.io.InputStream) GZIPInputStream(java.util.zip.GZIPInputStream) GeoDataset(ubic.gemma.core.loader.expression.geo.model.GeoDataset) Test(org.junit.Test)

Example 23 with GeoSeries

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

the class GeoConverterTest method testConvertGSE3791.

/*
     * Has two species.
     */
@SuppressWarnings("unchecked")
@Test
public void testConvertGSE3791() throws Exception {
    InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse3791Short/GSE3791_family.soft.gz"));
    GeoFamilyParser parser = new GeoFamilyParser();
    parser.parse(is);
    GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE3791");
    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(2, 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 24 with GeoSeries

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

the class GeoConverterTest method testConvertWithLotsOfPlatforms.

@Test
public void testConvertWithLotsOfPlatforms() throws Exception {
    InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse3500Short/GSE3500_family.soft.gz"));
    GeoFamilyParser parser = new GeoFamilyParser();
    parser.parse(is);
    GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE3500");
    DatasetCombiner datasetCombiner = new DatasetCombiner(false);
    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)

Example 25 with GeoSeries

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

the class GeoConverterTest method test5091.

/*
     * quantitation type problem. See bug 1760
     */
@SuppressWarnings("unchecked")
@Test
public void test5091() 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();
    for (QuantitationType qt : ee.getQuantitationTypes()) {
        if (qt.getName().equals("VALUE")) {
            assertEquals(PrimitiveType.DOUBLE, qt.getRepresentation());
            return;
        }
    }
    fail("Didn't find the 'value' quantitation type");
}
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)

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