Search in sources :

Example 11 with BioAssaySet

use of ubic.gemma.model.expression.experiment.BioAssaySet in project Gemma by PavlidisLab.

the class BatchEffectPopulationCli method doWork.

@Override
protected Exception doWork(String[] args) {
    Exception ex = super.processCommandLine(args);
    if (ex != null)
        return ex;
    BatchInfoPopulationService ser = this.getBean(BatchInfoPopulationService.class);
    for (BioAssaySet bas : this.expressionExperiments) {
        if (bas instanceof ExpressionExperiment) {
            if (!force && this.noNeedToRun(bas, BatchInformationFetchingEvent.class)) {
                AbstractCLI.log.debug("Can't or don't need to run " + bas);
                continue;
            }
            AbstractCLI.log.info("Processing: " + bas);
            try {
                ExpressionExperiment ee = (ExpressionExperiment) bas;
                ee = this.eeService.thawLite(ee);
                boolean success = ser.fillBatchInformation(ee, force);
                if (success) {
                    this.successObjects.add(bas.toString());
                } else {
                    this.errorObjects.add(bas.toString());
                }
            } catch (Exception e) {
                AbstractCLI.log.error(e, e);
                this.errorObjects.add(bas + ": " + e.getMessage());
            }
        }
    }
    this.summarizeProcessing();
    return null;
}
Also used : BioAssaySet(ubic.gemma.model.expression.experiment.BioAssaySet) BatchInfoPopulationService(ubic.gemma.core.analysis.preprocess.batcheffects.BatchInfoPopulationService) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment) BatchInformationFetchingEvent(ubic.gemma.model.common.auditAndSecurity.eventType.BatchInformationFetchingEvent)

Example 12 with BioAssaySet

use of ubic.gemma.model.expression.experiment.BioAssaySet in project Gemma by PavlidisLab.

the class ExperimentalDesignWriterCLI method doWork.

@Override
protected Exception doWork(String[] args) {
    Exception e = super.processCommandLine(args);
    if (e != null)
        return e;
    for (BioAssaySet ee : expressionExperiments) {
        if (ee instanceof ExpressionExperiment) {
            ExperimentalDesignWriter edWriter = new ExperimentalDesignWriter();
            try (PrintWriter writer = new PrintWriter(outFileName + "_" + FileTools.cleanForFileName(((ExpressionExperiment) ee).getShortName()) + ".txt")) {
                edWriter.write(writer, (ExpressionExperiment) ee, true);
                writer.flush();
                writer.close();
            } catch (IOException exception) {
                return exception;
            }
        } else {
            throw new UnsupportedOperationException("Can't handle non-EE BioAssaySets yet");
        }
    }
    return null;
}
Also used : BioAssaySet(ubic.gemma.model.expression.experiment.BioAssaySet) ExperimentalDesignWriter(ubic.gemma.core.datastructure.matrix.ExperimentalDesignWriter) IOException(java.io.IOException) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment) IOException(java.io.IOException) PrintWriter(java.io.PrintWriter)

Example 13 with BioAssaySet

use of ubic.gemma.model.expression.experiment.BioAssaySet 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)

Example 14 with BioAssaySet

use of ubic.gemma.model.expression.experiment.BioAssaySet in project Gemma by PavlidisLab.

the class ExpressionExperimentPlatformSwitchCli method doWork.

@Override
protected Exception doWork(String[] args) {
    Exception exp = this.processCommandLine(args);
    if (exp != null) {
        return exp;
    }
    serv = this.getBean(ExpressionExperimentPlatformSwitchService.class);
    for (BioAssaySet ee : expressionExperiments) {
        if (ee instanceof ExpressionExperiment) {
            this.processExperiment((ExpressionExperiment) ee);
        } else {
            throw new UnsupportedOperationException("Can't handle non-EE BioAssaySets yet");
        }
    }
    this.summarizeProcessing();
    return null;
}
Also used : ExpressionExperimentPlatformSwitchService(ubic.gemma.core.loader.expression.ExpressionExperimentPlatformSwitchService) BioAssaySet(ubic.gemma.model.expression.experiment.BioAssaySet) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment)

Example 15 with BioAssaySet

use of ubic.gemma.model.expression.experiment.BioAssaySet in project Gemma by PavlidisLab.

the class VectorMergingCli method doWork.

@Override
protected Exception doWork(String[] args) {
    Exception e = this.processCommandLine(args);
    if (e != null) {
        return e;
    }
    mergingService = this.getBean(VectorMergingService.class);
    for (BioAssaySet ee : expressionExperiments) {
        if (ee instanceof ExpressionExperiment) {
            this.processExperiment((ExpressionExperiment) ee);
        } else {
            throw new UnsupportedOperationException("Can't do vector merging on non-expressionExperiment bioassaysets");
        }
    }
    this.summarizeProcessing();
    return null;
}
Also used : VectorMergingService(ubic.gemma.core.analysis.preprocess.VectorMergingService) BioAssaySet(ubic.gemma.model.expression.experiment.BioAssaySet) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment)

Aggregations

BioAssaySet (ubic.gemma.model.expression.experiment.BioAssaySet)39 ExpressionExperiment (ubic.gemma.model.expression.experiment.ExpressionExperiment)25 HashSet (java.util.HashSet)6 ExpressionExperimentSet (ubic.gemma.model.analysis.expression.ExpressionExperimentSet)6 Taxon (ubic.gemma.model.genome.Taxon)6 IOException (java.io.IOException)4 ArrayDesign (ubic.gemma.model.expression.arrayDesign.ArrayDesign)4 ArrayList (java.util.ArrayList)3 StopWatch (org.apache.commons.lang3.time.StopWatch)3 Transactional (org.springframework.transaction.annotation.Transactional)3 SecurityService (gemma.gsec.SecurityService)2 Element (org.w3c.dom.Element)2 PreprocessingException (ubic.gemma.core.analysis.preprocess.PreprocessingException)2 DataUpdater (ubic.gemma.core.loader.expression.geo.DataUpdater)2 DifferentialExpressionValueObject (ubic.gemma.model.analysis.expression.diff.DifferentialExpressionValueObject)2 CompositeSequence (ubic.gemma.model.expression.designElement.CompositeSequence)2 ExpressionExperimentSubSet (ubic.gemma.model.expression.experiment.ExpressionExperimentSubSet)2 ExpressionExperimentValueObject (ubic.gemma.model.expression.experiment.ExpressionExperimentValueObject)2 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1