use of ubic.gemma.core.analysis.service.ExpressionDataFileService in project Gemma by PavlidisLab.
the class ExpressionDataMatrixWriterCLI method doWork.
@Override
protected Exception doWork(String[] args) {
Exception err = this.processCommandLine(args);
if (err != null)
return err;
ExpressionDataFileService fs = this.getBean(ExpressionDataFileService.class);
if (expressionExperiments.size() > 1 && StringUtils.isNotBlank(outFileName)) {
throw new IllegalArgumentException("Output file name can only be used for single experiment output");
}
for (BioAssaySet ee : expressionExperiments) {
String fileName;
if (StringUtils.isNotBlank(outFileName)) {
fileName = outFileName;
} else {
fileName = FileTools.cleanForFileName(((ExpressionExperiment) ee).getShortName()) + ".txt";
}
try {
fs.writeDataFile((ExpressionExperiment) ee, filter, fileName, false);
} catch (IOException e) {
this.errorObjects.add(ee + ": " + e);
}
}
return null;
}
Aggregations