use of ubic.gemma.core.loader.util.AlreadyExistsInSystemException in project Gemma by PavlidisLab.
the class TwoWayAnovaWithInteractionsTest2 method setup.
@Before
public void setup() throws Exception {
geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(FileTools.resourceToPath("/data/analysis/expression/gse18795short")));
try {
Collection<?> results = geoService.fetchAndLoad("GSE18795", 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/gse18795short/6290_GSE18795_expdesign.data.txt"));
}
use of ubic.gemma.core.loader.util.AlreadyExistsInSystemException 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.util.AlreadyExistsInSystemException 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());
}
use of ubic.gemma.core.loader.util.AlreadyExistsInSystemException in project Gemma by PavlidisLab.
the class ProcessedExpressionDataVectorServiceTest method getDataset.
private Collection<ExpressionExperiment> getDataset() throws Exception {
// Dataset uses spotted arrays, 11 samples.
ExpressionExperiment ee;
try {
geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(this.getTestFileBasePath("gse432Short")));
// noinspection unchecked
Collection<ExpressionExperiment> results = (Collection<ExpressionExperiment>) geoService.fetchAndLoad("GSE432", false, true, false);
ee = results.iterator().next();
TwoChannelMissingValues tcmv = this.getBean(TwoChannelMissingValues.class);
tcmv.computeMissingValues(ee, 1.5, null);
// No masked preferred computation.
} catch (AlreadyExistsInSystemException e) {
if (e.getData() instanceof List) {
ee = (ExpressionExperiment) ((List<?>) e.getData()).iterator().next();
} else {
ee = (ExpressionExperiment) e.getData();
}
} catch (Exception e) {
if (e.getCause() instanceof IOException && e.getCause().getMessage().contains("502")) {
return null;
}
throw e;
}
ee.setShortName(RandomStringUtils.randomAlphabetic(12));
expressionExperimentService.update(ee);
ee = expressionExperimentService.thawLite(ee);
processedDataVectorService.createProcessedDataVectors(ee);
Collection<ExpressionExperiment> e = new HashSet<>();
e.add(ee);
return e;
}
use of ubic.gemma.core.loader.util.AlreadyExistsInSystemException in project Gemma by PavlidisLab.
the class SubsettedAnalysis3Test method setup.
@Before
public void setup() throws Exception {
geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(FileTools.resourceToPath("/data/analysis/expression/gse26927short")));
try {
Collection<?> results = geoService.fetchAndLoad("GSE26927", 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/gse26927short/2684_GSE26927_expdesign.data.txt"));
}
Aggregations