org.fhcrc.cpl.toolbox.commandline
Interface CommandLineModule

All Known Implementing Classes:
AlignCLM, AmtDatabaseCreatorCommandLineModule, AmtDatabaseDiagnosticCommandLineModule, AmtDatabaseFeatureSetCreatorCLM, AmtDatabaseManagerCommandLineModule, AmtDatabaseMatcherCLM, AmtLabeledQuantCLM, BaseCommandLineModuleImpl, BaseViewerCommandLineModuleImpl, CalculateFDRCLM, CalibrateFeatureMassesCLM, CalibrateMzxmlMassesCLM, CombineAmtMs2FilesCLM, CombinePepXmlFilesCLM, CompareFastasCLM, ConsensusFeatureFileCLM, ConvertFeatureFileCommandLineModule, CorrectPrecursorMzCLM, CreateIndexCommandLineModule, DeconvoluteCommandLineModule, DemoCommandModule, DetectAdductsCLM, DumpWindow2DCommandLineModule, ExtractRunsFromPepXmlCommandLineModule, FeatureSelectionParamsCommandLineModule, FeatureSetMatcherCommandLineModule, FilterFeaturesCommandLineModule, FilterPeptideRegexpCLM, FilterPepXmlCLM, FilterReverseDBHitsCLM, FindIndistinguishableProteinsCLM, FindPeptidesCommandLineModule, FindSearchScoreCutoffForFARCLM, FlagQuantEventsCLM, FlipPepXMLRatiosCLM, GuessProteinsFromFastaCLM, HydrophobicityAlgorithmAnalyzerCLM, IcatCommandLineModule, MassAccuracyCommandLineModule, MRMCommandLineModule, MS2ScanViewerCLM, PeptideArrayAnalyzerCommandLineModule, PeptideArrayCommandLineModule, PeptideCompareCommandLineModule, PeptidePeakModellerCLM, PeptideQuantVisualizationCLM, PeptideRatioVariationCLM, PickTargetedMS2CandidatesCLM, PlotDeltaMassesCLM, PlotFeatureAttributesCLM, PlotMassCalibrationCLM, PlotMs1Ms2ScanCountsCLM, PopulateMS2TimesCLM, PostProcessPepXMLCLM, ProteinFractionsSpreadsheetCLM, ProteinQuantChartsCLM, ProteinRollupCommandLineModule, ProtXmlCompareCLM, Q3CommandLineModule, QAExperimentCLM, QAProtXMLCLM, QuantCommandLineModule, ReverseFastaCLM, ReviewQuantitationCLM, RunCommandFileCommandLineModule, SaveImageCommandLineModule, SaveMzxmlWindowCommandLineModule, SpectralCountCLM, SpreadsheetMergeCLM, SummarizeProtXmlCLM, UserManualCLM, ViewSpectrumChartCLM

public interface CommandLineModule

All command line modules must implement this interface in order to extend msInspect commandline functionality. The flow is as follows: -Application finds all CommandLineModule-implementing classes within a specified list of packages -For each such class, it calls getCommandName() to determine the command that should be used to invoke the module. It creates an instance of the module using the no-arg constructor -If the user enters this command, getArgumentDefinitions() is called to find out what arguments are allowed -The user's arguments are parsed. If they all pass basic validation, assignArgumentValues() is called -If assignArgumentValues() succeeds, execute() is called Although it is not required, we recommend that CommandLineModule classes extend BaseCommandLineModuleImpl, which provides some convenience method implementations.


Field Summary
static java.lang.String MODULE_HELP_AUTOMATIC
           
static java.lang.String MODULE_USAGE_AUTOMATIC
           
static java.lang.String UNNAMED_ARG_SERIES_SEPARATOR
           
 
Method Summary
 void assignArgumentValues()
          the first step in invoking your module.
 void digestArguments(java.util.Map<java.lang.String,java.lang.String> argumentValueMap)
           
 void execute()
          Called by msInspect after assignArgumentValues.
 CommandLineArgumentDefinition[] getAdvancedArgumentDefinitions()
           
 CommandLineArgumentDefinition getArgumentDefinition(java.lang.String argumentName)
           
 CommandLineArgumentDefinition[] getArgumentDefinitions()
           
 CommandLineArgumentDefinition[] getArgumentDefinitionsSortedForDisplay()
           
 java.util.Map<java.lang.String,java.lang.String> getArgumentValueStrings()
          Return the original argument name-value pairs that were passed into this module via digestArguments()
 CommandLineArgumentDefinition[] getBasicArgumentDefinitions()
           
 java.lang.String getCommandName()
           
 java.lang.String getFullHelp()
          Returns the full help message to be displayed by --help
 java.lang.String getHelpMessage()
          a String giving the user detailed help on invoking this command
 java.lang.String getHtmlHelpFragment()
          Returns an HTML fragment containing full help information for this module
 java.lang.String getShortDescription()
           
 java.lang.String getUsage()
           
 void invoke(java.util.Map<java.lang.String,java.lang.String> argumentValues)
          Invoke the CommandLineModule, using the argument values specified in the argumentValues array.
 

