Class ExpressionExperimentManipulatingCLI
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware,org.springframework.context.EnvironmentAware,CLI
- Direct Known Subclasses:
AffyDataFromCelCli,BatchEffectPopulationCli,DeleteDiffExCli,DeleteExperimentsCli,DifferentialExpressionAnalysisCli,DifferentialExpressionAnalysisWriterCli,ExperimentalDesignImportCli,ExperimentalDesignWriterCLI,ExpressionDataCorrMatCli,ExpressionDataMatrixWriterCLI,ExpressionExperimentDataFileGeneratorCli,ExpressionExperimentDataUpdaterCli,ExpressionExperimentMetadataChangelogEntryAdderCli,ExpressionExperimentMetadataChangelogViewerCli,ExpressionExperimentMetadataFileAdderCli,ExpressionExperimentPlatformSwitchCli,ExpressionExperimentPrimaryPubCli,ExpressionExperimentVectorsManipulatingCli,GeeqCli,LinkAnalysisCli,LockExpressionDataFileCli,MakeExperimentPrivateCli,MakeExperimentsPublicCli,OrderVectorsByDesignCli,ProcessedDataComputeCLI,RefreshExperimentCli,ReplaceDataCli,RNASeqBatchInfoCli,RNASeqDataAddCli,SingleCellCellTypeFactorCreatorCli,SingleCellDataLoaderCli,SingleCellSparsityMetricsUpdaterCli,SplitExperimentCli,SVDCli,UpdateEe2AdCli,UpdateEE2CCli,VectorMergingCli
- All EEs (if -all is supplied)
- All EEs for a particular taxon.
- A specific ExpressionExperimentSet, identified by name
- A comma-delimited list of one or more EEs identified by short name given on the command line
- From a file, with one short name per line.
- EEs matching a query string (e.g., 'brain')
- (Optional) 'Auto' mode, in which experiments to analyze are selected automatically based on their workflow state. This can be enabled and modified by subclasses who override the "needToRun" method.
- All EEs that were last processed after a given date, similar to 'auto' otherwise.
In addition, EEs can be excluded based on a list given in a separate file.
- Author:
- Paul
-
Nested Class Summary
Nested classes/interfaces inherited from interface ubic.gemma.cli.util.CLI
CLI.CommandGroup -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ubic.gemma.persistence.service.common.auditAndSecurity.AuditEventServiceprotected ubic.gemma.persistence.service.common.auditAndSecurity.AuditTrailServiceprotected ubic.gemma.persistence.service.expression.experiment.ExpressionExperimentServiceprotected EntityLocatorprotected ubic.gemma.persistence.util.EntityUrlBuilderFields inherited from class ubic.gemma.cli.util.AbstractAutoSeekingCLI
FORCE_OPTIONFields inherited from class ubic.gemma.cli.util.AbstractCLI
ABORTED, FAILURE, FAILURE_FROM_ERROR_OBJECTS, log, SUCCESS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddCellMetadataFileOptions(org.apache.commons.cli.Options options, String what, boolean allowStandardLocation) protected voidaddDataFileOptions(org.apache.commons.cli.Options options, String what, boolean allowStandardLocation) protected voidaddDataFileOptions(org.apache.commons.cli.Options options, String what, boolean allowStandardLocation, boolean allowFile, boolean allowDirectory, boolean allowCurrentDirectory, boolean allowStdout) protected voidaddDesignFileOptions(org.apache.commons.cli.Options options, String what, boolean allowStandardLocation) protected voidaddExpressionDataFileOptions(org.apache.commons.cli.Options options, String what, boolean allowStandardLocation) protected voidaddSingleCellExpressionDataFileOptions(org.apache.commons.cli.Options options, String what, boolean allowStandardLocation) protected voidaddSingleExperimentAutoOption(org.apache.commons.cli.Options options, String opt, String longOpt, String description, String noOpt, String longNoOpt, String noDescription) Add an auto option that is only available in single-experiment mode.protected <T extends Enum<T>>
voidaddSingleExperimentEnumOption(org.apache.commons.cli.Options options, String opt, String longOpt, String description, Class<T> enumClass, EnumMap<T, org.springframework.context.MessageSourceResolvable> descriptions) Add an enumerated option that is only available in single-experiment mode.protected voidaddSingleExperimentOption(org.apache.commons.cli.Options options, String opt, String longOpt, boolean hasArg, String description) Add an option that is only available in single-experiment mode.protected voidaddSingleExperimentOption(org.apache.commons.cli.Options options, org.apache.commons.cli.Option option) Add an option that is only available in single-experiment mode.protected voidbuildExperimentOptions(org.apache.commons.cli.Options options) protected final voidbuildOptions(org.apache.commons.cli.Options options) Build option implementation.protected voidprotected StringformatExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment bas) Render an experiment to string, with special handling in case of an uninitialized proxy.protected CellMetadataFileOptionValuegetCellMetadataFileOptionValue(org.apache.commons.cli.CommandLine commandLine, boolean allowStandardLocation) Obtain the command group for this CLI.protected DataFileOptionValuegetDataFileOptionValue(org.apache.commons.cli.CommandLine commandLine, boolean allowStandardLocation) protected DataFileOptionValuegetDataFileOptionValue(org.apache.commons.cli.CommandLine commandLine, boolean allowStandardLocation, boolean allowStdout, boolean allowCurrentDirectory) protected DesignFileOptionValuegetDesignFileOptionValue(org.apache.commons.cli.CommandLine commandLine, boolean allowStandardLocation) protected ExpressionDataFileOptionValuegetExpressionDataFileOptionValue(org.apache.commons.cli.CommandLine commandLine, boolean allowStandardLocation) protected SingleCellExpressionDataFileOptionValuegetSingleCellExpressionDataFileOptionValue(org.apache.commons.cli.CommandLine commandLine, boolean allowStandardLocation) booleanIndicate if this CLI should abort on error or move on to the next experiment.protected booleannoNeedToRun(ubic.gemma.model.expression.experiment.ExpressionExperiment auditable, Class<? extends ubic.gemma.model.common.auditAndSecurity.eventType.AuditEventType> eventClass) Check if the given auditable can be skipped.protected voidpostprocessExpressionExperiments(Collection<ubic.gemma.model.expression.experiment.ExpressionExperiment> expressionExperiments) Post-processExpressionExperiments that were processed by the CLI.protected Collection<ubic.gemma.model.expression.experiment.ExpressionExperiment> preprocessExpressionExperiments(Collection<ubic.gemma.model.expression.experiment.ExpressionExperiment> expressionExperiments) Preprocess the set ofExpressionExperimentbefore invokingprocessExpressionExperiments(Collection)orprocessExpressionExperiment(ExpressionExperiment).protected voidProcess allExpressionExperiment.protected voidprocessExperimentOptions(org.apache.commons.cli.CommandLine commandLine) protected voidprocessExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment expressionExperiment) Process anExpressionExperiment.protected voidprocessExpressionExperiments(Collection<ubic.gemma.model.expression.experiment.ExpressionExperiment> expressionExperiments) Process multipleExpressionExperiment.protected final voidprocessOptions(org.apache.commons.cli.CommandLine commandLine) Process command line options.protected StringreadChangelogEntryFromConsole(ubic.gemma.model.expression.experiment.ExpressionExperiment expressionExperiment, String defaultText) Read a changelog entry from the console.protected voidrefreshExpressionExperimentFromGemmaWeb(ubic.gemma.model.expression.experiment.ExpressionExperiment ee, boolean refreshVectors, boolean refreshReports) Refresh a dataset for Gemma Web.protected voidrefreshExpressionExperimentFromGemmaWebSilently(ubic.gemma.model.expression.experiment.ExpressionExperiment ee, boolean refreshVectors, boolean refreshReports) A silent version ofrefreshExpressionExperimentFromGemmaWeb(ExpressionExperiment, boolean, boolean)that produces a warning viaAbstractCLI.addWarningObject(Serializable, String, Throwable)instead of throwing an exception.protected voidSet this to stop processing experiments if an error occurs.voidEnable the "all is lazy" mode.voidDefault to all datasets if no options are provided.protected voidEnable the single-experiment mode.protected voidSet this to allow reference to be retrieved instead of actual entities.protected final SerializabletoBatchObject(ubic.gemma.model.expression.experiment.ExpressionExperiment object) Convert the given object to a serializable object for batch processing.Methods inherited from class ubic.gemma.cli.util.AbstractAutoSeekingCLI
addAutoOption, addAutoOption, addErrorObject, addErrorObject, addErrorObject, addForceOption, addForceOption, addLimitingDateOption, addSuccessObject, addSuccessObject, addWarningObject, addWarningObject, getAutoSeekEventType, getLimitingDate, isAutoSeek, isForce, setForceMethods inherited from class ubic.gemma.cli.util.AbstractAuthenticatedCLI
afterPropertiesSet, doWork, setAuthenticateAnonymously, setEnvironment, setRequireLoginMethods inherited from class ubic.gemma.cli.util.AbstractCLI
abort, addBatchOption, addErrorObject, addErrorObject, addErrorObject, addSuccessObject, addSuccessObject, addThreadsOption, addWarningObject, addWarningObject, allowPositionalArguments, awaitBatchExecutorService, executeCommand, getApplicationContext, getBatchTaskExecutor, getBatchTaskProgressReporter, getCliContext, getCommandAliases, getCommandName, getHelpFooter, getNumThreads, getOptions, getShortDesc, getUsage, promptConfirmationOrAbort, setAllowPositionalArguments, setApplicationContext, setEstimatedMaxTasks, setReportFrequencyMillis
-
Field Details
-
eeService
@Autowired protected ubic.gemma.persistence.service.expression.experiment.ExpressionExperimentService eeService -
auditTrailService
@Autowired protected ubic.gemma.persistence.service.common.auditAndSecurity.AuditTrailService auditTrailService -
auditEventService
@Autowired protected ubic.gemma.persistence.service.common.auditAndSecurity.AuditEventService auditEventService -
entityLocator
-
entityUrlBuilder
@Autowired protected ubic.gemma.persistence.util.EntityUrlBuilder entityUrlBuilder
-
-
Constructor Details
-
ExpressionExperimentManipulatingCLI
protected ExpressionExperimentManipulatingCLI()
-
-
Method Details
-
getCommandGroup
Description copied from interface:CLIObtain the command group for this CLI.- Specified by:
getCommandGroupin interfaceCLI- Overrides:
getCommandGroupin classAbstractCLI
-
addSingleExperimentOption
protected void addSingleExperimentOption(org.apache.commons.cli.Options options, org.apache.commons.cli.Option option) Add an option that is only available in single-experiment mode. -
addSingleExperimentOption
protected void addSingleExperimentOption(org.apache.commons.cli.Options options, String opt, String longOpt, boolean hasArg, String description) Add an option that is only available in single-experiment mode. -
addSingleExperimentAutoOption
protected void addSingleExperimentAutoOption(org.apache.commons.cli.Options options, String opt, String longOpt, String description, String noOpt, String longNoOpt, String noDescription) Add an auto option that is only available in single-experiment mode.- See Also:
-
addSingleExperimentEnumOption
protected <T extends Enum<T>> void addSingleExperimentEnumOption(org.apache.commons.cli.Options options, String opt, String longOpt, String description, Class<T> enumClass, EnumMap<T, org.springframework.context.MessageSourceResolvable> descriptions) Add an enumerated option that is only available in single-experiment mode.- See Also:
-
addDataFileOptions
protected void addDataFileOptions(org.apache.commons.cli.Options options, String what, boolean allowStandardLocation) - See Also:
-
addDataFileOptions
protected void addDataFileOptions(org.apache.commons.cli.Options options, String what, boolean allowStandardLocation, boolean allowFile, boolean allowDirectory, boolean allowCurrentDirectory, boolean allowStdout) - See Also:
-
addExpressionDataFileOptions
protected void addExpressionDataFileOptions(org.apache.commons.cli.Options options, String what, boolean allowStandardLocation) - See Also:
-
addSingleCellExpressionDataFileOptions
protected void addSingleCellExpressionDataFileOptions(org.apache.commons.cli.Options options, String what, boolean allowStandardLocation) -
addDesignFileOptions
protected void addDesignFileOptions(org.apache.commons.cli.Options options, String what, boolean allowStandardLocation) - See Also:
-
addCellMetadataFileOptions
protected void addCellMetadataFileOptions(org.apache.commons.cli.Options options, String what, boolean allowStandardLocation) - See Also:
-
getDataFileOptionValue
protected DataFileOptionValue getDataFileOptionValue(org.apache.commons.cli.CommandLine commandLine, boolean allowStandardLocation) throws org.apache.commons.cli.ParseException - Throws:
org.apache.commons.cli.ParseException
-
getDataFileOptionValue
protected DataFileOptionValue getDataFileOptionValue(org.apache.commons.cli.CommandLine commandLine, boolean allowStandardLocation, boolean allowStdout, boolean allowCurrentDirectory) throws org.apache.commons.cli.ParseException - Throws:
org.apache.commons.cli.ParseException
-
getExpressionDataFileOptionValue
protected ExpressionDataFileOptionValue getExpressionDataFileOptionValue(org.apache.commons.cli.CommandLine commandLine, boolean allowStandardLocation) throws org.apache.commons.cli.ParseException - Throws:
org.apache.commons.cli.ParseException
-
getSingleCellExpressionDataFileOptionValue
protected SingleCellExpressionDataFileOptionValue getSingleCellExpressionDataFileOptionValue(org.apache.commons.cli.CommandLine commandLine, boolean allowStandardLocation) throws org.apache.commons.cli.ParseException - Throws:
org.apache.commons.cli.ParseException
-
getDesignFileOptionValue
protected DesignFileOptionValue getDesignFileOptionValue(org.apache.commons.cli.CommandLine commandLine, boolean allowStandardLocation) throws org.apache.commons.cli.ParseException - Throws:
org.apache.commons.cli.ParseException
-
getCellMetadataFileOptionValue
protected CellMetadataFileOptionValue getCellMetadataFileOptionValue(org.apache.commons.cli.CommandLine commandLine, boolean allowStandardLocation) throws org.apache.commons.cli.ParseException - Throws:
org.apache.commons.cli.ParseException
-
buildOptions
protected final void buildOptions(org.apache.commons.cli.Options options) Description copied from class:AbstractCLIBuild option implementation.Implement this method to add options to your command line, using the OptionBuilder.
This is called right after
AbstractCLI.buildStandardOptions(Options)so the options will be added after standard options.- Overrides:
buildOptionsin classAbstractCLI
-
buildExperimentOptions
protected void buildExperimentOptions(org.apache.commons.cli.Options options) -
processOptions
protected final void processOptions(org.apache.commons.cli.CommandLine commandLine) throws org.apache.commons.cli.ParseException Description copied from class:AbstractCLIProcess command line options.Implement this to provide processing of options. It is called after
AbstractCLI.buildOptions(Options)and right beforeAbstractCLI.doWork().- Overrides:
processOptionsin classAbstractAutoSeekingCLI<ubic.gemma.model.expression.experiment.ExpressionExperiment>- Throws:
org.apache.commons.cli.ParseException- in case of unrecoverable failure (i.e. missing option or invalid value), an exception can be raised and will result in an exit code ofAbstractCLI.FAILURE.
-
processExperimentOptions
protected void processExperimentOptions(org.apache.commons.cli.CommandLine commandLine) throws org.apache.commons.cli.ParseException - Throws:
org.apache.commons.cli.ParseException
-
doAuthenticatedWork
- Specified by:
doAuthenticatedWorkin classAbstractAuthenticatedCLI- Throws:
Exception
-
preprocessExpressionExperiments
protected Collection<ubic.gemma.model.expression.experiment.ExpressionExperiment> preprocessExpressionExperiments(Collection<ubic.gemma.model.expression.experiment.ExpressionExperiment> expressionExperiments) Preprocess the set ofExpressionExperimentbefore invokingprocessExpressionExperiments(Collection)orprocessExpressionExperiment(ExpressionExperiment).This can be an opportunity to filter or modify the set of experiments.
-
processAllExpressionExperiments
protected void processAllExpressionExperiments()Process allExpressionExperiment.This is only called when
-alland the CLI is configured to treat it lazily withsetAllIsLazy(). -
processExpressionExperiments
protected void processExpressionExperiments(Collection<ubic.gemma.model.expression.experiment.ExpressionExperiment> expressionExperiments) Process multipleExpressionExperiment.This only called if more than one experiment was found.
-
processExpressionExperiment
protected void processExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment expressionExperiment) throws Exception Process anExpressionExperiment.- Throws:
Exception
-
postprocessExpressionExperiments
protected void postprocessExpressionExperiments(Collection<ubic.gemma.model.expression.experiment.ExpressionExperiment> expressionExperiments) Post-processExpressionExperiments that were processed by the CLI. -
toBatchObject
protected final Serializable toBatchObject(@Nullable ubic.gemma.model.expression.experiment.ExpressionExperiment object) Description copied from class:AbstractAutoSeekingCLIConvert the given object to a serializable object for batch processing.- Specified by:
toBatchObjectin classAbstractAutoSeekingCLI<ubic.gemma.model.expression.experiment.ExpressionExperiment>
-
refreshExpressionExperimentFromGemmaWebSilently
protected void refreshExpressionExperimentFromGemmaWebSilently(ubic.gemma.model.expression.experiment.ExpressionExperiment ee, boolean refreshVectors, boolean refreshReports) A silent version ofrefreshExpressionExperimentFromGemmaWeb(ExpressionExperiment, boolean, boolean)that produces a warning viaAbstractCLI.addWarningObject(Serializable, String, Throwable)instead of throwing an exception.- See Also:
-
refreshExpressionExperimentFromGemmaWeb
protected void refreshExpressionExperimentFromGemmaWeb(ubic.gemma.model.expression.experiment.ExpressionExperiment ee, boolean refreshVectors, boolean refreshReports) throws Exception Refresh a dataset for Gemma Web.- Parameters:
refreshVectors- if true, refresh vectors from the caches, that include raw, single-cell, processed and also cached processed vectors in the form ofDataVectorValueObject.- Throws:
Exception
-
setSingleExperimentMode
protected void setSingleExperimentMode()Enable the single-experiment mode. -
setDefaultToAll
public void setDefaultToAll()Default to all datasets if no options are provided.This is a very dangerous setting that should be combined with
useReferencesIfPossible. -
setAllIsLazy
public void setAllIsLazy()Enable the "all is lazy" mode.When
-allis set, no experiments are actually loaded andprocessAllExpressionExperiments()is called instead. -
setUseReferencesIfPossible
protected void setUseReferencesIfPossible()Set this to allow reference to be retrieved instead of actual entities.This only works for entities retrieved by ID.
When this is enabled, do not access anything but
ExpressionExperiment.getId(), or else proxy-initialization will be triggered, and you will have to deal with aLazyInitializationException.The default is false.
-
isAbortOnError
public boolean isAbortOnError()Indicate if this CLI should abort on error or move on to the next experiment. -
setAbortOnError
protected void setAbortOnError()Set this to stop processing experiments if an error occurs. -
formatExperiment
Render an experiment to string, with special handling in case of an uninitialized proxy.Use this for printing datasets if
useReferencesIfPossibleis set to preventLazyInitializationException. -
noNeedToRun
protected boolean noNeedToRun(ubic.gemma.model.expression.experiment.ExpressionExperiment auditable, @Nullable Class<? extends ubic.gemma.model.common.auditAndSecurity.eventType.AuditEventType> eventClass) Description copied from class:AbstractAutoSeekingCLICheck if the given auditable can be skipped.- Overrides:
noNeedToRunin classAbstractAutoSeekingCLI<ubic.gemma.model.expression.experiment.ExpressionExperiment>- Parameters:
auditable- auditableeventClass- can be null- Returns:
- boolean
-
readChangelogEntryFromConsole
protected String readChangelogEntryFromConsole(ubic.gemma.model.expression.experiment.ExpressionExperiment expressionExperiment, @Nullable String defaultText) throws IOException, InterruptedException Read a changelog entry from the console.- Parameters:
defaultText- a default text to be shown in the editor, or null to keep the file empty- Throws:
IOExceptionInterruptedException
-