Search in sources :

Example 76 with ExpressionExperiment

use of ubic.gemma.model.expression.experiment.ExpressionExperiment 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 77 with ExpressionExperiment

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

the class ExperimentalDesignImportCli method locateExpressionExperiment.

/**
 * @param shortName short name of the experiment to find.
 * @return experiment with the given short name, if it exists. Bails otherwise with {@link ubic.gemma.core.util.AbstractCLI.ErrorCode#INVALID_OPTION}.
 */
// Possible external use
@SuppressWarnings({ "unused", "WeakerAccess" })
protected ExpressionExperiment locateExpressionExperiment(String shortName) {
    if (shortName == null) {
        errorObjects.add("Expression experiment short name must be provided");
        return null;
    }
    ExpressionExperimentService eeService = this.getBean(ExpressionExperimentService.class);
    ExpressionExperiment experiment = eeService.findByShortName(shortName);
    if (experiment == null) {
        AbstractCLI.log.error("No experiment " + shortName + " found");
        this.bail(ErrorCode.INVALID_OPTION);
    }
    return experiment;
}
Also used : ExpressionExperimentService(ubic.gemma.persistence.service.expression.experiment.ExpressionExperimentService) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment)

Example 78 with ExpressionExperiment

use of ubic.gemma.model.expression.experiment.ExpressionExperiment 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 79 with ExpressionExperiment

use of ubic.gemma.model.expression.experiment.ExpressionExperiment 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 80 with ExpressionExperiment

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

ExpressionExperiment (ubic.gemma.model.expression.experiment.ExpressionExperiment)214 Test (org.junit.Test)71 BaseSpringContextTest (ubic.gemma.core.testing.BaseSpringContextTest)42 InputStream (java.io.InputStream)36 GeoSeries (ubic.gemma.core.loader.expression.geo.model.GeoSeries)29 AlreadyExistsInSystemException (ubic.gemma.core.loader.util.AlreadyExistsInSystemException)29 GZIPInputStream (java.util.zip.GZIPInputStream)28 ArrayDesign (ubic.gemma.model.expression.arrayDesign.ArrayDesign)26 HashSet (java.util.HashSet)25 BioAssaySet (ubic.gemma.model.expression.experiment.BioAssaySet)25 GeoDomainObjectGeneratorLocal (ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal)23 AbstractGeoServiceTest (ubic.gemma.core.loader.expression.geo.AbstractGeoServiceTest)22 BioAssay (ubic.gemma.model.expression.bioAssay.BioAssay)20 Collection (java.util.Collection)18 StopWatch (org.apache.commons.lang3.time.StopWatch)18 ExperimentalFactor (ubic.gemma.model.expression.experiment.ExperimentalFactor)18 Taxon (ubic.gemma.model.genome.Taxon)14 Before (org.junit.Before)12 RawExpressionDataVector (ubic.gemma.model.expression.bioAssayData.RawExpressionDataVector)12 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)11