Field Detail

MODULE_USAGE_AUTOMATIC

static final java.lang.String MODULE_USAGE_AUTOMATIC
See Also:
Constant Field Values

MODULE_HELP_AUTOMATIC

static final java.lang.String MODULE_HELP_AUTOMATIC
See Also:
Constant Field Values

UNNAMED_ARG_SERIES_SEPARATOR

static final java.lang.String UNNAMED_ARG_SERIES_SEPARATOR
See Also:
Constant Field Values
Method Detail

getUsage

java.lang.String getUsage()
Returns:
a String telling the user how to invoke this command

getHelpMessage

java.lang.String getHelpMessage()
a String giving the user detailed help on invoking this command

Returns:

getFullHelp

java.lang.String getFullHelp()
Returns the full help message to be displayed by --help

Returns:

getHtmlHelpFragment

java.lang.String getHtmlHelpFragment()
Returns an HTML fragment containing full help information for this module

Returns:

getCommandName

java.lang.String getCommandName()
Returns:
a String that is the command that a user should type in order to invoke this CommandLineModule. This String should not collide with the Command Name of another module

getShortDescription

java.lang.String getShortDescription()
Returns:
a short (one-line, preferably) description of this functionality

getArgumentDefinitions

CommandLineArgumentDefinition[] getArgumentDefinitions()
Returns:
an array of CommandLineArgumentDefinitions. This array tells msInspect which required and optional parameters are used by your module. No particular order

getBasicArgumentDefinitions

CommandLineArgumentDefinition[] getBasicArgumentDefinitions()
Returns:
an array of CommandLineArgumentDefinitions. This array tells msInspect which BASIC required and optional parameters are used by your module. No particular order

getAdvancedArgumentDefinitions

CommandLineArgumentDefinition[] getAdvancedArgumentDefinitions()
Returns:
an array of CommandLineArgumentDefinitions. This array tells msInspect which ADVANCED required and optional parameters are used by your module. No particular order

getArgumentDefinitionsSortedForDisplay

CommandLineArgumentDefinition[] getArgumentDefinitionsSortedForDisplay()
Returns:
@return an array of CommandLineArgumentDefinitions, sorted however this module wants them to be sorted for display purposes. May be more computation-intensive than getArgumentDefinitions().

getArgumentDefinition

CommandLineArgumentDefinition getArgumentDefinition(java.lang.String argumentName)
Returns:
a CommandLineArgumentDefinition matching the specified name (case-insensitive). Null if not found

digestArguments

void digestArguments(java.util.Map<java.lang.String,java.lang.String> argumentValueMap)
                     throws ArgumentValidationException
Parameters:
argumentValueMap -
Throws:
ArgumentValidationException

getArgumentValueStrings

java.util.Map<java.lang.String,java.lang.String> getArgumentValueStrings()
Return the original argument name-value pairs that were passed into this module via digestArguments()

Returns:

assignArgumentValues

void assignArgumentValues()
                          throws ArgumentValidationException
the first step in invoking your module. The values assigned to the various arguments by the user are passed to your module for storage and additional validation. Any communication with the user about their argument values should be done by this method.

Throws:
ArgumentValidationException

execute

void execute()
             throws CommandLineModuleExecutionException
Called by msInspect after assignArgumentValues. Executes your functionality. Any communication with the user about execution status should be done by this method.

Throws:
CommandLineModuleExecutionException

invoke

void invoke(java.util.Map<java.lang.String,java.lang.String> argumentValues)
            throws ArgumentValidationException,
                   CommandLineModuleExecutionException
Invoke the CommandLineModule, using the argument values specified in the argumentValues array. Essentially this should just call digestArguments() and then execute()

Parameters:
argumentValues -
Throws:
ArgumentValidationException
CommandLineModuleExecutionException


Fred Hutchinson Cancer Research Center