Search in sources :

Example 1 with GeoDataset

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

the class DatasetCombinerTest method testGDS186.

/*
     * This has just a single data set but results in a "no platform assigned" error.
     */
@Test
public void testGDS186() throws Exception {
    GeoFamilyParser parser = new GeoFamilyParser();
    try (InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse106Short/GDS186.soft.gz"))) {
        parser.parse(is);
    }
    try (InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse106Short/GSE106.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(11, 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 2 with GeoDataset

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

Aggregations

InputStream (java.io.InputStream)2 HashSet (java.util.HashSet)2 Set (java.util.Set)2 GZIPInputStream (java.util.zip.GZIPInputStream)2 Test (org.junit.Test)2 GeoDataset (ubic.gemma.core.loader.expression.geo.model.GeoDataset)2 GeoSeries (ubic.gemma.core.loader.expression.geo.model.GeoSeries)2