use of ubic.gemma.core.loader.expression.geo.GeoDomainObjectGenerator in project Gemma by PavlidisLab.
the class DataUpdaterTest method testLoadRNASeqDataWithMissingSamples.
/*
* Test case where some samples cannot be used.
*
*/
@Test
public void testLoadRNASeqDataWithMissingSamples() throws Exception {
geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGenerator());
ExpressionExperiment ee = experimentService.findByShortName("GSE29006");
if (ee != null) {
experimentService.remove(ee);
}
assertTrue(experimentService.findByShortName("GSE29006") == null);
try {
Collection<?> results = geoService.fetchAndLoad("GSE29006", false, false, false);
ee = (ExpressionExperiment) results.iterator().next();
} catch (AlreadyExistsInSystemException e) {
throw new IllegalStateException("Need to remove this data set before test is run");
}
ee = experimentService.thaw(ee);
// Load the data from a text file.
DoubleMatrixReader reader = new DoubleMatrixReader();
try (InputStream countData = this.getClass().getResourceAsStream("/data/loader/expression/flatfileload/GSE29006_expression_count.test.txt");
InputStream rpkmData = this.getClass().getResourceAsStream("/data/loader/expression/flatfileload/GSE29006_expression_RPKM.test.txt")) {
DoubleMatrix<String, String> countMatrix = reader.read(countData);
DoubleMatrix<String, String> rpkmMatrix = reader.read(rpkmData);
List<String> probeNames = countMatrix.getRowNames();
// we have to find the right generic platform to use.
targetArrayDesign = this.getTestPersistentArrayDesign(probeNames, taxonService.findByCommonName("human"));
targetArrayDesign = arrayDesignService.thaw(targetArrayDesign);
try {
dataUpdater.addCountData(ee, targetArrayDesign, countMatrix, rpkmMatrix, 36, true, false);
fail("Should have gotten an exception");
} catch (IllegalArgumentException e) {
// Expected
}
dataUpdater.addCountData(ee, targetArrayDesign, countMatrix, rpkmMatrix, 36, true, true);
}
/*
* Check
*/
ee = experimentService.thaw(ee);
for (BioAssay ba : ee.getBioAssays()) {
assertEquals(targetArrayDesign, ba.getArrayDesignUsed());
}
ExpressionDataDoubleMatrix mat = dataMatrixService.getProcessedExpressionDataMatrix(ee);
assertEquals(199, mat.rows());
assertTrue(mat.getQuantitationTypes().iterator().next().getName().startsWith("log2cpm"));
assertEquals(4, ee.getBioAssays().size());
assertEquals(199 * 3, ee.getRawExpressionDataVectors().size());
assertEquals(199, ee.getProcessedExpressionDataVectors().size());
Collection<DoubleVectorValueObject> processedDataArrays = dataVectorService.getProcessedDataArrays(ee);
assertEquals(199, processedDataArrays.size());
TestUtils.assertBAs(ee, targetArrayDesign, "GSM718709", 320383);
for (DoubleVectorValueObject v : processedDataArrays) {
assertEquals(4, v.getBioAssays().size());
}
}
use of ubic.gemma.core.loader.expression.geo.GeoDomainObjectGenerator in project Gemma by PavlidisLab.
the class ExpressionExperimentPlatformSwitchTest method test.
/**
* for bug 3451
*/
@Test
public void test() {
// GSE36025
//
// GPL9250
geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGenerator());
Collection<?> results = geoService.fetchAndLoad("GSE36025", false, false, false);
ExpressionExperiment ee = (ExpressionExperiment) results.iterator().next();
results = geoService.fetchAndLoad("GPL13112", true, false, false);
ArrayDesign arrayDesign = (ArrayDesign) results.iterator().next();
arrayDesign = arrayDesignService.thaw(arrayDesign);
ee = experimentPlatformSwitchService.switchExperimentToArrayDesign(ee, arrayDesign);
assertNotNull(ee);
Collection<ArrayDesign> arrayDesignsUsed = experimentService.getArrayDesignsUsed(ee);
assertEquals(1, arrayDesignsUsed.size());
assertEquals(arrayDesign, arrayDesignsUsed.iterator().next());
}
use of ubic.gemma.core.loader.expression.geo.GeoDomainObjectGenerator in project Gemma by PavlidisLab.
the class GeoDatasetServiceTest method fetchASeries.
@SuppressWarnings("unused")
// !! Please leave this here, we use it to load data sets for chopping.
void fetchASeries(String accession) {
geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGenerator());
geoService.fetchAndLoad(accession, false, false, false);
}
use of ubic.gemma.core.loader.expression.geo.GeoDomainObjectGenerator in project Gemma by PavlidisLab.
the class ExonArrayDataAddIntegrationTest method testAddAffyExonRat.
@Test
public void testAddAffyExonRat() {
if (!hasApt) {
log.warn("Test skipped due to lack of Affy Power Tools executable");
return;
}
// GSE33597
ExpressionExperiment ee;
try {
geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGenerator());
Collection<?> results = geoService.fetchAndLoad("GSE33597", false, false, false);
ee = (ExpressionExperiment) results.iterator().next();
} catch (AlreadyExistsInSystemException e) {
ee = (ExpressionExperiment) ((List<?>) e.getData()).get(0);
}
dataUpdater.addAffyExonArrayData(ee);
experimentService.load(ee.getId());
}
use of ubic.gemma.core.loader.expression.geo.GeoDomainObjectGenerator in project Gemma by PavlidisLab.
the class ExonArrayDataAddIntegrationTest method testAddAffyExonHuman.
@Test
public void testAddAffyExonHuman() {
if (!hasApt) {
log.warn("Test skipped due to lack of Affy Power Tools executable");
return;
}
// GSE22498
ExpressionExperiment ee;
try {
geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGenerator());
Collection<?> results = geoService.fetchAndLoad("GSE22498", false, false, false);
ee = (ExpressionExperiment) results.iterator().next();
} catch (AlreadyExistsInSystemException e) {
ee = (ExpressionExperiment) ((List<?>) e.getData()).get(0);
}
dataUpdater.addAffyExonArrayData(ee);
experimentService.load(ee.getId());
}
Aggregations