use of ubic.gemma.core.loader.expression.geo.model.GeoSeries in project Gemma by PavlidisLab.
the class GeoConverterTest method testArrayTaxonDifferentToSampleTaxon.
/*
* GSE2388 is an example of where the array and sample taxon do not match. This test checks that the biomaterial and
* array taxons are set correctly.
*
*/
@SuppressWarnings("unchecked")
@Test
@Transactional
public void testArrayTaxonDifferentToSampleTaxon() throws Exception {
Taxon rainbowTrout = taxonService.findByAbbreviation("omyk");
assertNotNull(rainbowTrout);
Taxon atlanticSalm = taxonService.findByAbbreviation("ssal");
assertNotNull(atlanticSalm);
InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GSE2388_family.soft.gz"));
GeoFamilyParser parser = new GeoFamilyParser();
parser.parse(is);
GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE2388");
GeoPlatform platform = ((GeoParseResult) parser.getResults().iterator().next()).getPlatformMap().get("GPL966");
DatasetCombiner datasetCombiner = new DatasetCombiner();
GeoSampleCorrespondence correspondence = datasetCombiner.findGSECorrespondence(series);
series.setSampleCorrespondence(correspondence);
// assert that the biomaterials have been set as one taxon
Object seriesResult = gc.convert(series);
assertNotNull(seriesResult);
Collection<ExpressionExperiment> ees = (Collection<ExpressionExperiment>) seriesResult;
ExpressionExperiment exper = ees.iterator().next();
Collection<BioAssay> bioassays = exper.getBioAssays();
BioMaterial material = bioassays.iterator().next().getSampleUsed();
Taxon taxon = material.getSourceTaxon();
assertEquals("Oncorhynchus kisutch", taxon.getScientificName());
// assert that the platform is another taxon
Object resultPlatForm = gc.convert(platform);
ArrayDesign ad = (ArrayDesign) resultPlatForm;
assertNotNull(ad);
Set<Taxon> taxa = new HashSet<>();
for (CompositeSequence cs : ad.getCompositeSequences()) {
BioSequence bs = cs.getBiologicalCharacteristic();
if (bs != null) {
assertNotNull(bs.getTaxon());
log.info(bs.getTaxon());
taxa.add(bs.getTaxon());
}
}
// can be empty taxon if the probe does not have a sequence which is why taxon size is 3.
assertEquals(2, taxa.size());
assertTrue(taxa.contains(rainbowTrout));
assertTrue(taxa.contains(atlanticSalm));
}
use of ubic.gemma.core.loader.expression.geo.model.GeoSeries in project Gemma by PavlidisLab.
the class GeoConverterTest method testIllegalArgumentExceptionChannel1Channel2taxonDifferent.
/*
* GSE4047 is an example of where some of the samples used have channel 1 and channel 2 taxon different. And thus an
* exception should be thrown
*/
@Test
public void testIllegalArgumentExceptionChannel1Channel2taxonDifferent() throws Exception {
try {
InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GSE4047_family.soft.gz"));
GeoFamilyParser parser = new GeoFamilyParser();
parser.parse(is);
GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE4047");
DatasetCombiner datasetCombiner = new DatasetCombiner();
GeoSampleCorrespondence correspondence = datasetCombiner.findGSECorrespondence(series);
series.setSampleCorrespondence(correspondence);
this.gc.convert(series);
fail();
} catch (IllegalArgumentException e) {
assertTrue(e.getMessage().startsWith("Sample has two different organisms; One channel taxon is"));
// assertEquals(
// "Channel 1 taxon is Danio rerio Channel 2 taxon is Pomacentrus moluccensis Check that is expected for
// sample GSM104737",
// e.getMessage() );
}
}
use of ubic.gemma.core.loader.expression.geo.model.GeoSeries in project Gemma by PavlidisLab.
the class GeoConverterTest method testConvertGSE29014.
/*
* Lacks data for some samples (on purpose)
*
*/
@SuppressWarnings("unchecked")
@Test
public void testConvertGSE29014() throws Exception {
InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GSE29014.soft.gz"));
GeoFamilyParser parser = new GeoFamilyParser();
parser.parse(is);
GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE29014");
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.core.loader.expression.geo.model.GeoSeries in project Gemma by PavlidisLab.
the class GeoConverterTest method testParseGSE18707.
@Test
public void testParseGSE18707() throws Exception {
InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GSE18707.soft.gz"));
GeoFamilyParser parser = new GeoFamilyParser();
parser.parse(is);
GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE18707");
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();
assertEquals(100, e.getRawExpressionDataVectors().size());
// this is normal, before any processing.
assertEquals(1, e.getQuantitationTypes().size());
QuantitationType qt = e.getQuantitationTypes().iterator().next();
assertEquals("Processed Affymetrix Rosetta intensity values", qt.getDescription());
}
use of ubic.gemma.core.loader.expression.geo.model.GeoSeries in project Gemma by PavlidisLab.
the class GeoConverterTest method testConvertGSE18Stress.
/*
* This is one of our longer/slower tests.
*
*/
@Test
public void testConvertGSE18Stress() throws Exception {
InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse18short/GSE18.soft.gz"));
GeoFamilyParser parser = new GeoFamilyParser();
parser.parse(is);
is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse18short/GDS15.soft.gz"));
parser.parse(is);
is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse18short/GDS16.soft.gz"));
parser.parse(is);
is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse18short/GDS17.soft.gz"));
parser.parse(is);
is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse18short/GDS18.soft.gz"));
parser.parse(is);
is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse18short/GDS19.soft.gz"));
parser.parse(is);
is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse18short/GDS20.soft.gz"));
parser.parse(is);
is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse18short/GDS21.soft.gz"));
parser.parse(is);
is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse18short/GDS30.soft.gz"));
parser.parse(is);
is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse18short/GDS31.soft.gz"));
parser.parse(is);
is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse18short/GDS33.soft.gz"));
parser.parse(is);
is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse18short/GDS34.soft.gz"));
parser.parse(is);
is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse18short/GDS35.soft.gz"));
parser.parse(is);
is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse18short/GDS36.soft.gz"));
parser.parse(is);
is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse18short/GDS108.soft.gz"));
parser.parse(is);
is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse18short/GDS111.soft.gz"));
parser.parse(is);
is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse18short/GDS112.soft.gz"));
parser.parse(is);
is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse18short/GDS113.soft.gz"));
parser.parse(is);
is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/gse18short/GDS115.soft.gz"));
parser.parse(is);
GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE18");
DatasetCombiner datasetCombiner = new DatasetCombiner(false);
GeoSampleCorrespondence correspondence = datasetCombiner.findGSECorrespondence(series);
series.setSampleCorrespondence(correspondence);
ExpressionExperiment result = (ExpressionExperiment) ((Set<?>) this.gc.convert(series)).iterator().next();
assertEquals(156, result.getBioAssays().size());
}
Aggregations