Class ArrayDesignSequenceManipulatingCli
- 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:
ArrayDesignAnnotationFileCli, ArrayDesignAuditTrailCleanupCli, ArrayDesignBioSequenceDetachCli, ArrayDesignBlatCli, ArrayDesignMapSummaryCli, ArrayDesignMergeCli, ArrayDesignProbeCleanupCLI, ArrayDesignProbeMapperCli, ArrayDesignRepeatScanCli, ArrayDesignReportCli, ArrayDesignSequenceAssociationCli, ArrayDesignSubsumptionTesterCli, BioSequenceCleanupCli
- Author:
- pavlidis
-
Nested Class Summary
Nested classes/interfaces inherited from interface CLI
CLI.CommandGroup -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ArrayDesignReportServiceprotected ArrayDesignServiceprotected AuditEventServiceprotected AuditTrailServiceprotected EntityLocatorprotected static final StringFields inherited from class AbstractAutoSeekingCLI
FORCE_OPTIONFields inherited from class AbstractCLI
ABORTED, FAILURE, FAILURE_FROM_ERROR_OBJECTS, log, SUCCESS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbuildArrayDesignOptions(org.apache.commons.cli.Options options) protected final voidbuildOptions(org.apache.commons.cli.Options options) Build option implementation.protected final voidObtain the command group for this CLI.protected StringgetMarkOnlyReason(org.apache.commons.cli.CommandLine commandLine, String... optionsThatDoWork) Read the reason given for-markOnly, or return null if it was not used.protected Collection<ArrayDesign> getRelatedDesigns(ArrayDesign design) Mergees or subsumees of the platform.protected booleanisSubsumedOrMerged(ArrayDesign arrayDesign) protected booleanneedToRun(Date skipIfLastRunLaterThan, ArrayDesign arrayDesign, Class<? extends ArrayDesignAnalysisEvent> eventClass) protected voidprocessArrayDesign(ArrayDesign arrayDesign) protected voidprocessArrayDesignOptions(org.apache.commons.cli.CommandLine commandLine) protected voidprocessArrayDesigns(Collection<ArrayDesign> arrayDesigns) protected final voidprocessOptions(org.apache.commons.cli.CommandLine commandLine) Process command line options.protected booleanWhether the options of this CLI select platforms by some means other than-a,-for-all.protected voidRefuse-all, so this CLI can never be pointed at every platform in the system.protected booleanshouldRun(Date skipIfLastRunLaterThan, ArrayDesign design, Class<? extends ArrayDesignAnalysisEvent> cls) protected SerializabletoBatchObject(ArrayDesign object) Convert the given object to a serializable object for batch processing.Methods inherited from class AbstractAutoSeekingCLI
addAutoOption, addAutoOption, addErrorObject, addErrorObject, addErrorObject, addForceOption, addForceOption, addLimitingDateOption, addSuccessObject, addSuccessObject, addWarningObject, addWarningObject, getAutoSeekEventType, getLimitingDate, isAutoSeek, isForce, noNeedToRun, setForceMethods inherited from class AbstractAuthenticatedCLI
afterPropertiesSet, doWork, setAuthenticateAnonymously, setEnvironment, setRequireLoginMethods inherited from class AbstractCLI
abort, addBatchOption, addErrorObject, addErrorObject, addErrorObject, addSuccessObject, addSuccessObject, addThreadsOption, addWarningObject, addWarningObject, allowPositionalArguments, awaitBatchExecutorService, checkStandardOutput, executeCommand, getApplicationContext, getBatchTaskExecutor, getBatchTaskProgressReporter, getCliContext, getCommandAliases, getCommandName, getHelpFooter, getNumThreads, getOptions, getPipelineJobReporter, getShortDesc, getUsage, openStandardOutput, promptConfirmationOrAbort, setAllowPositionalArguments, setApplicationContext, setEstimatedMaxTasks, setReportFrequencyMillis
-
Field Details
-
MARK_ONLY_OPTION
- See Also:
-
arrayDesignReportService
-
arrayDesignService
-
auditTrailService
-
auditEventService
-
entityLocator
-
-
Constructor Details
-
ArrayDesignSequenceManipulatingCli
protected ArrayDesignSequenceManipulatingCli()
-
-
Method Details
-
setExplicitADsOnly
protected void setExplicitADsOnly()Refuse-all, so this CLI can never be pointed at every platform in the system.Intended for destructive CLIs (
detachSequences,deletePlatformElements) where-allwiping every platform's sequences or elements is a mistake with no undo. -
getCommandGroup
Description copied from interface:CLIObtain the command group for this CLI.- Specified by:
getCommandGroupin interfaceCLI- Overrides:
getCommandGroupin classAbstractCLI
-
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
-
buildArrayDesignOptions
protected void buildArrayDesignOptions(org.apache.commons.cli.Options options) -
processOptions
@OverridingMethodsMustInvokeSuper 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<ArrayDesign>- 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.
-
processArrayDesignOptions
protected void processArrayDesignOptions(org.apache.commons.cli.CommandLine commandLine) throws org.apache.commons.cli.ParseException - Throws:
org.apache.commons.cli.ParseException
-
getMarkOnlyReason
@Nullable protected String getMarkOnlyReason(org.apache.commons.cli.CommandLine commandLine, String... optionsThatDoWork) throws org.apache.commons.cli.ParseException Read the reason given for-markOnly, or return null if it was not used.A platform's BLAT results and gene mappings are held per sequence, so running one platform does the work for every platform that shares its sequences — but the audit event propagates only down the merge tree, leaving those platforms with fresh data and an audit trail that says they were never processed.
-markOnlywrites the event and nothing else.The event is a claim that the work was done, so the platforms have to be ones the operator named:
-all,-autoand-mdateeach select a set nobody enumerated.- Parameters:
optionsThatDoWork- options of the calling CLI that make it do work, which-markOnlycontradicts- Throws:
org.apache.commons.cli.ParseException
-
doAuthenticatedWork
- Specified by:
doAuthenticatedWorkin classAbstractAuthenticatedCLI- Throws:
Exception
-
selectsOwnPlatforms
protected boolean selectsOwnPlatforms()Whether the options of this CLI select platforms by some means other than-a,-for-all.If so, an empty selection from those options is not an error:
processArrayDesigns(Collection)is invoked with an empty collection and is responsible for finding its own platforms. -
processArrayDesigns
-
processArrayDesign
-
toBatchObject
Description copied from class:AbstractAutoSeekingCLIConvert the given object to a serializable object for batch processing.- Specified by:
toBatchObjectin classAbstractAutoSeekingCLI<ArrayDesign>
-
isSubsumedOrMerged
- Parameters:
arrayDesign- the array design to check- Returns:
- true if the sequences on the given array design would be equivalently treated by analyzing another array design. In the case of subsumption, this only works if the array design has been either analyzed for subsuming status. (the analysis is not done as part of this call).
-
shouldRun
protected boolean shouldRun(Date skipIfLastRunLaterThan, ArrayDesign design, Class<? extends ArrayDesignAnalysisEvent> cls) -
getRelatedDesigns
Mergees or subsumees of the platform.- Parameters:
design- a platform- Returns:
- related platforms
-
needToRun
protected boolean needToRun(@Nullable Date skipIfLastRunLaterThan, ArrayDesign arrayDesign, Class<? extends ArrayDesignAnalysisEvent> eventClass) - Parameters:
eventClass- e.g., ArrayDesignSequenceAnalysisEvent.class- Returns:
- true if skipIfLastRunLaterThan is null, or there is no record of a previous analysis, or if the last analysis was run before skipIfLastRunLaterThan. false otherwise.
-