Base class for TOPP applications. More...
#include <OpenMS/APPLICATIONS/TOPPBase.h>
Public Member Functions | |
TOPPBase (const String &name, const String &description, bool official=true, bool id_tag_support=false, bool require_args=true, const String &version="") | |
Constructor. More... | |
virtual | ~TOPPBase () |
Destructor. More... | |
ExitCodes | main (int argc, const char **argv) |
Main routine of all TOPP applications. More... | |
Static Public Member Functions | |
static void | setMaxNumberOfThreads (int num_threads) |
Sets the maximal number of usable threads. More... | |
Protected Member Functions | |
const String & | getIniLocation_ () const |
Returns the location of the ini file where parameters are taken from. E.g. if the command line was TOPPTool -instance 17 , then this will be "TOPPTool:17:" . Note the ':' at the end. More... | |
const String & | toolName_ () const |
Returns the tool name. More... | |
void | printUsage_ () |
Prints the tool-specific command line options and appends the common options. More... | |
virtual ExitCodes | main_ (int argc, const char **argv)=0 |
The actual "main" method. main_() is invoked by main(). More... | |
bool | parseRange_ (const String &text, double &low, double &high) const |
Parses a range string ([a]:[b]) into two variables (doubles) More... | |
bool | parseRange_ (const String &text, Int &low, Int &high) const |
Parses a range string ([a]:[b]) into two variables (integers) More... | |
const DocumentIDTagger & | getDocumentIDTagger_ () const |
get DocumentIDTagger to assign DocumentIDs to maps More... | |
bool | writeCTD_ () |
Write common tool description (CTD) file. More... | |
ExitCodes | writeWSDL_ (const String &filename) |
Write WSDL file and validate it. Returns EXECUTION_OK or INTERNAL_ERROR (if validation failed) More... | |
Parameter handling | |
Use the methods registerStringOption_, registerInputFile_, registerOutputFile_, registerDoubleOption_, registerIntOption_ and registerFlag_ in order to register parameters in registerOptionsAndFlags_. To access the values of registered parameters in the main_ method use methods getStringOption_ (also for input and output files), getDoubleOption_, getIntOption_,getStringList_(also for input and output file lists),getIntList_,getDoubleList_, and getFlag_. The values of certain options can be restricted using: setMinInt_, setMaxInt_, setMinFloat_, setMaxFloat_, setValidStrings_ and setValidFormats_. In order to format the help output, the method addEmptyLine_ can be used. | |
virtual void | registerOptionsAndFlags_ ()=0 |
Sets the valid command line options (with argument) and flags (without argument). More... | |
String | getParamArgument_ (const Param::ParamEntry &entry) const |
Utility function that determines a suitable argument value for the given Param::ParamEntry. More... | |
std::vector< ParameterInformation > | paramToParameterInformation_ (const Param ¶m) const |
Translates the given parameter object into a vector of ParameterInformation, that can be utilized for cl parsing. More... | |
ParameterInformation | paramEntryToParameterInformation_ (const Param::ParamEntry &entry, const String &argument="", const String &full_name="") const |
Transforms a ParamEntry object to command line parameter (ParameterInformation). More... | |
void | registerParamSubsectionsAsTOPPSubsections_ (const Param ¶m) |
void | registerFullParam_ (const Param ¶m) |
Register command line parameters for all entries in a Param object. More... | |
void | registerStringOption_ (const String &name, const String &argument, const String &default_value, const String &description, bool required=true, bool advanced=false) |
Registers a string option. More... | |
void | setValidStrings_ (const String &name, const std::vector< String > &strings) |
Sets the valid strings for a string option or a whole string list. More... | |
void | setValidStrings_ (const String &name, const std::string vstrings[], int count) |
Sets the valid strings for a string option or a whole string list. More... | |
void | registerInputFile_ (const String &name, const String &argument, const String &default_value, const String &description, bool required=true, bool advanced=false, const StringList &tags=StringList()) |
Registers an input file option. More... | |
void | registerOutputFile_ (const String &name, const String &argument, const String &default_value, const String &description, bool required=true, bool advanced=false) |
Registers an output file option. More... | |
void | setValidFormats_ (const String &name, const std::vector< String > &formats, const bool force_OpenMS_format=true) |
Sets the formats for a input/output file option or for all members of an input/output file lists. More... | |
void | registerDoubleOption_ (const String &name, const String &argument, double default_value, const String &description, bool required=true, bool advanced=false) |
Registers a double option. More... | |
void | setMinInt_ (const String &name, Int min) |
Sets the minimum value for the integer parameter(can be a list of integers,too) name . More... | |
void | setMaxInt_ (const String &name, Int max) |
Sets the maximum value for the integer parameter(can be a list of integers,too) name . More... | |
void | setMinFloat_ (const String &name, double min) |
Sets the minimum value for the floating point parameter(can be a list of floating points,too) name . More... | |
void | setMaxFloat_ (const String &name, double max) |
Sets the maximum value for the floating point parameter(can be a list of floating points,too) name . More... | |
void | registerIntOption_ (const String &name, const String &argument, Int default_value, const String &description, bool required=true, bool advanced=false) |
Registers an integer option. More... | |
void | registerIntList_ (const String &name, const String &argument, IntList default_value, const String &description, bool required=true, bool advanced=false) |
Registers a list of integers option. More... | |
void | registerDoubleList_ (const String &name, const String &argument, DoubleList default_value, const String &description, bool required=true, bool advanced=false) |
Registers a list of doubles option. More... | |
void | registerStringList_ (const String &name, const String &argument, StringList default_value, const String &description, bool required=true, bool advanced=false) |
Registers a list of strings option. More... | |
void | registerInputFileList_ (const String &name, const String &argument, StringList default_value, const String &description, bool required=true, bool advanced=false, const StringList &tags=StringList()) |
Registers a list of input files option. More... | |
void | registerOutputFileList_ (const String &name, const String &argument, StringList default_value, const String &description, bool required=true, bool advanced=false) |
Registers a list of output files option. More... | |
void | registerFlag_ (const String &name, const String &description, bool advanced=false) |
Registers a flag. More... | |
void | registerSubsection_ (const String &name, const String &description) |
Registers an allowed subsection in the INI file (usually from OpenMS algorithms). More... | |
void | registerTOPPSubsection_ (const String &name, const String &description) |
Registers an allowed subsection in the INI file originating from the TOPP tool itself. More... | |
void | addEmptyLine_ () |
Adds an empty line between registered variables in the documentation. More... | |
String | getStringOption_ (const String &name) const |
Returns the value of a previously registered string option. More... | |
double | getDoubleOption_ (const String &name) const |
Returns the value of a previously registered double option. More... | |
Int | getIntOption_ (const String &name) const |
Returns the value of a previously registered integer option. More... | |
StringList | getStringList_ (const String &name) const |
Returns the value of a previously registered StringList. More... | |
IntList | getIntList_ (const String &name) const |
Returns the value of a previously registered IntList. More... | |
DoubleList | getDoubleList_ (const String &name) const |
Returns the value of a previously registered DoubleList. More... | |
bool | getFlag_ (const String &name) const |
Returns the value of a previously registered flag. More... | |
const ParameterInformation & | findEntry_ (const String &name) const |
Finds the entry in the parameters_ array that has the name name . More... | |
Param const & | getParam_ () const |
Return all parameters relevant to this TOPP tool. More... | |
void | checkParam_ (const Param ¶m, const String &filename, const String &location) const |
Checks top-level entries of param according to the information during registration. More... | |
void | checkIfIniParametersAreApplicable_ (const Param &ini_params) |
Checks if the parameters of the provided ini file are applicable to this tool. More... | |
Debug and Log output | |
void | writeLog_ (const String &text) const |
Writes a string to the log file and to std::cout. More... | |
void | writeDebug_ (const String &text, UInt min_level) const |
Writes a text to the log file and to std::cout if the debug level is at least min_level . More... | |
void | writeDebug_ (const String &text, const Param ¶m, UInt min_level) const |
Writes a String followed by a Param to the log file and to std::cout if the debug level is at least min_level . More... | |
Temporary directories | |
String | makeTempDirectory_ () const |
Creates a unique temporary directory and returns its name. More... | |
void | removeTempDirectory_ (const String &dirname, Int keep_debug=2) const |
Removes a (temporary) directory. More... | |
File IO checking methods | |
Methods used to check the validity of input and output files in main_. Checking input and output files is only necessary, if you did register the file as string option, e.g. when only a file prefix is given which is completed in the program. The exceptions thrown in these methods are caught in the main method of this class. They do not have to be handled in the tool itself! | |
void | inputFileReadable_ (const String &filename, const String ¶m_name) const |
Checks if an input file exists, is readable and is not empty. More... | |
void | outputFileWritable_ (const String &filename, const String ¶m_name) const |
Checks if an output file is writable. More... | |
Data processing auxiliary functions | |
void | addDataProcessing_ (ConsensusMap &map, const DataProcessing &dp) const |
Data processing setter for consensus maps. More... | |
void | addDataProcessing_ (FeatureMap &map, const DataProcessing &dp) const |
Data processing setter for feature maps. More... | |
void | addDataProcessing_ (PeakMap &map, const DataProcessing &dp) const |
Data processing setter for peak maps. More... | |
DataProcessing | getProcessingInfo_ (DataProcessing::ProcessingAction action) const |
Returns the data processing information. More... | |
DataProcessing | getProcessingInfo_ (const std::set< DataProcessing::ProcessingAction > &actions) const |
Returns the data processing information. More... | |
Protected Attributes | |
String | version_ |
Version string (if empty, the OpenMS/TOPP version is printed) More... | |
String | verboseVersion_ |
Version string including additional revision/date time information. Note: This differs from version_ only if not provided by the user. More... | |
bool | official_ |
Flag indicating if this an official TOPP tool. More... | |
ProgressLogger::LogType | log_type_ |
Type of progress logging. More... | |
bool | test_mode_ |
Test mode. More... | |
Int | debug_level_ |
Debug level set by -debug. More... | |
Static Protected Attributes | |
static String | topp_ini_file_ |
.TOPP.ini file for storing system default parameters More... | |
Private Member Functions | |
TOPPBase () | |
No default constructor. It is "declared away". More... | |
TOPPBase (const TOPPBase &) | |
No default copy constructor. It is "declared away". More... | |
void | enableLogging_ () const |
Ensures that at least some default logging destination is opened for writing in append mode. More... | |
virtual Param | getSubsectionDefaults_ (const String §ion) const |
This method should return the default parameters for subsections. More... | |
Param | getSubsectionDefaults_ () const |
Returns a single Param object containing all subsection parameters. More... | |
Param | parseCommandLine_ (const int argc, const char **argv, const String &misc="misc", const String &unknown="unknown") |
Parses command line arguments using parameter definitions from TOPPBase. More... | |
void | addText_ (const String &text) |
ParameterInformation & | getParameterByName_ (const String &name) |
Returns the parameter identified by the given name. More... | |
Internal parameter handling | |
String | getParamAsString_ (const String &key, const String &default_value="") const |
Return the value of parameter key as a string or default_value if this value is not set. More... | |
Int | getParamAsInt_ (const String &key, Int default_value=0) const |
Return the value of parameter key as an integer or default_value if this value is not set. More... | |
double | getParamAsDouble_ (const String &key, double default_value=0) const |
Return the value of parameter key as a double or default_value if this value is not set. More... | |
StringList | getParamAsStringList_ (const String &key, const StringList &default_value) const |
Return the value of parameter key as a StringList or default_value if this value is not set. More... | |
IntList | getParamAsIntList_ (const String &key, const IntList &default_value) const |
Return the value of parameter key as a IntList or default_value if this value is not set. More... | |
DoubleList | getParamAsDoubleList_ (const String &key, const DoubleList &default_value) const |
Return the value of parameter key as a DoubleList or default_value if this value is not set. More... | |
bool | getParamAsBool_ (const String &key) const |
Return the value of flag parameter key as bool. More... | |
const DataValue & | getParam_ (const String &key) const |
Return the value key of parameters as DataValue. DataValue::EMPTY indicates that a parameter was not found. More... | |
String | getSubsection_ (const String &name) const |
Get the part of a parameter name that makes up the subsection. More... | |
Param | getDefaultParameters_ () const |
Returns the default parameters. More... | |
Param | getToolUserDefaults_ (const String &tool_name) const |
Returns the user defaults for the given tool, if any default parameters are stored in the users home. More... | |
Private Attributes | |
String const | tool_name_ |
Tool name. This is assigned once and for all in the constructor. More... | |
String const | tool_description_ |
Tool description. This is assigned once and for all in the constructor. More... | |
bool | id_tag_support_ |
Tool indicates it supports assignment of unique DocumentID from IDPool. More... | |
bool | require_args_ |
Require at least one command line argument, exit immediately otherwise. GUI tools should disable this to be callable by double clicking. More... | |
DocumentIDTagger | id_tagger_ |
Instance of DocumentIDTagger, which can be accessed using getDocumentIDTagger_() More... | |
Int const | instance_number_ |
Instance number. More... | |
String const | ini_location_ |
Location in the ini file where to look for parameters. More... | |
Param | param_ |
All parameters relevant to this invocation of the program. More... | |
Param | param_inifile_ |
All parameters specified in the ini file. More... | |
Param | param_cmdline_ |
Parameters from command line. More... | |
Param | param_instance_ |
Parameters from instance section. More... | |
Param | param_common_tool_ |
Parameters from common section with tool name. More... | |
Param | param_common_ |
Parameters from common section without tool name. More... | |
std::ofstream | log_ |
Log file stream. Use the writeLog_() and writeDebug_() methods to access it. More... | |
std::vector< ParameterInformation > | parameters_ |
Storage location for parameter information. More... | |
std::map< String, String > | subsections_ |
Storage location and description for allowed subsections. More... | |
std::map< String, String > | subsections_TOPP_ |
Storage location and description for allowed subsections from TOPP tool's command-line parameters. More... | |
Base class for TOPP applications.
This base class implements functionality used in most TOPP tools:
If you want to create a new TOPP tool, please take care of the following:
enum ExitCodes |
TOPPBase | ( | const String & | name, |
const String & | description, | ||
bool | official = true , |
||
bool | id_tag_support = false , |
||
bool | require_args = true , |
||
const String & | version = "" |
||
) |
Constructor.
name | Tool name. |
description | Short description of the tool (one line). |
official | If this is an official TOPP tool contained in the OpenMS/TOPP release. If true the tool name is checked against the list of TOPP tools and a warning printed if missing. |
id_tag_support | Does the TOPP tool support unique DocumentIdentifier assignment?! The default is false. In the default case you cannot use the -id_pool argument when calling the TOPP tool (it will terminate during init) |
version | Optional version of the tools (if empty, the version of OpenMS/TOPP is used). |
require_args | Require arguments on the command line (GUI tools should disable this) |
|
virtual |
Destructor.
|
private |
No default constructor. It is "declared away".
|
protected |
Data processing setter for consensus maps.
|
protected |
Data processing setter for feature maps.
|
inlineprotected |
Data processing setter for peak maps.
References MSExperiment::getChromatogram(), ChromatogramSettings::getDataProcessing(), MSExperiment::getNrChromatograms(), and MSExperiment::size().
|
protected |
Adds an empty line between registered variables in the documentation.
|
private |
Adds a left aligned text between registered variables in the documentation e.g. for subdividing the documentation. This should not be usable for derived classes, since this formatting is not carried over to INI files and thus INI files might lack important information. Instead, subdivision of parameters should be achieved using TOPPSubsections with appropriate description Currently only used for "Common TOPP options" within TOPPBase.cpp
|
protected |
Checks if the parameters of the provided ini file are applicable to this tool.
This method does not abort execution of the tool, but will warn the user through stderr! It is called automatically whenever a ini file is loaded.
|
protected |
Checks top-level entries of param
according to the information during registration.
Only top-level entries and allowed subsections are checked. Checking the content of the subsection is the duty of the algorithm it is passed to.
This method does not abort execution of the tool, but will warn the user through stderr! It is called automatically in the main method.
param | Parameters to check |
filename | The source file name |
location | Exact location inside the source file |
|
private |
Ensures that at least some default logging destination is opened for writing in append mode.
|
protected |
Finds the entry in the parameters_ array that has the name name
.
Exception::UnregisteredParameter | is thrown if the parameter was not registered |
|
private |
Returns the default parameters.
|
protected |
get DocumentIDTagger to assign DocumentIDs to maps
|
protected |
Returns the value of a previously registered DoubleList.
Exception::UnregisteredParameter | is thrown if the parameter was not registered |
Exception::RequiredParameterNotGiven | is if a required parameter is not present |
Exception::WrongParameterType | is thrown if the parameter has the wrong type |
Exception::InvalidParameter | is thrown if the parameter restrictions are not met |
Returns the value of a previously registered double option.
Exception::UnregisteredParameter | is thrown if the parameter was not registered |
Exception::RequiredParameterNotGiven | is if a required parameter is not present |
Exception::WrongParameterType | is thrown if the parameter has the wrong type |
Exception::InvalidParameter | is thrown if the parameter restrictions are not met |
|
protected |
Returns the value of a previously registered flag.
|
inlineprotected |
Returns the location of the ini file where parameters are taken from. E.g. if the command line was TOPPTool -instance 17
, then this will be "TOPPTool:17:"
. Note the ':' at the end.
This is assigned during tool startup, depending on the command line but (of course) not depending on ini files.
Returns the value of a previously registered IntList.
Exception::UnregisteredParameter | is thrown if the parameter was not registered |
Exception::RequiredParameterNotGiven | is if a required parameter is not present |
Exception::WrongParameterType | is thrown if the parameter has the wrong type |
Exception::InvalidParameter | is thrown if the parameter restrictions are not met |
Returns the value of a previously registered integer option.
Exception::UnregisteredParameter | is thrown if the parameter was not registered |
Exception::RequiredParameterNotGiven | is if a required parameter is not present |
Exception::WrongParameterType | is thrown if the parameter has the wrong type |
Exception::InvalidParameter | is thrown if the parameter restrictions are not met |
Return the value key
of parameters as DataValue. DataValue::EMPTY indicates that a parameter was not found.
Parameters are searched in this order:
where "some_key" == key in the examples.
|
protected |
Return all parameters relevant to this TOPP tool.
Returns a Param that contains everything you can get by the getParamAs...() methods.
|
protected |
Utility function that determines a suitable argument value for the given Param::ParamEntry.
|
private |
Return the value of flag parameter key
as bool.
Only the string values 'true' and 'false' are interpreted.
Exception::InvalidParameter | is thrown for non-string parameters and string parameters with values other than 'true' and 'false'. |
Return the value of parameter key
as a double or default_value
if this value is not set.
|
private |
Return the value of parameter key
as a DoubleList or default_value
if this value is not set.
Return the value of parameter key
as an integer or default_value
if this value is not set.
Return the value of parameter key
as a IntList or default_value
if this value is not set.
Return the value of parameter key
as a string or default_value
if this value is not set.
|
private |
Return the value of parameter key
as a StringList or default_value
if this value is not set.
|
private |
Returns the parameter identified by the given name.
name | The name of the parameter to search. |
Exception::UnregisteredParameter | is thrown if the parameter was not registered |
|
protected |
Returns the data processing information.
|
protected |
Returns the data processing information.
|
protected |
Returns the value of a previously registered StringList.
Exception::UnregisteredParameter | is thrown if the parameter was not registered |
Exception::RequiredParameterNotGiven | is if a required parameter is not present |
Exception::WrongParameterType | is thrown if the parameter has the wrong type |
Exception::InvalidParameter | is thrown if the parameter restrictions are not met |
Returns the value of a previously registered string option.
Exception::UnregisteredParameter | is thrown if the parameter was not registered |
Exception::RequiredParameterNotGiven | is if a required parameter is not present |
Exception::WrongParameterType | is thrown if the parameter has the wrong type |
Exception::InvalidParameter | is thrown if the parameter restrictions are not met |
Get the part of a parameter name that makes up the subsection.
The subsection extends until the last colon (":"). If there is no subsection, the empty string is returned.
This method should return the default parameters for subsections.
It is called once for each registered subsection, when writing the example ini file.
Reimplement this method to set the defaults written in the 'write_ini' method.
|
private |
Returns the user defaults for the given tool, if any default parameters are stored in the users home.
Checks if an input file exists, is readable and is not empty.
The filename is a URI to the file to be read and param_name gives the name of the parameter , e.g. "in" which specified the filename (this is useful for error messages when the file cannot be read, so the user can immediately see which parameter to change). If no parameter is responsible for the name of the input file, then leave param_name empty.
Exception::FileNotFound | is thrown if the file is not found |
Exception::FileNotReadable | is thrown if the file is not readable |
Exception::FileEmpty | is thrown if the file is empty |
ExitCodes main | ( | int | argc, |
const char ** | argv | ||
) |
Main routine of all TOPP applications.
Referenced by main().
|
protectedpure virtual |
The actual "main" method. main_() is invoked by main().
Implemented in TOPPMetaProSIP, RNPxlSearch, TOPPOpenPepXL, SimpleSearchEngine, TOPPOpenPepXLLF, and TOPPRNPxl.
|
protected |
Creates a unique temporary directory and returns its name.
Checks if an output file is writable.
The filename is a URI to the file to be written and param_name gives the name of the parameter , e.g. "out" which specified the filename (this is useful for error messages when the file cannot be written, so the user can immediately see which parameter to change). If no parameter is responsible for the name of the output file, then leave param_name empty.
Exception::UnableToCreateFile | is thrown if the file cannot be created |
|
protected |
Transforms a ParamEntry object to command line parameter (ParameterInformation).
A ParamEntry of type String is turned into a flag if its default value is "false" and its valid strings are "true" and "false".
entry | The ParamEntry that defines name, default value, description, restrictions, and required-/advancedness (via tags) of the parameter. |
argument | Argument description text for the help output. |
full_name | Full name of the parameter, if different from the name in the ParamEntry (ParamEntry names cannot contain sections) |
|
protected |
Translates the given parameter object into a vector of ParameterInformation, that can be utilized for cl parsing.
|
private |
Parses command line arguments using parameter definitions from TOPPBase.
Parses command line arguments according to the current parameter definitions and returns the result as a Param object.
argc | argc variable from command line |
argv | argv variable from command line |
misc | Key to store a StringList of all non-option arguments |
unknown | Key to store a StringList of all unknown options |
Parses a range string ([a]:[b]) into two variables (doubles)
The variables are only overwritten if a value is set for the respective boundary.
Parses a range string ([a]:[b]) into two variables (integers)
The variables are only overwritten if a value is set for the respective boundary.
|
protected |
Prints the tool-specific command line options and appends the common options.
|
protected |
Registers a list of doubles option.
name | Name of the option in the command line and the INI file |
argument | Argument description text for the help output |
default_value | Default argument |
description | Description of the parameter. Indentation of newline is done automatically. |
required | If the user has to provide a value i.e. if the value has to differ from the default (checked in get-method) |
advanced | If true, this parameter is advanced and by default hidden in the GUI. |
|
protected |
Registers a double option.
name | Name of the option in the command line and the INI file |
argument | Argument description text for the help output |
default_value | Default argument |
description | Description of the parameter. Indentation of newline is done automatically. |
required | If the user has to provide a value i.e. if the value has to differ from the default (checked in get-method) |
advanced | If true, this parameter is advanced and by default hidden in the GUI. |
|
protected |
Registers a flag.
|
protected |
Register command line parameters for all entries in a Param object.
|
protected |
Registers an input file option.
Input files behave like string options, but are automatically checked with inputFileReadable_() when the option is accessed in the TOPP tool.
name | Name of the option in the command line and the INI file |
argument | Argument description text for the help output |
default_value | Default argument |
description | Description of the parameter. Indentation of newline is done automatically. |
required | If the user has to provide a value i.e. if the value has to differ from the default (checked in get-method) |
advanced | If true, this parameter is advanced and by default hidden in the GUI. |
tags | A list of tags, e.g. 'skipexists', specifying the handling of the input file (e.g. when its an executable) Valid tags: 'skipexists' - will prevent checking if the given file really exists (useful for an executable in global PATH) |
|
protected |
Registers a list of input files option.
A list of input files behaves like a StringList, but are automatically checked with inputFileWritable_() when the option is accessed in the TOPP tool.
name | Name of the option in the command line and the INI file |
argument | Argument description text for the help output |
default_value | Default argument |
description | Description of the parameter. Indentation of newline is done automatically. |
required | If the user has to provide a value i.e. if the value has to differ from the default (checked in get-method) |
advanced | If true, this parameter is advanced and by default hidden in the GUI. |
tags | A list of tags, e.g. 'skipexists', specifying the handling of the input file (e.g. when its an executable) Valid tags: 'skipexists' - will prevent checking if the given file really exists (useful for an executable in global PATH) |
|
protected |
Registers a list of integers option.
name | Name of the option in the command line and the INI file |
argument | Argument description text for the help output |
default_value | Default argument |
description | Description of the parameter. Indentation of newline is done automatically. |
required | If the user has to provide a value i.e. if the value has to differ from the default (checked in get-method) |
advanced | If true, this parameter is advanced and by default hidden in the GUI. |
|
protected |
Registers an integer option.
name | Name of the option in the command line and the INI file |
argument | Argument description text for the help output |
default_value | Default argument |
description | Description of the parameter. Indentation of newline is done automatically. |
required | If the user has to provide a value i.e. if the value has to differ from the default (checked in get-method) |
advanced | If true, this parameter is advanced and by default hidden in the GUI. |
|
protectedpure virtual |
Sets the valid command line options (with argument) and flags (without argument).
The options '-ini' '-log' '-instance' '-debug' and the flag '–help' are automatically registered.
Implemented in TOPPMetaProSIP, RNPxlSearch, TOPPOpenPepXL, TOPPOpenPepXLLF, SimpleSearchEngine, and TOPPRNPxl.
|
protected |
Registers an output file option.
Output files behave like string options, but are automatically checked with outputFileWritable_() when the option is accessed in the TOPP tool.
name | Name of the option in the command line and the INI file |
argument | Argument description text for the help output |
default_value | Default argument |
description | Description of the parameter. Indentation of newline is done automatically. |
required | If the user has to provide a value i.e. if the value has to differ from the default (checked in get-method) |
advanced | If true, this parameter is advanced and by default hidden in the GUI. |
|
protected |
Registers a list of output files option.
A list of output files behaves like a StringList, but are automatically checked with outputFileWritable_() when the option is accessed in the TOPP tool.
name | Name of the option in the command line and the INI file |
argument | Argument description text for the help output |
default_value | Default argument |
description | Description of the parameter. Indentation of newline is done automatically. |
required | If the user has to provide a value i.e. if the value has to differ from the default (checked in get-method) |
advanced | If true, this parameter is advanced and by default hidden in the GUI. |
|
protected |
|
protected |
Registers a list of strings option.
name | Name of the option in the command line and the INI file |
argument | Argument description text for the help output |
default_value | Default argument |
description | Description of the parameter. Indentation of newline is done automatically. |
required | If the user has to provide a value i.e. if the value has to differ from the default (checked in get-method) |
advanced | If true, this parameter is advanced and by default hidden in the GUI. |
|
protected |
Registers a string option.
name | Name of the option in the command line and the INI file |
argument | Argument description text for the help output |
default_value | Default argument |
description | Description of the parameter. Indentation of newline is done automatically. |
required | If the user has to provide a value i.e. if the value has to differ from the default (checked in get-method) |
advanced | If true, this parameter is advanced and by default hidden in the GUI. |
Registers an allowed subsection in the INI file (usually from OpenMS algorithms).
Use this method to register subsections that are passed to algorithms.
Registers an allowed subsection in the INI file originating from the TOPP tool itself.
Use this method to register subsections which is created by a commandline param (registered by e.g. registerDoubleOption_() ) and contains a ':' in its name. This is done to distinguish these parameters from normal subsections, which are filled by calling 'getSubsectionDefaults_()'. This is not necessary for here.
Removes a (temporary) directory.
If keep_debug
is set to a positive value (> 0), the directory is kept if the current debug level (debug_level_
) is at least at that value.
Sets the maximum value for the floating point parameter(can be a list of floating points,too) name
.
Exception::ElementNotFound | is thrown if name is not found or if the parameter type is wrong |
Sets the maximum value for the integer parameter(can be a list of integers,too) name
.
Exception::ElementNotFound | is thrown if name is not found or if the parameter type is wrong |
|
static |
Sets the maximal number of usable threads.
num_threads | The number of threads that should be usable. |
Sets the minimum value for the floating point parameter(can be a list of floating points,too) name
.
Exception::ElementNotFound | is thrown if name is not found or if the parameter type is wrong |
Sets the minimum value for the integer parameter(can be a list of integers,too) name
.
Exception::ElementNotFound | is thrown if name is not found or if the parameter type is wrong |
|
protected |
Sets the formats for a input/output file option or for all members of an input/output file lists.
Setting the formats causes a check for the right file format (input file) or the right file extension (output file). This check is performed only, when the option is accessed in the TOPP tool. When force_OpenMS_format
is set, only formats known to OpenMS internally are allowed (default).
Exception::ElementNotFound | is thrown if the parameter is unset or not a file parameter |
Exception::InvalidParameter | is thrown if an unknown format name is used ( |
Sets the valid strings for a string option or a whole string list.
Exception::ElementNotFound | is thrown if the parameter is unset or not a string parameter |
Exception::InvalidParameter | is thrown if the valid strings contain comma characters |
|
protected |
Sets the valid strings for a string option or a whole string list.
This overload should be used for options which are 1:1 with Enums + their static string representations. E.g. MSNumpressCoder::NamesOfNumpressCompression[]
Exception::ElementNotFound | is thrown if the parameter is unset or not a string parameter |
Exception::InvalidParameter | is thrown if the valid strings contain comma characters |
|
protected |
Returns the tool name.
|
protected |
Write common tool description (CTD) file.
Writes a text
to the log file and to std::cout if the debug level is at least min_level
.
|
protected |
Writes a string to the log file and to std::cout.
Write WSDL file and validate it. Returns EXECUTION_OK or INTERNAL_ERROR (if validation failed)
|
protected |
Debug level set by -debug.
|
private |
Tool indicates it supports assignment of unique DocumentID from IDPool.
|
private |
Instance of DocumentIDTagger, which can be accessed using getDocumentIDTagger_()
|
private |
Location in the ini file where to look for parameters.
|
private |
Instance number.
|
mutableprivate |
Log file stream. Use the writeLog_() and writeDebug_() methods to access it.
|
protected |
Type of progress logging.
|
protected |
Flag indicating if this an official TOPP tool.
|
private |
All parameters relevant to this invocation of the program.
|
private |
Parameters from command line.
|
private |
Parameters from common section without tool name.
|
private |
Parameters from common section with tool name.
|
private |
All parameters specified in the ini file.
|
private |
Parameters from instance section.
|
private |
Storage location for parameter information.
|
private |
Require at least one command line argument, exit immediately otherwise. GUI tools should disable this to be callable by double clicking.
Storage location and description for allowed subsections.
Storage location and description for allowed subsections from TOPP tool's command-line parameters.
|
protected |
Test mode.
Test mode is enabled using the command line parameter -test .
It disables writing of data, which would corrupt tests:
|
private |
Tool description. This is assigned once and for all in the constructor.
|
private |
Tool name. This is assigned once and for all in the constructor.
|
staticprotected |
.TOPP.ini file for storing system default parameters
|
protected |
Version string including additional revision/date time information. Note: This differs from version_ only if not provided by the user.
|
protected |
Version string (if empty, the OpenMS/TOPP version is printed)
OpenMS / TOPP release 2.3.0 | Documentation generated on Tue Jan 9 2018 18:22:13 using doxygen 1.8.13 |