|
OpenMS
2.6.0
|
Go to the documentation of this file.
56 struct ParameterInformation;
92 BaseException(file, line, function,
"UnregisteredParameter", parameter)
104 BaseException(file, line, function,
"WrongParameterType", parameter)
116 BaseException(file, line, function,
"RequiredParameterNotGiven", parameter)
177 TOPPBase(
const String& name,
const String& description,
bool official =
true,
const std::vector<Citation>& citations = {});
183 ExitCodes
main(
int argc,
const char** argv);
192 static void setMaxNumberOfThreads(
int num_threads);
201 String getToolPrefix()
const;
251 void enableLogging_()
const;
265 virtual Param getSubsectionDefaults_(
const String& section)
const;
274 Param getSubsectionDefaults_()
const;
295 Param parseCommandLine_(
const int argc,
const char** argv,
const String& misc =
"misc",
const String& unknown =
"unknown");
313 Int getParamAsInt_(
const String& key,
Int default_value = 0)
const;
320 double getParamAsDouble_(
const String& key,
double default_value = 0)
const;
352 bool getParamAsBool_(
const String& key)
const;
374 String getDocumentationURL()
const;
377 Param getDefaultParameters_()
const;
405 return ini_location_;
409 const String& toolName_()
const;
431 virtual void registerOptionsAndFlags_() = 0;
437 std::vector<ParameterInformation> paramToParameterInformation_(
const Param& param)
const;
450 void registerParamSubsectionsAsTOPPSubsections_(
const Param& param);
453 void registerFullParam_(
const Param& param);
465 void registerStringOption_(
const String& name,
const String& argument,
const String& default_value,
const String& description,
bool required =
true,
bool advanced =
false);
473 void setValidStrings_(
const String& name,
const std::vector<String>& strings);
484 void setValidStrings_(
const String& name,
const std::string vstrings[],
int count);
518 void registerOutputFile_(
const String& name,
const String& argument,
const String& default_value,
const String& description,
bool required =
true,
bool advanced =
false);
530 void setValidFormats_(
const String& name,
const std::vector<String>& formats,
const bool force_OpenMS_format =
true);
543 void registerDoubleOption_(
const String& name,
const String& argument,
double default_value,
const String& description,
bool required =
true,
bool advanced =
false);
550 void setMinInt_(
const String& name,
Int min);
556 void setMaxInt_(
const String& name,
Int max);
562 void setMinFloat_(
const String& name,
double min);
568 void setMaxFloat_(
const String& name,
double max);
580 void registerIntOption_(
const String& name,
const String& argument,
581 Int default_value,
const String& description,
582 bool required =
true,
bool advanced =
false);
595 void registerIntList_(
const String& name,
const String& argument,
IntList default_value,
const String& description,
bool required =
true,
bool advanced =
false);
607 void registerDoubleList_(
const String& name,
const String& argument,
DoubleList default_value,
const String& description,
bool required =
true,
bool advanced =
false);
619 void registerStringList_(
const String& name,
const String& argument,
StringList default_value,
const String& description,
bool required =
true,
bool advanced =
false);
652 void registerOutputFileList_(
const String& name,
const String& argument,
StringList default_value,
const String& description,
bool required =
true,
bool advanced =
false);
655 void registerFlag_(
const String& name,
const String& description,
bool advanced =
false);
664 void registerSubsection_(
const String& name,
const String& description);
675 void registerTOPPSubsection_(
const String& name,
const String& description);
679 void addEmptyLine_();
700 double getDoubleOption_(
const String& name)
const;
710 Int getIntOption_(
const String& name)
const;
743 bool getFlag_(
const String& name)
const;
757 Param const& getParam_()
const;
772 void checkParam_(
const Param& param,
const String& filename,
const String& location)
const;
810 void checkIfIniParametersAreApplicable_(
const Param& ini_params);
817 virtual ExitCodes main_(
int argc,
const char** argv) = 0;
821 void writeLog_(
const String& text)
const;
825 void writeDebug_(
const String& text,
UInt min_level)
const;
828 void writeDebug_(
const String& text,
const Param& param,
UInt min_level)
const;
833 ExitCodes runExternalProcess_(
const QString& executable,
const QStringList& arguments,
const QString& workdir =
"")
const;
838 ExitCodes runExternalProcess_(
const QString& executable,
const QStringList& arguments,
String& proc_stdout,
String& proc_stderr,
const QString& workdir =
"")
const;
867 void inputFileReadable_(
const String& filename,
const String& param_name)
const;
879 void outputFileWritable_(
const String& filename,
const String& param_name)
const;
889 bool parseRange_(
const String& text,
double& low,
double& high)
const;
898 bool parseRange_(
const String& text,
Int& low,
Int& high)
const;
919 DataProcessing getProcessingInfo_(
const std::set<DataProcessing::ProcessingAction>& actions)
const;
954 void addText_(
const String& text);
Int debug_level_
Debug level set by -debug.
Definition: TOPPBase.h:946
Param param_inifile_
All parameters specified in the ini file.
Definition: TOPPBase.h:226
Base class for TOPP applications.
Definition: TOPPBase.h:144
std::map< String, String > subsections_TOPP_
Storage location and description for allowed subsections from TOPP tool's command-line parameters.
Definition: TOPPBase.h:280
ProgressLogger::LogType log_type_
Type of progress logging.
Definition: TOPPBase.h:901
std::ofstream log_
Log file stream. Use the writeLog_() and writeDebug_() methods to access it.
Definition: TOPPBase.h:241
const String tool_name_
Tool name. This is assigned once and for all in the constructor.
Definition: TOPPBase.h:205
Definition: TOPPBase.h:157
Parameter entry used to store the actual information inside of a Param entry.
Definition: Param.h:78
std::string when_where
suggested format: journal. year; volume, issue: pages
Definition: TOPPBase.h:74
std::vector< Citation > citations_
Papers, specific for this tool (will be shown in '–help')
Definition: TOPPBase.h:394
bool test_mode_
Test mode.
Definition: TOPPBase.h:937
Param param_common_tool_
Parameters from common section with tool name.
Definition: TOPPBase.h:235
std::string toString() const
mangle members to string
Definition: TOPPBase.h:78
String verboseVersion_
Version string including additional revision/date time information. Note: This differs from version_ ...
Definition: TOPPBase.h:388
Param param_instance_
Parameters from instance section.
Definition: TOPPBase.h:232
A more convenient string class.
Definition: String.h:59
std::vector< double > DoubleList
Vector of double precision real types.
Definition: ListUtils.h:62
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
Definition: TOPPBase.h:153
static GlobalExceptionHandler & getInstance()
The accessor for the singleton. It also serves as a replacement for the constructor.
Definition: GlobalExceptionHandler.h:88
static String topp_ini_file_
.TOPP.ini file for storing system default parameters
Definition: TOPPBase.h:940
Definition: TOPPBase.h:160
std::vector< Int > IntList
Vector of signed integers.
Definition: ListUtils.h:55
Definition: TOPPBase.h:152
std::string title
title of article
Definition: TOPPBase.h:73
const String tool_description_
Tool description. This is assigned once and for all in the constructor.
Definition: TOPPBase.h:208
std::string authors
list of authors in AMA style, i.e. `<surname>` `<initials>`, ...
Definition: TOPPBase.h:72
std::string doi
plain DOI (no urls), e.g. 10.1021/pr100177k
Definition: TOPPBase.h:75
Definition: TOPPBase.h:155
A parameter was accessed with the wrong type.
Definition: TOPPBase.h:99
const String & getIniLocation_() const
Returns the location of the ini file where parameters are taken from. E.g. if the command line was TO...
Definition: TOPPBase.h:403
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
ProcessingAction
Definition: DataProcessing.h:58
static void setMessage(const std::string &message)
Class to hold strings, numeric values, lists of strings and lists of numeric values.
Definition: DataValue.h:56
An unregistered parameter was accessed.
Definition: TOPPBase.h:87
bool official_
Flag indicating if this an official TOPP tool.
Definition: TOPPBase.h:391
Definition: TOPPBase.h:151
UnregisteredParameter(const char *file, int line, const char *function, const String ¶meter)
Definition: TOPPBase.h:91
Exception base class.
Definition: Exception.h:89
Definition: TOPPBase.h:161
Definition: TOPPBase.h:162
Stores Citations for individual TOPP tools.
Definition: TOPPBase.h:70
A container for consensus elements.
Definition: ConsensusMap.h:80
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:70
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
LogType
Possible log types.
Definition: ProgressLogger.h:70
Param param_
All parameters relevant to this invocation of the program.
Definition: TOPPBase.h:223
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:73
Definition: TOPPBase.h:163
A required parameter was not given.
Definition: TOPPBase.h:111
A container for features.
Definition: FeatureMap.h:97
const String ini_location_
Location in the ini file where to look for parameters.
Definition: TOPPBase.h:214
static const Citation cite_openms_
The OpenMS citation.
Definition: TOPPBase.h:943
RequiredParameterNotGiven(const char *file, int line, const char *function, const String ¶meter)
Definition: TOPPBase.h:115
Definition: TOPPBase.h:159
Description of the applied preprocessing steps.
Definition: DataProcessing.h:51
const char * tool_name
Definition: SwathWizard.cpp:93
ExitCodes
Exit codes.
Definition: TOPPBase.h:149
Management and storage of parameters / INI files.
Definition: Param.h:73
std::vector< ParameterInformation > parameters_
Storage location for parameter information.
Definition: TOPPBase.h:254
Param param_common_
Parameters from common section without tool name.
Definition: TOPPBase.h:238
String version_
Version string (if empty, the OpenMS/TOPP version is printed)
Definition: TOPPBase.h:385
Definition: TOPPBase.h:158
const Int instance_number_
Instance number.
Definition: TOPPBase.h:211
std::map< String, String > subsections_
Storage location and description for allowed subsections.
Definition: TOPPBase.h:277
Definition: TOPPBase.h:154
Definition: TOPPBase.h:156
WrongParameterType(const char *file, int line, const char *function, const String ¶meter)
Definition: TOPPBase.h:103
Param param_cmdline_
Parameters from command line.
Definition: TOPPBase.h:229