use of ubic.gemma.model.expression.experiment.ExpressionExperiment 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.model.expression.experiment.ExpressionExperiment 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.model.expression.experiment.ExpressionExperiment 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());
}
use of ubic.gemma.model.expression.experiment.ExpressionExperiment in project Gemma by PavlidisLab.
the class GeoConverterTest method testParseGSE44625.
/*
* bug 3415. The samples do not have the same quantitation types. In some it is "detection pval" and others
* "raw_value". We would reject "detection pval" but if the qt already has the name "raw_value" we won't. The way
* the current setup works, we sort of throw up our hands and keep the data, even though it is messed up.
* <p>
* This tests that behaviour. If we start rejecting the data, this test will fail (note that rejecting the data is
* not unreasonable).
*/
@Test
public void testParseGSE44625() throws Exception {
InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GSE44625.soft.gz"));
GeoFamilyParser parser = new GeoFamilyParser();
parser.parse(is);
GeoParseResult result = (GeoParseResult) parser.getResults().iterator().next();
GeoSeries series = result.getSeries().values().iterator().next();
DatasetCombiner datasetCombiner = new DatasetCombiner(false);
GeoSampleCorrespondence correspondence = datasetCombiner.findGSECorrespondence(series);
series.setSampleCorrespondence(correspondence);
Object convert = this.gc.convert(series);
ExpressionExperiment ee = (ExpressionExperiment) ((Collection<?>) convert).iterator().next();
assertEquals(2, ee.getQuantitationTypes().size());
}
use of ubic.gemma.model.expression.experiment.ExpressionExperiment in project Gemma by PavlidisLab.
the class GeoConverterTest method testConvertGSE2122SAGE.
// No SAGE allowed
@SuppressWarnings("unchecked")
@Test
public void testConvertGSE2122SAGE() throws Exception {
InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse2122shortSage/GSE2122.soft.gz"));
GeoFamilyParser parser = new GeoFamilyParser();
parser.parse(is);
GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE2122");
DatasetCombiner datasetCombiner = new DatasetCombiner();
GeoSampleCorrespondence correspondence = datasetCombiner.findGSECorrespondence(series);
series.setSampleCorrespondence(correspondence);
Object result = this.gc.convert(series);
Collection<ExpressionExperiment> ees = (Collection<ExpressionExperiment>) result;
// SAGE, rejected
assertEquals(0, ees.size());
}
Aggregations