use of ubic.gemma.core.loader.expression.geo.model.GeoPlatform in project Gemma by PavlidisLab.
the class GeoFamilyParserTest method testParseBigBPlatformOnly.
@Test
public void testParseBigBPlatformOnly() throws Exception {
is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/fullSizeTests/GSE1623_family.soft.txt.gz"));
parser.setProcessPlatformsOnly(true);
parser.parse(is);
Assert.assertEquals(0, ((GeoParseResult) parser.getResults().iterator().next()).getSamples().size());
Assert.assertEquals(0, ((GeoParseResult) parser.getResults().iterator().next()).getSeries().size());
Assert.assertEquals(1, ((GeoParseResult) parser.getResults().iterator().next()).getPlatforms().size());
GeoPlatform p = ((GeoParseResult) parser.getResults().iterator().next()).getPlatforms().values().iterator().next();
Assert.assertEquals(12488, p.getColumnData("GB_ACC").size());
}
use of ubic.gemma.core.loader.expression.geo.model.GeoPlatform 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.GeoPlatform in project Gemma by PavlidisLab.
the class GeoConverterTest method testSingleTaxonOnArrayWithNoOrganismColumn.
/*
* Ensure that if platform has one taxon then taxon is still set correctly
*/
@Test
public void testSingleTaxonOnArrayWithNoOrganismColumn() throws Exception {
InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GPL226_family.soft.gz"));
GeoFamilyParser parser = new GeoFamilyParser();
parser.setProcessPlatformsOnly(true);
parser.parse(is);
GeoPlatform platform = ((GeoParseResult) parser.getResults().iterator().next()).getPlatformMap().get("GPL226");
Object result = this.gc.convert(platform);
ArrayDesign ad = (ArrayDesign) result;
assertNotNull(ad);
Set<Taxon> listPossibleTaxonValues = new HashSet<>();
BioSequence bs;
for (CompositeSequence cs : ad.getCompositeSequences()) {
bs = cs.getBiologicalCharacteristic();
if (bs != null) {
listPossibleTaxonValues.add(bs.getTaxon());
}
}
assertEquals(1, listPossibleTaxonValues.size());
}
use of ubic.gemma.core.loader.expression.geo.model.GeoPlatform in project Gemma by PavlidisLab.
the class GeoConverterTest method testIllegalArgumentExceptionMultipleTaxaOnArrayWithNoOrganismColumn.
/*
* Tests that if platform is defined as having multiple organisms but no column can be found that defines the taxon
* at the probe level then an Exception is thrown
*/
@Test
public void testIllegalArgumentExceptionMultipleTaxaOnArrayWithNoOrganismColumn() throws Exception {
try {
InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GPL226_family.soft.gz"));
GeoFamilyParser parser = new GeoFamilyParser();
// should not be necessary.
parser.setProcessPlatformsOnly(true);
parser.parse(is);
GeoPlatform platform = ((GeoParseResult) parser.getResults().iterator().next()).getPlatformMap().get("GPL226");
// add an extra organism to the platform to make a pretend 2 orgnaism array
platform.addToOrganisms("Rattus norvegicus");
this.gc.convert(platform);
// thrown an error
fail();
} catch (IllegalArgumentException e) {
// assertEquals(
// "2 taxon found on platform: Mus musculus: Rattus norvegicus but there is no probe specific taxon Column
// found for platform GPL226",
// e.getMessage() );
}
}
Aggregations