use of ubic.gemma.core.loader.util.AlreadyExistsInSystemException in project Gemma by PavlidisLab.
the class GeoDatasetServiceTest method testFetchAndLoadMultiChipPerSeriesShort.
@Test
public void testFetchAndLoadMultiChipPerSeriesShort() throws Exception {
geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(this.getTestFileBasePath("shortTest")));
/*
* HG-U133A. GDS473 is for the other chip (B). Series is GSE674. see
* http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=gds&term=GSE674[Accession]&cmd=search
*/
ExpressionExperiment newee;
try {
Collection<?> results = geoService.fetchAndLoad("GSE674", false, true, false);
newee = (ExpressionExperiment) results.iterator().next();
} catch (AlreadyExistsInSystemException e) {
log.info("Skipping test, data already exists in db");
return;
}
assertNotNull(newee);
newee = eeService.thaw(newee);
/*
* Test for bug 468 (merging of subsets across GDS's)
*/
ExperimentalFactor factor = newee.getExperimentalDesign().getExperimentalFactors().iterator().next();
// otherwise get 4.
assertEquals(2, factor.getFactorValues().size());
Collection<RawExpressionDataVector> vectors = newee.getRawExpressionDataVectors();
rawExpressionDataVectorService.thaw(vectors);
ExpressionDataMatrixBuilder builder = new ExpressionDataMatrixBuilder(vectors);
ExpressionDataMatrix<Double> matrix = builder.getPreferredData();
assertNotNull(matrix);
assertEquals(31, matrix.rows());
assertEquals(15, matrix.columns());
// GSM10363 = D1-U133B
this.testMatrixValue(newee, matrix, "200000_s_at", "GSM10363", 5722.0);
// GSM10380 = C7-U133A
this.testMatrixValue(newee, matrix, "1007_s_at", "GSM10380", 1272.0);
}
use of ubic.gemma.core.loader.util.AlreadyExistsInSystemException in project Gemma by PavlidisLab.
the class GeoDatasetServiceTest method testFetchAndLoadGSE18707.
/*
* For bug 2312 - qts getting dropped.
*/
@Test
public void testFetchAndLoadGSE18707() throws Exception {
try {
geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(this.getTestFileBasePath()));
Collection<?> results = geoService.fetchAndLoad("GSE18707", false, true, false);
ee = (ExpressionExperiment) results.iterator().next();
} catch (AlreadyExistsInSystemException e) {
log.info("Test skipped because GSE18707 was already loaded - clean the DB before running the test");
return;
}
// Mouse430A_2.
ee = eeService.findByShortName("GSE18707");
aclTestUtils.checkEEAcls(ee);
Collection<QuantitationType> qts = eeService.getQuantitationTypes(ee);
assertEquals(1, qts.size());
QuantitationType qt = qts.iterator().next();
assertEquals("Processed Affymetrix Rosetta intensity values", qt.getDescription());
Collection<ProcessedExpressionDataVector> dataVectors = processedExpressionDataVectorService.computeProcessedExpressionData(ee);
assertEquals(100, dataVectors.size());
ee = eeService.findByShortName("GSE18707");
qts = eeService.getQuantitationTypes(ee);
assertEquals(2, qts.size());
}
use of ubic.gemma.core.loader.util.AlreadyExistsInSystemException 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));
}
use of ubic.gemma.core.loader.util.AlreadyExistsInSystemException in project Gemma by PavlidisLab.
the class LowVarianceDataTest method setup.
@Before
public void setup() throws Exception {
geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(FileTools.resourceToPath("/data/analysis/expression")));
try {
Collection<?> results = geoService.fetchAndLoad("GSE19420", false, true, false);
ee = (ExpressionExperiment) results.iterator().next();
} catch (AlreadyExistsInSystemException e) {
ee = (ExpressionExperiment) ((Collection<?>) e.getData()).iterator().next();
}
ee = expressionExperimentService.thawLite(ee);
Collection<ExperimentalFactor> toremove = new HashSet<>(ee.getExperimentalDesign().getExperimentalFactors());
for (ExperimentalFactor ef : toremove) {
experimentalFactorService.delete(ef);
ee.getExperimentalDesign().getExperimentalFactors().remove(ef);
}
expressionExperimentService.update(ee);
processedExpressionDataVectorService.computeProcessedExpressionData(ee);
ee = expressionExperimentService.thaw(ee);
designImporter.importDesign(ee, this.getClass().getResourceAsStream("/data/analysis/expression/2976_GSE19420_expdesign.data.txt"));
}
use of ubic.gemma.core.loader.util.AlreadyExistsInSystemException in project Gemma by PavlidisLab.
the class SubsettedAnalysis2Test method setup.
@Before
public void setup() throws Exception {
geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(FileTools.resourceToPath("/data/analysis/expression/gse12991short")));
try {
Collection<?> results = geoService.fetchAndLoad("GSE12991", false, true, false);
ee = (ExpressionExperiment) results.iterator().next();
} catch (AlreadyExistsInSystemException e) {
ee = (ExpressionExperiment) ((Collection<?>) e.getData()).iterator().next();
}
ee = expressionExperimentService.thawLite(ee);
Collection<ExperimentalFactor> toremove = new HashSet<>(ee.getExperimentalDesign().getExperimentalFactors());
for (ExperimentalFactor ef : toremove) {
experimentalFactorService.delete(ef);
ee.getExperimentalDesign().getExperimentalFactors().remove(ef);
}
expressionExperimentService.update(ee);
processedExpressionDataVectorService.computeProcessedExpressionData(ee);
ee = expressionExperimentService.thaw(ee);
designImporter.importDesign(ee, this.getClass().getResourceAsStream("/data/analysis/expression/gse12991short/6283_GSE12991_expdesign.data.txt"));
}
Aggregations