Search in sources :

Example 6 with GeoSeries

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

the class GeoConverterTest method testConvertMultiTaxonDatasetGSE7540.

/*
     * See bug 3163.
     */
@SuppressWarnings("unchecked")
@Test
public void testConvertMultiTaxonDatasetGSE7540() throws Exception {
    InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GSE7540.soft.gz"));
    GeoFamilyParser parser = new GeoFamilyParser();
    parser.parse(is);
    GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE7540");
    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;
    // Should get one for chimp, one for human.
    assertEquals(2, ees.size());
    boolean found1 = false, found2 = false;
    for (ExpressionExperiment ee : ees) {
        if (ee.getBioAssays().size() == 15) {
            found1 = true;
        } else if (ee.getBioAssays().size() == 22) {
            found2 = true;
        }
    }
    assertTrue("Failed to set up the chimp data", found1);
    assertTrue("Failed to set up the human data", found2);
}
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 7 with GeoSeries

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

the class GeoConverterTest method testConvertMultiSeriesPerSample.

/*
     * Case where the same sample can be in multiple series, we had problems with it.
     */
@Test
public void testConvertMultiSeriesPerSample() throws Exception {
    InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GSE3193Short/GSE3193_family.soft.gz"));
    GeoFamilyParser parser = new GeoFamilyParser();
    parser.parse(is);
    GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE3193");
    DatasetCombiner datasetCombiner = new DatasetCombiner(false);
    GeoSampleCorrespondence correspondence = datasetCombiner.findGSECorrespondence(series);
    series.setSampleCorrespondence(correspondence);
    Object result = this.gc.convert(series);
    assertNotNull(result);
    ExpressionExperiment ee = (ExpressionExperiment) ((Collection<?>) result).iterator().next();
    // assertEquals( 85, ee.getBioAssays().size() );
    Map<ArrayDesign, Integer> ads = new HashMap<>();
    for (BioAssay b : ee.getBioAssays()) {
        if (ads.containsKey(b.getArrayDesignUsed())) {
            ads.put(b.getArrayDesignUsed(), ads.get(b.getArrayDesignUsed()) + 1);
        } else {
            ads.put(b.getArrayDesignUsed(), 1);
        }
    }
    assertEquals(4, ads.size());
    for (ArrayDesign ad : ads.keySet()) {
        Integer count = ads.get(ad);
        switch(ad.getName()) {
            case "SHAC":
                // ok
                assertEquals(8, count.intValue());
                break;
            case "SVJ":
                // ok
                assertEquals(1, count.intValue());
                break;
            case "SVL_SVM_SVN_SVO":
                assertEquals(32, count.intValue());
                break;
            case "SVC":
                assertEquals(44, count.intValue());
                break;
            default:
                fail("Name was " + ad.getName());
                break;
        }
    }
}
Also used : GeoSeries(ubic.gemma.core.loader.expression.geo.model.GeoSeries) 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) BioAssay(ubic.gemma.model.expression.bioAssay.BioAssay) Test(org.junit.Test) BaseSpringContextTest(ubic.gemma.core.testing.BaseSpringContextTest)

Example 8 with GeoSeries

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

the class GeoConverterTest method testConvertGse59.

@SuppressWarnings("unchecked")
@Test
public void testConvertGse59() throws Exception {
    InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GSE59Short/GSE59_family.soft.gz"));
    GeoFamilyParser parser = new GeoFamilyParser();
    parser.parse(is);
    GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE59");
    DatasetCombiner datasetCombiner = new DatasetCombiner(false);
    GeoSampleCorrespondence correspondence = datasetCombiner.findGSECorrespondence(series);
    series.setSampleCorrespondence(correspondence);
    // GeoValues values = series.getValues();
    // System.err.print( values );
    Object result = this.gc.convert(series);
    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 9 with GeoSeries

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

the class GeoConverterTest method testConvertGSE360.

/*
     * Note: this series has some samples that don't have all the quantitation types.
     */
@Test
public void testConvertGSE360() throws Exception {
    InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GSE360Short/GSE360_family.soft.gz"));
    GeoFamilyParser parser = new GeoFamilyParser();
    parser.parse(is);
    GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE360");
    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)

Example 10 with GeoSeries

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

the class GeoConverterTest method testGSE8872.

/*
     * Has only one GDS in GEOs when there really should be two. Bug 1829.
     */
@SuppressWarnings("unchecked")
@Test
public final void testGSE8872() throws Exception {
    InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse8872short/GSE8872_family.soft.gz"));
    GeoFamilyParser parser = new GeoFamilyParser();
    parser.parse(is);
    is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse8872short/GDS2942.soft.gz"));
    parser.parse(is);
    GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE8872");
    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());
}
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

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