use of ubic.gemma.model.expression.experiment.ExpressionExperiment 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.experiment.ExpressionExperiment in project Gemma by PavlidisLab.
the class TwoChannelMissingValuesTest method testMissingValueGSE56.
/**
* GSE56 is corrupt: there is no Channel 1 signal value in the data file.
*/
@Test
public void testMissingValueGSE56() throws Exception {
ExpressionExperiment old = eeService.findByShortName("GSE56");
if (old != null)
eeService.remove(old);
InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GSE56Short/GSE56_family.soft.gz"));
GeoFamilyParser parser = new GeoFamilyParser();
parser.parse(is);
GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE56");
DatasetCombiner datasetCombiner = new DatasetCombiner();
GeoSampleCorrespondence correspondence = datasetCombiner.findGSECorrespondence(series);
series.setSampleCorrespondence(correspondence);
Object result = this.gc.convert(series);
assertNotNull(result);
ExpressionExperiment expExp = (ExpressionExperiment) ((Collection<?>) result).iterator().next();
expExp = persisterHelper.persist(expExp, persisterHelper.prepare(expExp));
Collection<RawExpressionDataVector> calls = tcmv.computeMissingValues(expExp, 2.0, new ArrayList<Double>());
assertEquals(10, calls.size());
}
use of ubic.gemma.model.expression.experiment.ExpressionExperiment in project Gemma by PavlidisLab.
the class TwoChannelMissingValuesTest method testMissingValue.
@Test
public void testMissingValue() throws Exception {
ExpressionExperiment old = eeService.findByShortName("GSE2221");
if (old != null)
eeService.remove(old);
InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/shortGenePix/GSE2221_family.soft.gz"));
GeoFamilyParser parser = new GeoFamilyParser();
parser.parse(is);
GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE2221");
DatasetCombiner datasetCombiner = new DatasetCombiner();
GeoSampleCorrespondence correspondence = datasetCombiner.findGSECorrespondence(series);
series.setSampleCorrespondence(correspondence);
Object result = this.gc.convert(series);
assertNotNull(result);
ExpressionExperiment expExp = (ExpressionExperiment) ((Collection<?>) result).iterator().next();
expExp = persisterHelper.persist(expExp, persisterHelper.prepare(expExp));
Collection<RawExpressionDataVector> calls = tcmv.computeMissingValues(expExp, 2.0, new ArrayList<Double>());
assertEquals(500, calls.size());
BioAssayDimension dim = calls.iterator().next().getBioAssayDimension();
// Spot check the results. For sample ME-TMZ, ID #27 should be 'true' and 26 should be false.
ByteArrayConverter bac = new ByteArrayConverter();
boolean foundA = false;
boolean foundB = false;
for (DesignElementDataVector vector : calls) {
if (vector.getDesignElement().getName().equals("26")) {
byte[] dat = vector.getData();
boolean[] row = bac.byteArrayToBooleans(dat);
int i = 0;
for (BioAssay bas : dim.getBioAssays()) {
if (bas.getName().equals("expression array ME-TMZ")) {
assertTrue(!row[i]);
foundA = true;
}
i++;
}
}
if (vector.getDesignElement().getName().equals("27")) {
byte[] dat = vector.getData();
boolean[] row = bac.byteArrayToBooleans(dat);
int i = 0;
for (BioAssay bas : dim.getBioAssays()) {
if (bas.getName().equals("expression array ME-TMZ")) {
assertTrue(row[i]);
foundB = true;
}
i++;
}
}
}
assertTrue(foundA && foundB);
}
use of ubic.gemma.model.expression.experiment.ExpressionExperiment in project Gemma by PavlidisLab.
the class TwoChannelMissingValuesTest method testMissingValueGSE5091.
/**
* GSE56 is corrupt: there is no Channel 1 signal value in the data file.
*/
@Test
public void testMissingValueGSE5091() throws Exception {
ExpressionExperiment old = eeService.findByShortName("GSE5091");
if (old != null)
eeService.remove(old);
InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GSE5091Short/GSE5091_family.soft.gz"));
GeoFamilyParser parser = new GeoFamilyParser();
parser.parse(is);
GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE5091");
DatasetCombiner datasetCombiner = new DatasetCombiner();
GeoSampleCorrespondence correspondence = datasetCombiner.findGSECorrespondence(series);
series.setSampleCorrespondence(correspondence);
gc = this.getBean(GeoConverter.class);
Object result = this.gc.convert(series);
assertNotNull(result);
ExpressionExperiment expExp = (ExpressionExperiment) ((Collection<?>) result).iterator().next();
expExp = persisterHelper.persist(expExp, persisterHelper.prepare(expExp));
Collection<RawExpressionDataVector> calls = tcmv.computeMissingValues(expExp, 2.0, new ArrayList<Double>());
assertEquals(10, calls.size());
}
use of ubic.gemma.model.expression.experiment.ExpressionExperiment in project Gemma by PavlidisLab.
the class BatchInfoPopulationServiceIntegrationTest method testLoad.
@Test
public void testLoad() throws Exception {
geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(this.getTestFileBasePath()));
ExpressionExperiment newee;
try {
Collection<?> results = geoService.fetchAndLoad("GSE26903", false, true, false);
newee = (ExpressionExperiment) results.iterator().next();
} catch (AlreadyExistsInSystemException e) {
newee = (ExpressionExperiment) ((List<?>) e.getData()).iterator().next();
}
assertNotNull(newee);
newee = eeService.thawLite(newee);
assertTrue(batchInfoPopulationService.fillBatchInformation(newee, true));
}
Aggregations