Search in sources :

Example 16 with GeoSeries

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

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

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

Example 19 with GeoSeries

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

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

the class GeoFamilyParserTest method testParseGSE29014.

/*
     * Lacks data for some samples (on purpose)
     */
@Test
public void testParseGSE29014() throws Exception {
    is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GSE29014.soft.gz"));
    parser.parse(is);
    GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE29014");
    Assert.assertEquals(78, series.getSamples().size());
}
Also used : GZIPInputStream(java.util.zip.GZIPInputStream) GeoSeries(ubic.gemma.core.loader.expression.geo.model.GeoSeries) Test(org.junit.Test)

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