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);
}
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;
}
}
}
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);
}
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);
}
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());
}
Aggregations