use of ubic.gemma.core.loader.expression.geo.model.GeoSeries 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);
}
use of ubic.gemma.core.loader.expression.geo.model.GeoSeries in project Gemma by PavlidisLab.
the class TwoChannelMissingValuesTest method testMissingValueGSE523.
@Test
public final void testMissingValueGSE523() throws Exception {
ExpressionExperiment old = eeService.findByShortName("GSE523");
if (old != null)
eeService.remove(old);
InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/GSE523_family.soft.gz"));
GeoFamilyParser parser = new GeoFamilyParser();
parser.parse(is);
GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE523");
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(30, calls.size());
}
use of ubic.gemma.core.loader.expression.geo.model.GeoSeries in project Gemma by PavlidisLab.
the class ExpressionDataSVDTest method testMatrixReconstructB.
/*
* Test on full-sized data set.
*/
@Test
public void testMatrixReconstructB() throws Exception {
GeoConverter gc = new GeoConverterImpl();
InputStream is = new GZIPInputStream(this.getClass().getResourceAsStream("/data/loader/expression/geo/fullSizeTests/GSE1623_family.soft.txt.gz"));
GeoFamilyParser parser = new GeoFamilyParser();
parser.parse(is);
GeoSeries series = ((GeoParseResult) parser.getResults().iterator().next()).getSeriesMap().get("GSE1623");
DatasetCombiner datasetCombiner = new DatasetCombiner();
GeoSampleCorrespondence correspondence = datasetCombiner.findGSECorrespondence(series);
series.setSampleCorrespondence(correspondence);
@SuppressWarnings("unchecked") Collection<ExpressionExperiment> result = (Collection<ExpressionExperiment>) gc.convert(series);
assertNotNull(result);
assertEquals(1, result.size());
ExpressionExperiment ee = result.iterator().next();
ExpressionDataDoubleMatrix matrix = new ExpressionDataDoubleMatrix(ee.getRawExpressionDataVectors(), ee.getQuantitationTypes().iterator().next());
svd = new ExpressionDataSVD(matrix, false);
ExpressionDataDoubleMatrix svdNormalize = svd.removeHighestComponents(1);
assertNotNull(svdNormalize);
}
Aggregations