use of ubic.gemma.core.datastructure.matrix.ExpressionDataBooleanMatrix in project Gemma by PavlidisLab.
the class TwoChannelMissingValuesTest method testMissingValueGSE11017.
/**
* Was giving all missing values.
*/
@Test
public void testMissingValueGSE11017() throws Exception {
ExpressionExperiment old = eeService.findByShortName("GSE11017");
if (old != null)
eeService.remove(old);
InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GSE11017.soft.gz"));
GeoFamilyParser parser = new GeoFamilyParser();
parser.parse(is);
GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE11017");
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>());
// print( calls );
assertEquals(20, calls.size());
boolean hasNewQT = false;
Collection<QuantitationType> qts = eeService.getQuantitationTypes(expExp);
for (QuantitationType qt : qts) {
if (qt.getType().equals(StandardQuantitationType.PRESENTABSENT)) {
hasNewQT = true;
break;
}
}
assertTrue(hasNewQT);
ExpressionDataMatrixBuilder builder = new ExpressionDataMatrixBuilder(calls);
ExpressionDataBooleanMatrix missingValues = builder.getMissingValueData();
assertTrue(missingValues.getQuantitationTypes().iterator().next().getDescription().contains("signal threshold"));
Boolean[][] mm = missingValues.getRawMatrix();
boolean hasPresent = false;
for (Boolean[] aMm : mm) {
for (Boolean anAMm : aMm) {
if (anAMm) {
hasPresent = true;
break;
}
}
}
assertTrue(hasPresent);
}
Aggregations