41 #include <unordered_map>
43 #include <QStringList>
51 class KDTreeFeatureMaps;
63 bool isFeatureOnly()
const {
return preprocessing.getValue(
"feature_only").toBool(); }
77 int number_of_candidates = sirius.getValue(
"candidates");
80 if (number_of_candidates == -1)
86 return number_of_candidates;
198 const String& tmp_out_dir,
200 const String& out_csifingerid,
201 const bool decoy_generation)
const;
211 openms_param_name(param_name), enclose(enclose) {}
231 String result(param_name);
233 return sectionName() +
":" + result;
238 const String ¶meter_name,
240 const String ¶meter_description);
242 const String ¶meter_name,
243 const String ¶meter_description);
263 for (
const auto &pair : openms_to_sirius)
267 if (!value.
isEmpty() && value != default_value)
270 if (string_value ==
"true")
274 else if (string_value !=
"false")
276 result.push_back(
String(
"--" + pair.second +
"=" + string_value).
toQString());
Class to hold strings, numeric values, lists of strings and lists of numeric values.
Definition: DataValue.h:59
String toString(bool full_precision=true) const
Conversion to String full_precision Controls number of fractional digits for all double types or list...
bool isEmpty() const
Test if the value is empty.
Definition: DataValue.h:388
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:92
Param param_
Container for current parameters.
Definition: DefaultParamHandler.h:165
Param defaults_
Container for default parameters. This member should be filled in the constructor of derived classes!
Definition: DefaultParamHandler.h:172
Stores information required for preprocessing.
Definition: FeatureMapping.h:51
Stores preprocessed feature mapping information.
Definition: FeatureMapping.h:59
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:72
Class to hold strings, numeric values, vectors of strings and vectors of numeric values using the stl...
Definition: ParamValue.h:55
Management and storage of parameters / INI files.
Definition: Param.h:70
void setValidStrings(const std::string &key, const std::vector< std::string > &strings)
Sets the valid strings for the parameter key.
const ParamValue & getValue(const std::string &key) const
Returns a value of a parameter.
void setMinInt(const std::string &key, int min)
Sets the minimum value for the integer or integer list parameter key.
Definition: SiriusAdapterAlgorithm.h:311
Fingerid(SiriusAdapterAlgorithm *enclose)
Definition: SiriusAdapterAlgorithm.h:314
void parameters() override
String sectionName() const override
Definition: SiriusAdapterAlgorithm.h:312
Definition: SiriusAdapterAlgorithm.h:205
SiriusAdapterAlgorithm * enclose
Definition: SiriusAdapterAlgorithm.h:207
ParameterModifier(const String ¶m_name, SiriusAdapterAlgorithm *enclose)
Definition: SiriusAdapterAlgorithm.h:210
void withValidStrings(initializer_list< std::string > choices)
Definition: SiriusAdapterAlgorithm.h:213
const String openms_param_name
Definition: SiriusAdapterAlgorithm.h:206
void withMinInt(int value)
Definition: SiriusAdapterAlgorithm.h:218
Definition: SiriusAdapterAlgorithm.h:225
unordered_map< String, String > openms_to_sirius
Definition: SiriusAdapterAlgorithm.h:227
virtual ~ParameterSection()=default
ParameterModifier parameter(const String ¶meter_name, const ParamValue &default_value, const String ¶meter_description)
DataValue getValue(const String ¶m_name) const
Definition: SiriusAdapterAlgorithm.h:255
virtual String sectionName() const =0
virtual void parameters()=0
SiriusAdapterAlgorithm * enclose
Definition: SiriusAdapterAlgorithm.h:250
ParameterSection(SiriusAdapterAlgorithm *enclose)
Definition: SiriusAdapterAlgorithm.h:245
void flag(const String ¶meter_name, const String ¶meter_description)
QStringList getCommandLine() const
Definition: SiriusAdapterAlgorithm.h:260
String toFullParameter(const String ¶m_name) const
Definition: SiriusAdapterAlgorithm.h:229
Definition: SiriusAdapterAlgorithm.h:319
Passatutto(SiriusAdapterAlgorithm *enclose)
Definition: SiriusAdapterAlgorithm.h:322
void parameters() override
String sectionName() const override
Definition: SiriusAdapterAlgorithm.h:320
Definition: SiriusAdapterAlgorithm.h:287
Preprocessing(SiriusAdapterAlgorithm *enclose)
Definition: SiriusAdapterAlgorithm.h:290
void parameters() override
String sectionName() const override
Definition: SiriusAdapterAlgorithm.h:288
Definition: SiriusAdapterAlgorithm.h:295
Project(SiriusAdapterAlgorithm *enclose)
Definition: SiriusAdapterAlgorithm.h:298
void parameters() override
String sectionName() const override
Definition: SiriusAdapterAlgorithm.h:296
Struct for temporary folder structure.
Definition: SiriusAdapterAlgorithm.h:108
SiriusTemporaryFileSystemObjects(int debug_level)
Construct temporary folder structure for SIRIUS (SiriusTemporaryFileSystemObjects)
const String & getTmpMsFile() const
const String & getTmpDir() const
const String & getTmpOutDir() const
String tmp_out_dir_
Definition: SiriusAdapterAlgorithm.h:126
~SiriusTemporaryFileSystemObjects()
Destructor of SiriusTemporaryFileSystemObjects based on debug level.
String tmp_dir_
Definition: SiriusAdapterAlgorithm.h:124
String tmp_ms_file_
Definition: SiriusAdapterAlgorithm.h:125
int debug_level_
Definition: SiriusAdapterAlgorithm.h:122
Definition: SiriusAdapterAlgorithm.h:303
void parameters() override
Sirius(SiriusAdapterAlgorithm *enclose)
Definition: SiriusAdapterAlgorithm.h:306
String sectionName() const override
Definition: SiriusAdapterAlgorithm.h:304
Definition: SiriusAdapterAlgorithm.h:54
const vector< String > callSiriusQProcess(const String &tmp_ms_file, const String &tmp_out_dir, String &executable, const String &out_csifingerid, const bool decoy_generation) const
Call SIRIUS with QProcess.
Preprocessing preprocessing
Definition: SiriusAdapterAlgorithm.h:326
static void sortSiriusWorkspacePathsByScanIndex(std::vector< String > &subdirs)
Sort function using the extracted scan_index from the sirius workspace file path.
int getNumberOfSiriusCandidates() const
Accessors for Sirius Parameters.
Definition: SiriusAdapterAlgorithm.h:75
Passatutto passatutto
Definition: SiriusAdapterAlgorithm.h:330
double getPrecursorMzTolerance() const
Definition: SiriusAdapterAlgorithm.h:65
bool isNoMasstraceInfoIsotopePattern() const
Definition: SiriusAdapterAlgorithm.h:68
static String determineSiriusExecutable(String &executable)
Checks if the provided String points to a valid SIRIUS executable, otherwise tries to select the exec...
bool isFeatureOnly() const
Definition: SiriusAdapterAlgorithm.h:63
double getPrecursorRtTolerance() const
Definition: SiriusAdapterAlgorithm.h:66
Sirius sirius
Definition: SiriusAdapterAlgorithm.h:328
Fingerid fingerid
Definition: SiriusAdapterAlgorithm.h:329
void updateExistingParameter(const Param ¶m)
Updates all parameters that already exist in this DefaultParamHandler with the values provided by the...
bool precursorMzToleranceUnitIsPPM() const
Definition: SiriusAdapterAlgorithm.h:67
void preprocessingSirius(const String &featureinfo, const MSExperiment &spectra, FeatureMapping::FeatureMappingInfo &fm_info, FeatureMapping::FeatureToMs2Indices &feature_mapping) const
Preprocessing needed for SIRIUS.
SiriusAdapterAlgorithm()
default constructor
void logFeatureSpectraNumber(const String &featureinfo, const FeatureMapping::FeatureToMs2Indices &feature_mapping, const MSExperiment &spectra) const
logs number of features and spectra used
bool hasFullNameParameter(const String &name) const
Checks whether this DefaultParamHandler has a ParamEntry with the provided name.
UInt getFilterByNumMassTraces() const
Definition: SiriusAdapterAlgorithm.h:64
void logInSiriusAccount(String &executable, const String &email, const String &password) const
Log in to Sirius with personal user account (required in Sirius >= 5).
int getIsotopePatternIterations() const
Definition: SiriusAdapterAlgorithm.h:69
Project project
Definition: SiriusAdapterAlgorithm.h:327
A more convenient string class.
Definition: String.h:60
QString toQString() const
Conversion to Qt QString.
String & substitute(char from, char to)
Replaces all occurrences of the character from by the character to.
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48