use of ubic.gemma.core.analysis.expression.diff.DifferentialExpressionAnalyzerServiceImpl.AnalysisType in project Gemma by PavlidisLab.
the class DifferentialExpressionAnalysisController method determineAnalysisType.
/**
* Ajax method. Pick the analysis type when we want it to be completely automated.
*
* @param id id
* @return analysis info
*/
public DifferentialExpressionAnalyzerInfo determineAnalysisType(Long id) {
ExpressionExperiment ee = expressionExperimentService.load(id);
if (ee == null) {
throw new IllegalArgumentException("Cannot access experiment with id=" + id);
}
ee = expressionExperimentService.thawLite(ee);
Collection<ExperimentalFactor> factorsWithoutBatch = ExperimentalDesignUtils.factorsWithoutBatch(ee.getExperimentalDesign().getExperimentalFactors());
AnalysisType analyzer = this.analysisSelectionAndExecutionService.determineAnalysis(ee, factorsWithoutBatch, null, true);
DifferentialExpressionAnalyzerInfo result = new DifferentialExpressionAnalyzerInfo();
// we include all factors here, so that batch can be used for subsetting (up to client)
for (ExperimentalFactor factor : ee.getExperimentalDesign().getExperimentalFactors()) {
result.getFactors().add(new ExperimentalFactorValueObject(factor));
}
if (analyzer == null) {
/*
* Either there are no viable automatic choices, or there are no usable factors...
*/
if (factorsWithoutBatch.size() < 2) {
throw new IllegalStateException("This data set does not seem suitable for analysis.");
}
result.setType(AnalysisType.GENERICLM.toString());
} else {
result.setType(analyzer.toString());
}
return result;
}
Aggregations