use of ubic.gemma.model.analysis.expression.diff.DifferentialExpressionAnalysis in project Gemma by PavlidisLab.
the class AnalysisUtilServiceImpl method deleteOldAnalyses.
@Override
public boolean deleteOldAnalyses(ExpressionExperiment expExp) {
boolean removedAll = true;
AnalysisUtilServiceImpl.log.info("Removing old analyses for " + expExp);
if (principalComponentAnalysisService.loadForExperiment(expExp) != null) {
try {
principalComponentAnalysisService.removeForExperiment(expExp);
} catch (Exception e) {
AnalysisUtilServiceImpl.log.warn("Could not remove pca for: " + expExp);
removedAll = false;
}
}
for (DifferentialExpressionAnalysis diff : differentialExpressionAnalysisService.findByInvestigation(expExp)) {
try {
differentialExpressionAnalysisService.remove(diff);
} catch (Exception e) {
AnalysisUtilServiceImpl.log.warn("Could not remove analysis: " + diff + ": " + e.getMessage());
removedAll = false;
}
}
for (CoexpressionAnalysis coex : coexpressionAnalysisService.findByInvestigation(expExp)) {
try {
coexpressionAnalysisService.remove(coex);
} catch (Exception e) {
AnalysisUtilServiceImpl.log.warn("Could not remove analysis: " + coex + ": " + e.getMessage());
removedAll = false;
}
}
return removedAll;
}
use of ubic.gemma.model.analysis.expression.diff.DifferentialExpressionAnalysis in project Gemma by PavlidisLab.
the class AbstractDifferentialExpressionAnalyzer method initAnalysisEntity.
DifferentialExpressionAnalysis initAnalysisEntity(BioAssaySet bioAssaySet, DifferentialExpressionAnalysisConfig config) {
if (config == null) {
config = new DifferentialExpressionAnalysisConfig();
}
DifferentialExpressionAnalysis expressionAnalysis = config.toAnalysis();
expressionAnalysis.setExperimentAnalyzed(bioAssaySet);
return expressionAnalysis;
}
use of ubic.gemma.model.analysis.expression.diff.DifferentialExpressionAnalysis in project Gemma by PavlidisLab.
the class ExpressionExperimentSubSetServiceImpl method remove.
/**
* doesn't include removal of sample coexpression matrices, PCA, probe2probe coexpression links, or adjusting
* experiment set members
*
* @param subset subset
*/
@Override
@Transactional
public void remove(ExpressionExperimentSubSet subset) {
if (subset == null) {
throw new IllegalArgumentException("ExperimentSubSet cannot be null");
}
// Remove differential expression analyses
Collection<DifferentialExpressionAnalysis> diffAnalyses = this.differentialExpressionAnalysisDao.findByInvestigation(subset);
for (DifferentialExpressionAnalysis de : diffAnalyses) {
Long toDelete = de.getId();
this.differentialExpressionAnalysisDao.remove(toDelete);
}
this.expressionExperimentSubSetDao.remove(subset);
/*
* FIXME Coexpression involving this data set will linger on ...
*/
}
use of ubic.gemma.model.analysis.expression.diff.DifferentialExpressionAnalysis in project Gemma by PavlidisLab.
the class ExperimentalFactorServiceImpl method delete.
@Override
public void delete(ExperimentalFactor experimentalFactor) {
/*
* First, check to see if there are any diff results that use this factor.
*/
Collection<DifferentialExpressionAnalysis> analyses = differentialExpressionAnalysisDao.findByFactor(experimentalFactor);
for (DifferentialExpressionAnalysis a : analyses) {
differentialExpressionAnalysisDao.remove(a);
}
this.experimentalFactorDao.remove(experimentalFactor);
}
use of ubic.gemma.model.analysis.expression.diff.DifferentialExpressionAnalysis in project Gemma by PavlidisLab.
the class DiffExWithInvalidInteractionTest method test.
/**
* This should automatically drop the interaction. If it fails on a 'no residual degrees of freedom' it means we're
* not detecting thatS
*/
@Test
public void test() {
ee = expressionExperimentService.thawLite(ee);
Collection<ExperimentalFactor> factors = ee.getExperimentalDesign().getExperimentalFactors();
// includes batch
assertEquals(3, factors.size());
for (BioAssay ba : ee.getBioAssays()) {
assertEquals(3, ba.getSampleUsed().getFactorValues().size());
}
ExperimentalFactor timepoint = null;
ExperimentalFactor treatment = null;
for (ExperimentalFactor ef : factors) {
if (ef.getCategory().getValue().equals("timepoint")) {
timepoint = ef;
} else if (ef.getCategory().getValue().equals("treatment")) {
treatment = ef;
}
}
assertNotNull(treatment);
assertNotNull(timepoint);
DifferentialExpressionAnalysisConfig config = new DifferentialExpressionAnalysisConfig();
config.getFactorsToInclude().add(timepoint);
config.getFactorsToInclude().add(treatment);
config.addInteractionToInclude(treatment, timepoint);
analyzer = this.getBean(AnalysisSelectionAndExecutionService.class);
Collection<DifferentialExpressionAnalysis> result = analyzer.analyze(ee, config);
assertEquals(1, result.size());
}
Aggregations