57 #include <QStringList> 98 BaseException(file, line, function,
"UnregisteredParameter", parameter)
110 BaseException(file, line, function,
"WrongParameterType", parameter)
122 BaseException(file, line, function,
"RequiredParameterNotGiven", parameter)
183 TOPPBase(
const String& name,
const String& description,
bool official =
true,
const std::vector<Citation>& citations = {});
189 ExitCodes
main(
int argc,
const char** argv);
198 static void setMaxNumberOfThreads(
int num_threads);
254 void enableLogging_()
const;
268 virtual Param getSubsectionDefaults_(
const String& section)
const;
277 Param getSubsectionDefaults_()
const;
298 Param parseCommandLine_(
const int argc,
const char** argv,
const String& misc =
"misc",
const String& unknown =
"unknown");
316 Int getParamAsInt_(
const String& key,
Int default_value = 0)
const;
323 double getParamAsDouble_(
const String& key,
double default_value = 0)
const;
355 bool getParamAsBool_(
const String& key)
const;
378 Param getDefaultParameters_()
const;
406 return ini_location_;
410 const String& toolName_()
const;
432 virtual void registerOptionsAndFlags_() = 0;
438 std::vector<ParameterInformation> paramToParameterInformation_(
const Param& param)
const;
451 void registerParamSubsectionsAsTOPPSubsections_(
const Param& param);
454 void registerFullParam_(
const Param& param);
466 void registerStringOption_(
const String& name,
const String& argument,
const String& default_value,
const String& description,
bool required =
true,
bool advanced =
false);
474 void setValidStrings_(
const String& name,
const std::vector<String>& strings);
485 void setValidStrings_(
const String& name,
const std::string vstrings[],
int count);
517 void registerOutputFile_(
const String& name,
const String& argument,
const String& default_value,
const String& description,
bool required =
true,
bool advanced =
false);
529 void setValidFormats_(
const String& name,
const std::vector<String>& formats,
const bool force_OpenMS_format =
true);
542 void registerDoubleOption_(
const String& name,
const String& argument,
double default_value,
const String& description,
bool required =
true,
bool advanced =
false);
549 void setMinInt_(
const String& name,
Int min);
555 void setMaxInt_(
const String& name,
Int max);
561 void setMinFloat_(
const String& name,
double min);
567 void setMaxFloat_(
const String& name,
double max);
579 void registerIntOption_(
const String& name,
const String& argument,
580 Int default_value,
const String& description,
581 bool required =
true,
bool advanced =
false);
594 void registerIntList_(
const String& name,
const String& argument,
IntList default_value,
const String& description,
bool required =
true,
bool advanced =
false);
606 void registerDoubleList_(
const String& name,
const String& argument,
DoubleList default_value,
const String& description,
bool required =
true,
bool advanced =
false);
618 void registerStringList_(
const String& name,
const String& argument,
StringList default_value,
const String& description,
bool required =
true,
bool advanced =
false);
650 void registerOutputFileList_(
const String& name,
const String& argument,
StringList default_value,
const String& description,
bool required =
true,
bool advanced =
false);
653 void registerFlag_(
const String& name,
const String& description,
bool advanced =
false);
662 void registerSubsection_(
const String& name,
const String& description);
673 void registerTOPPSubsection_(
const String& name,
const String& description);
677 void addEmptyLine_();
698 double getDoubleOption_(
const String& name)
const;
708 Int getIntOption_(
const String& name)
const;
741 bool getFlag_(
const String& name)
const;
755 Param const& getParam_()
const;
770 void checkParam_(
const Param& param,
const String& filename,
const String& location)
const;
780 void checkIfIniParametersAreApplicable_(
const Param& ini_params);
787 virtual ExitCodes main_(
int argc,
const char** argv) = 0;
791 void writeLog_(
const String& text)
const;
795 void writeDebug_(
const String& text,
UInt min_level)
const;
798 void writeDebug_(
const String& text,
const Param& param,
UInt min_level)
const;
803 String makeTempDirectory_()
const;
807 String makeAutoRemoveTempDirectory_(
Int keep_debug = 2);
814 void removeTempDirectory_(
const String& dirname,
Int keep_debug = 2)
const;
819 ExitCodes runExternalProcess_(
const QString& executable,
const QStringList& arguments,
const QString& workdir =
"")
const;
847 void inputFileReadable_(
const String& filename,
const String& param_name)
const;
859 void outputFileWritable_(
const String& filename,
const String& param_name)
const;
869 bool parseRange_(
const String& text,
double& low,
double& high)
const;
878 bool parseRange_(
const String& text,
Int& low,
Int& high)
const;
896 for (
Size i = 0; i < map.
size(); ++i)
898 map[i].getDataProcessing().push_back(dp_);
910 DataProcessing getProcessingInfo_(
const std::set<DataProcessing::ProcessingAction>& actions)
const;
918 ExitCodes writeWSDL_(
const String& filename);
948 void addText_(
const String& text);
String verboseVersion_
Version string including additional revision/date time information. Note: This differs from version_ ...
Definition: TOPPBase.h:389
Definition: TOPPBase.h:164
Description of the applied preprocessing steps.
Definition: DataProcessing.h:51
std::map< String, String > subsections_TOPP_
Storage location and description for allowed subsections from TOPP tool's command-line parameters...
Definition: TOPPBase.h:283
An unregistered parameter was accessed.
Definition: TOPPBase.h:93
Definition: TOPPBase.h:157
Definition: TOPPBase.h:160
A more convenient string class.
Definition: String.h:57
std::string doi
plain DOI (no urls), e.g. 10.1021/pr100177k
Definition: TOPPBase.h:81
std::vector< double > DoubleList
Vector of double precision real types.
Definition: ListUtils.h:65
LogType
Possible log types.
Definition: ProgressLogger.h:70
UnregisteredParameter(const char *file, int line, const char *function, const String ¶meter)
Definition: TOPPBase.h:97
RequiredParameterNotGiven(const char *file, int line, const char *function, const String ¶meter)
Definition: TOPPBase.h:121
std::ofstream log_
Log file stream. Use the writeLog_() and writeDebug_() methods to access it.
Definition: TOPPBase.h:244
Int working_dir_keep_debug_lvl_
Debug level at which to keep working dir.
Definition: TOPPBase.h:217
A container for features.
Definition: FeatureMap.h:93
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
bool official_
Flag indicating if this an official TOPP tool.
Definition: TOPPBase.h:392
Parameter entry used to store the actual information inside of a Param entry.
Definition: Param.h:79
A container for consensus elements.
Definition: ConsensusMap.h:75
std::vector< Int > IntList
Vector of signed integers.
Definition: ListUtils.h:58
void addDataProcessing_(PeakMap &map, const DataProcessing &dp) const
Data processing setter for peak maps.
Definition: TOPPBase.h:893
static const Citation cite_openms_
The OpenMS citation.
Definition: TOPPBase.h:937
Definition: TOPPBase.h:165
Definition: TOPPBase.h:161
std::map< String, String > subsections_
Storage location and description for allowed subsections.
Definition: TOPPBase.h:280
Definition: TOPPBase.h:167
Size size() const
Definition: MSExperiment.h:127
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
bool test_mode_
Test mode.
Definition: TOPPBase.h:931
std::string toString() const
mangle members to string
Definition: TOPPBase.h:84
Definition: TOPPBase.h:166
Base class for TOPP applications.
Definition: TOPPBase.h:150
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:404
static GlobalExceptionHandler & getInstance()
The accessor for the singleton. It also serves as a replacement for the constructor.
Definition: GlobalExceptionHandler.h:88
Class to hold strings, numeric values, lists of strings and lists of numeric values.
Definition: DataValue.h:56
const char * tool_name
Definition: TOPPAS.cpp:94
Definition: TOPPBase.h:163
A parameter was accessed with the wrong type.
Definition: TOPPBase.h:105
Definition: TOPPBase.h:162
Param param_cmdline_
Parameters from command line.
Definition: TOPPBase.h:232
Stores Citations for individual TOPP tools.
Definition: TOPPBase.h:76
Param param_common_tool_
Parameters from common section with tool name.
Definition: TOPPBase.h:238
Size getNrChromatograms() const
get the total number of chromatograms available
ProcessingAction
Definition: DataProcessing.h:58
std::vector< DataProcessingPtr > & getDataProcessing()
returns a mutable reference to the description of the applied processing
Definition: TOPPBase.h:168
std::string title
title of article
Definition: TOPPBase.h:79
Definition: TOPPBase.h:169
std::vector< Citation > citations_
Papers, specific for this tool (will be shown in '–help')
Definition: TOPPBase.h:395
Exception base class.
Definition: Exception.h:89
Param param_common_
Parameters from common section without tool name.
Definition: TOPPBase.h:241
String version_
Version string (if empty, the OpenMS/TOPP version is printed)
Definition: TOPPBase.h:386
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:73
Management and storage of parameters / INI files.
Definition: Param.h:74
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
WrongParameterType(const char *file, int line, const char *function, const String ¶meter)
Definition: TOPPBase.h:109
Definition: TOPPBase.h:159
std::string authors
list of authors in AMA style, i.e. <surname> <initials>, ...
Definition: TOPPBase.h:78
static void setMessage(const std::string &message)
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
String const tool_name_
Tool name. This is assigned once and for all in the constructor.
Definition: TOPPBase.h:202
Param param_
All parameters relevant to this invocation of the program.
Definition: TOPPBase.h:226
Definition: TOPPBase.h:158
std::vector< ParameterInformation > parameters_
Storage location for parameter information.
Definition: TOPPBase.h:257
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:73
String working_dir_
An optional temporary working directory.
Definition: TOPPBase.h:214
ExitCodes
Exit codes.
Definition: TOPPBase.h:155
String const ini_location_
Location in the ini file where to look for parameters.
Definition: TOPPBase.h:211
MSChromatogram & getChromatogram(Size id)
returns a single chromatogram
String const tool_description_
Tool description. This is assigned once and for all in the constructor.
Definition: TOPPBase.h:205
Param param_inifile_
All parameters specified in the ini file.
Definition: TOPPBase.h:229
int Int
Signed integer type.
Definition: Types.h:102
Param param_instance_
Parameters from instance section.
Definition: TOPPBase.h:235
std::string when_where
suggested format: journal. year; volume, issue: pages
Definition: TOPPBase.h:80
Int debug_level_
Debug level set by -debug.
Definition: TOPPBase.h:940
ProgressLogger::LogType log_type_
Type of progress logging.
Definition: TOPPBase.h:881
Int const instance_number_
Instance number.
Definition: TOPPBase.h:208
static String topp_ini_file_
.TOPP.ini file for storing system default parameters
Definition: TOPPBase.h:934
A required parameter was not given.
Definition: TOPPBase.h:117