Search in sources :

Example 1 with ExpressionDataFileService

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;
}
Also used : BioAssaySet(ubic.gemma.model.expression.experiment.BioAssaySet) IOException(java.io.IOException) ExpressionDataFileService(ubic.gemma.core.analysis.service.ExpressionDataFileService) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 ExpressionDataFileService (ubic.gemma.core.analysis.service.ExpressionDataFileService)1 BioAssaySet (ubic.gemma.model.expression.experiment.BioAssaySet)1