use of ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal in project Gemma by PavlidisLab.
the class ContinuousVariableDiffExTest method setup.
@Before
public void setup() throws Exception {
/*
* this is an exon array data set that has the data present. It's an annoying choice for a test in that it
* exposes issues with our attempts to ignore the data from exon arrays until we get it from the raw CEL files.
*/
geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(FileTools.resourceToPath("/data/analysis/expression/gse13949short")));
try {
Collection<?> results = geoService.fetchAndLoad("GSE13949", 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/gse13949short/1151_GSE13949_expdesign.data.txt"));
}
use of ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal in project Gemma by PavlidisLab.
the class DiffExTest method testGSE35930.
/**
* Test where probes have constant values. See bug 3177.
*/
@Test
public void testGSE35930() throws Exception {
ExpressionExperiment ee;
// eeService.remove( eeService.findByShortName( "GSE35930" ) );
try {
geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(this.getTestFileBasePath("GSE35930")));
Collection<?> results = geoService.fetchAndLoad("GSE35930", false, true, false);
ee = (ExpressionExperiment) results.iterator().next();
} catch (AlreadyExistsInSystemException e) {
// OK.
if (e.getData() instanceof List) {
ee = (ExpressionExperiment) ((List<?>) e.getData()).iterator().next();
} else {
ee = (ExpressionExperiment) e.getData();
}
}
ee = this.eeService.thawLite(ee);
processedExpressionDataVectorService.computeProcessedExpressionData(ee);
if (ee.getExperimentalDesign().getExperimentalFactors().isEmpty()) {
ee = eeService.load(ee.getId());
ee = this.eeService.thawLite(ee);
try (InputStream is = this.getClass().getResourceAsStream("/data/loader/expression/geo/GSE35930/design.txt")) {
experimentalDesignImporter.importDesign(ee, is);
}
ee = eeService.load(ee.getId());
ee = this.eeService.thawLite(ee);
}
DifferentialExpressionAnalysisConfig config = new DifferentialExpressionAnalysisConfig();
config.setFactorsToInclude(ee.getExperimentalDesign().getExperimentalFactors());
Collection<DifferentialExpressionAnalysis> analyses = analyzer.run(ee, config);
assertNotNull(analyses);
assertEquals(1, analyses.size());
DifferentialExpressionAnalysis results = analyses.iterator().next();
boolean found = false;
ExpressionAnalysisResultSet resultSet = results.getResultSets().iterator().next();
for (DifferentialExpressionAnalysisResult r : resultSet.getResults()) {
// this probe has a constant value
if (r.getProbe().getName().equals("1622910_at")) {
fail("Should not have found a result for constant probe");
// found = true;
// assertTrue( "Got: " + pvalue, pvalue == null || pvalue.equals( Double.NaN ) );
} else {
// got to have something...
found = true;
}
}
assertTrue(found);
}
use of ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal in project Gemma by PavlidisLab.
the class ExperimentalDesignWriterTest method setup.
@Before
public void setup() throws Exception {
ee = eeService.findByShortName(shortName);
if (ee == null) {
geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(this.getTestFileBasePath("gds994Medium")));
Collection<?> results = geoService.fetchAndLoad(shortName, false, true, false);
ee = (ExpressionExperiment) results.iterator().next();
}
ee = eeService.thaw(ee);
}
use of ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal in project Gemma by PavlidisLab.
the class ExonArrayDataAddIntegrationTest method testAddAffyExonArrayDataExpressionExperiment.
@Test
public void testAddAffyExonArrayDataExpressionExperiment() throws Exception {
if (!hasApt) {
log.warn("Test skipped due to lack of Affy Power Tools executable");
return;
}
ExpressionExperiment ee;
try {
geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(this.getTestFileBasePath()));
Collection<?> results = geoService.fetchAndLoad("GSE12135", false, true, false);
ee = (ExpressionExperiment) results.iterator().next();
} catch (AlreadyExistsInSystemException e) {
ee = (ExpressionExperiment) ((List<?>) e.getData()).get(0);
}
/*
* Add the raw data.
*/
dataUpdater.addAffyExonArrayData(ee);
experimentService.load(ee.getId());
}
use of ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal in project Gemma by PavlidisLab.
the class DesignElementDataVectorServiceTest method testFindByQt.
@Test
public void testFindByQt() throws Exception {
try {
geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(this.getTestFileBasePath("gse432Short")));
Collection<?> results = geoService.fetchAndLoad("GSE432", false, true, false);
newee = (ExpressionExperiment) results.iterator().next();
} catch (AlreadyExistsInSystemException e) {
newee = (ExpressionExperiment) e.getData();
}
newee.setShortName(RandomStringUtils.randomAlphabetic(12));
expressionExperimentService.update(newee);
newee = this.expressionExperimentService.thawLite(newee);
RawExpressionDataVectorService rawService = this.getBean(RawExpressionDataVectorService.class);
QuantitationType qt = null;
for (QuantitationType q : newee.getQuantitationTypes()) {
if (q.getIsPreferred()) {
qt = q;
break;
}
}
assertNotNull("QT is null", qt);
Collection<? extends DesignElementDataVector> preferredVectors = rawService.findRawAndProcessed(qt);
assertNotNull(preferredVectors);
assertEquals(40, preferredVectors.size());
}
Aggregations