use of ubic.gemma.core.analysis.preprocess.batcheffects.BatchConfoundValueObject in project Gemma by PavlidisLab.
the class ExpressionExperimentServiceImpl method getBatchConfound.
@Override
@Transactional(readOnly = true)
public String getBatchConfound(ExpressionExperiment ee) {
ee = this.thawBioAssays(ee);
if (!this.checkHasBatchInfo(ee)) {
return null;
}
Collection<BatchConfoundValueObject> confounds;
try {
confounds = BatchConfound.test(ee);
} catch (NotStrictlyPositiveException e) {
AbstractService.log.error("Batch confound test threw a NonStrictlyPositiveException! Returning null.");
return null;
}
StringBuilder result = new StringBuilder("");
for (BatchConfoundValueObject c : confounds) {
if (c.getP() < ExpressionExperimentServiceImpl.BATCH_CONFOUND_THRESHOLD) {
String factorName = c.getEf().getName();
if (!result.toString().isEmpty()) {
result.append(", ");
}
result.append("Factor '").append(factorName).append("' may be confounded with batches; p=").append(String.format("%.2g", c.getP()));
}
}
return Strings.emptyToNull(result.toString());
}
Aggregations