|
OpenMS
2.5.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);
248 void enableLogging_()
const;
262 virtual Param getSubsectionDefaults_(
const String& section)
const;
271 Param getSubsectionDefaults_()
const;
292 Param parseCommandLine_(
const int argc,
const char** argv,
const String& misc =
"misc",
const String& unknown =
"unknown");
310 Int getParamAsInt_(
const String& key,
Int default_value = 0)
const;
317 double getParamAsDouble_(
const String& key,
double default_value = 0)
const;
349 bool getParamAsBool_(
const String& key)
const;
371 String getDocumentationURL()
const;
374 Param getDefaultParameters_()
const;
402 return ini_location_;
406 const String& toolName_()
const;
428 virtual void registerOptionsAndFlags_() = 0;
434 std::vector<ParameterInformation> paramToParameterInformation_(
const Param& param)
const;
447 void registerParamSubsectionsAsTOPPSubsections_(
const Param& param);
450 void registerFullParam_(
const Param& param);
462 void registerStringOption_(
const String& name,
const String& argument,
const String& default_value,
const String& description,
bool required =
true,
bool advanced =
false);
470 void setValidStrings_(
const String& name,
const std::vector<String>& strings);
481 void setValidStrings_(
const String& name,
const std::string vstrings[],
int count);
515 void registerOutputFile_(
const String& name,
const String& argument,
const String& default_value,
const String& description,
bool required =
true,
bool advanced =
false);
527 void setValidFormats_(
const String& name,
const std::vector<String>& formats,
const bool force_OpenMS_format =
true);
540 void registerDoubleOption_(
const String& name,
const String& argument,
double default_value,
const String& description,
bool required =
true,
bool advanced =
false);
547 void setMinInt_(
const String& name,
Int min);
553 void setMaxInt_(
const String& name,
Int max);
559 void setMinFloat_(
const String& name,
double min);
565 void setMaxFloat_(
const String& name,
double max);
577 void registerIntOption_(
const String& name,
const String& argument,
578 Int default_value,
const String& description,
579 bool required =
true,
bool advanced =
false);
592 void registerIntList_(
const String& name,
const String& argument,
IntList default_value,
const String& description,
bool required =
true,
bool advanced =
false);
604 void registerDoubleList_(
const String& name,
const String& argument,
DoubleList default_value,
const String& description,
bool required =
true,
bool advanced =
false);
616 void registerStringList_(
const String& name,
const String& argument,
StringList default_value,
const String& description,
bool required =
true,
bool advanced =
false);
649 void registerOutputFileList_(
const String& name,
const String& argument,
StringList default_value,
const String& description,
bool required =
true,
bool advanced =
false);
652 void registerFlag_(
const String& name,
const String& description,
bool advanced =
false);
661 void registerSubsection_(
const String& name,
const String& description);
672 void registerTOPPSubsection_(
const String& name,
const String& description);
676 void addEmptyLine_();
697 double getDoubleOption_(
const String& name)
const;
707 Int getIntOption_(
const String& name)
const;
740 bool getFlag_(
const String& name)
const;
754 Param const& getParam_()
const;
769 void checkParam_(
const Param& param,
const String& filename,
const String& location)
const;
795 void checkIfIniParametersAreApplicable_(
const Param& ini_params);
802 virtual ExitCodes main_(
int argc,
const char** argv) = 0;
806 void writeLog_(
const String& text)
const;
810 void writeDebug_(
const String& text,
UInt min_level)
const;
813 void writeDebug_(
const String& text,
const Param& param,
UInt min_level)
const;
818 String makeTempDirectory_()
const;
822 String makeAutoRemoveTempDirectory_(
Int keep_debug = 2);
829 void removeTempDirectory_(
const String& dirname,
Int keep_debug = 2)
const;
834 ExitCodes runExternalProcess_(
const QString& executable,
const QStringList& arguments,
const QString& workdir =
"")
const;
864 void inputFileReadable_(
const String& filename,
const String& param_name)
const;
876 void outputFileWritable_(
const String& filename,
const String& param_name)
const;
886 bool parseRange_(
const String& text,
double& low,
double& high)
const;
895 bool parseRange_(
const String& text,
Int& low,
Int& high)
const;
916 DataProcessing getProcessingInfo_(
const std::set<DataProcessing::ProcessingAction>& actions)
const;
951 void addText_(
const String& text);
Int debug_level_
Debug level set by -debug.
Definition: TOPPBase.h:943
Param param_inifile_
All parameters specified in the ini file.
Definition: TOPPBase.h:223
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:277
ProgressLogger::LogType log_type_
Type of progress logging.
Definition: TOPPBase.h:898
std::ofstream log_
Log file stream. Use the writeLog_() and writeDebug_() methods to access it.
Definition: TOPPBase.h:238
const String tool_name_
Tool name. This is assigned once and for all in the constructor.
Definition: TOPPBase.h:196
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:391
bool test_mode_
Test mode.
Definition: TOPPBase.h:934
Param param_common_tool_
Parameters from common section with tool name.
Definition: TOPPBase.h:232
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:385
Param param_instance_
Parameters from instance section.
Definition: TOPPBase.h:229
A more convenient string class.
Definition: String.h:58
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:937
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:199
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
Int working_dir_keep_debug_lvl_
Debug level at which to keep working dir.
Definition: TOPPBase.h:211
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:400
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:388
Definition: TOPPBase.h:151
UnregisteredParameter(const char *file, int line, const char *function, const String ¶meter)
Definition: TOPPBase.h:91
const char * tool_name
Definition: TOPPAS.cpp:94
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:79
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:70
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
String working_dir_
An optional temporary working directory.
Definition: TOPPBase.h:208
LogType
Possible log types.
Definition: ProgressLogger.h:70
Param param_
All parameters relevant to this invocation of the program.
Definition: TOPPBase.h:220
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:95
const String ini_location_
Location in the ini file where to look for parameters.
Definition: TOPPBase.h:205
static const Citation cite_openms_
The OpenMS citation.
Definition: TOPPBase.h:940
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
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:251
Param param_common_
Parameters from common section without tool name.
Definition: TOPPBase.h:235
String version_
Version string (if empty, the OpenMS/TOPP version is printed)
Definition: TOPPBase.h:382
Definition: TOPPBase.h:158
const Int instance_number_
Instance number.
Definition: TOPPBase.h:202
std::map< String, String > subsections_
Storage location and description for allowed subsections.
Definition: TOPPBase.h:274
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:226