use of ubic.gemma.model.expression.arrayDesign.ArrayDesign in project Gemma by PavlidisLab.
the class GeoSuperSeriesLoadTest method tearDown.
@After
public void tearDown() {
if (ee != null) {
try {
this.removeOldData(ee);
} catch (Exception e) {
log.warn("Removing expression experiment thew an Exception");
}
}
// this is somewhat overkill...
for (ExpressionExperiment ee4 : ees.loadAll()) {
try {
ees.remove(ee4);
} catch (Exception e) {
log.warn("Removing all expression experiments thew an Exception");
}
}
for (ArrayDesign a : adService.loadAll()) {
try {
a = adService.thawLite(a);
for (ArrayDesign b : a.getSubsumedArrayDesigns()) {
adService.remove(b);
}
adService.remove(a);
} catch (Exception e) {
log.warn("Removing all array designs thew an Exception");
}
}
}
use of ubic.gemma.model.expression.arrayDesign.ArrayDesign in project Gemma by PavlidisLab.
the class ExperimentalDesignImporterTestC method setup.
@Before
public void setup() throws Exception {
/*
* Have to add ssal for this platform.
*/
super.executeSqlScript("/script/sql/add-fish-taxa.sql", false);
Taxon salmon = taxonService.findByCommonName("atlantic salmon");
assertNotNull(salmon);
/*
* Load the array design (platform).
*/
geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(this.getTestFileBasePath("designLoadTests")));
geoService.fetchAndLoad("GPL2899", true, true, false);
ArrayDesign ad = arrayDesignService.findByShortName("GPL2899");
assertNotNull(ad);
SimpleExpressionExperimentMetaData metaData = new SimpleExpressionExperimentMetaData();
metaData.setShortName(RandomStringUtils.randomAlphabetic(10));
metaData.setDescription("bar");
metaData.setIsRatio(false);
metaData.setTaxon(salmon);
metaData.setQuantitationTypeName("value");
metaData.setScale(ScaleType.LOG2);
metaData.setType(StandardQuantitationType.AMOUNT);
metaData.getArrayDesigns().add(ad);
try (InputStream data = this.getClass().getResourceAsStream("/data/loader/expression/geo/designLoadTests/expressionDataBrain2003TestFile.txt")) {
ee = simpleExpressionDataLoaderService.create(metaData, data);
}
// ee = this.eeService.thawLite( ee );
}
use of ubic.gemma.model.expression.arrayDesign.ArrayDesign in project Gemma by PavlidisLab.
the class GeoConverterTest method testWithImageNoGenbank.
/*
* Platform has IMAGE:CCCCC in CLONE_ID column, no genbank accessions anywhere.
*/
@Test
public final void testWithImageNoGenbank() throws Exception {
InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GPL222_family.soft.gz"));
GeoFamilyParser parser = new GeoFamilyParser();
parser.setProcessPlatformsOnly(true);
parser.parse(is);
GeoPlatform platform = ((GeoParseResult) parser.getResults().iterator().next()).getPlatformMap().get("GPL222");
Object result = this.gc.convert(platform);
ArrayDesign ad = (ArrayDesign) result;
for (CompositeSequence cs : ad.getCompositeSequences()) {
BioSequence bs = cs.getBiologicalCharacteristic();
assertTrue(bs.getName().startsWith("IMAGE"));
}
}
use of ubic.gemma.model.expression.arrayDesign.ArrayDesign 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.arrayDesign.ArrayDesign in project Gemma by PavlidisLab.
the class GeoConverterTest method testImageClones.
/*
* We should not longer use IMAGE:XXXXX as the sequence name.
*/
@Test
public void testImageClones() throws Exception {
InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GPL226_family.soft.gz"));
GeoFamilyParser parser = new GeoFamilyParser();
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);
for (CompositeSequence cs : ad.getCompositeSequences()) {
BioSequence bs = cs.getBiologicalCharacteristic();
assertTrue("Got: " + bs.getName(), !bs.getName().startsWith("IMAGE") || bs.getSequenceDatabaseEntry() == null);
}
}
Aggregations