OpenMS  2.6.0
SiriusAdapterAlgorithm.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2020.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Oliver Alka $
32 // $Authors: Oliver Alka $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
39 
40 namespace OpenMS
41 {
42  class FeatureMap;
43  class File;
44  class KDTreeFeatureMaps;
45 
46  class OPENMS_DLLAPI SiriusAdapterAlgorithm : public DefaultParamHandler
47  {
48  public:
51 
53  struct OPENMS_DLLAPI SiriusTemporaryFileSystemObjects
54  {
55  public:
56 
58  SiriusTemporaryFileSystemObjects(int debug_level);
59 
62 
63  const String& getTmpDir() const;
64  const String& getTmpOutDir() const;
65  const String& getTmpMsFile() const;
66 
67  private:
69 
73 
74  };
75 
89  static void preprocessingSirius(const String& featureinfo,
90  const MSExperiment& spectra,
91  std::vector<FeatureMap>& v_fp,
92  KDTreeFeatureMaps& fp_map_kd,
93  const SiriusAdapterAlgorithm& sirius_algo,
94  FeatureMapping::FeatureToMs2Indices& feature_mapping);
95 
106  static void checkFeatureSpectraNumber(const String& featureinfo,
107  const FeatureMapping::FeatureToMs2Indices& feature_mapping,
108  const MSExperiment& spectra,
109  const SiriusAdapterAlgorithm& sirius_algo);
110 
111 
124  const static std::vector<String> callSiriusQProcess(const String& tmp_ms_file,
125  const String& tmp_out_dir,
126  String& executable,
127  const String& out_csifingerid,
128  const SiriusAdapterAlgorithm& sirius_algo);
129 
130  // getter (used to call functions from SiriusMSConverter, SiriusMzTabWriter, CsiFingerIDMzTabWriter)
131  String getFeatureOnly();
132  String getNoMasstraceInfoIsotopePattern();
133  int getIsotopePatternIterations();
134  int getCandidates();
135  int getTopNHits();
136 
137  protected:
138 
139  // adapter parameters (preprocessing)
145  // flags
148  // parameters for SIRIUS (sirius)
152  int noise_;
153  int ppm_max_;
159  int cores_;
160  // flags
165 
166  void updateMembers_() override;
167  };
168 } // namespace OpenMS
DefaultParamHandler.h
OpenMS::SiriusAdapterAlgorithm::SiriusTemporaryFileSystemObjects
Struct for temporary folder structure.
Definition: SiriusAdapterAlgorithm.h:53
MzTabFile.h
OpenMS::SiriusAdapterAlgorithm::ppm_max_
int ppm_max_
Definition: SiriusAdapterAlgorithm.h:153
OpenMS::TOPPBase
Base class for TOPP applications.
Definition: TOPPBase.h:144
OpenMS::SiriusAdapterAlgorithm::auto_charge_
String auto_charge_
Definition: SiriusAdapterAlgorithm.h:161
OpenMS::Param::copy
Param copy(const String &prefix, bool remove_prefix=false) const
Returns a new Param object containing all entries that start with prefix.
OpenMS::MzTabFile
File adapter for MzTab files.
Definition: MzTabFile.h:58
OpenMS::SiriusAdapterAlgorithm::isotope_
String isotope_
Definition: SiriusAdapterAlgorithm.h:154
OpenMS::SiriusAdapterAlgorithm::getIsotopePatternIterations
int getIsotopePatternIterations()
OpenMS::SiriusAdapterAlgorithm::ion_tree_
String ion_tree_
Definition: SiriusAdapterAlgorithm.h:162
OpenMS::SiriusAdapterAlgorithm::getNoMasstraceInfoIsotopePattern
String getNoMasstraceInfoIsotopePattern()
OpenMS::SiriusAdapterAlgorithm::preprocessingSirius
static void preprocessingSirius(const String &featureinfo, const MSExperiment &spectra, std::vector< FeatureMap > &v_fp, KDTreeFeatureMaps &fp_map_kd, const SiriusAdapterAlgorithm &sirius_algo, FeatureMapping::FeatureToMs2Indices &feature_mapping)
Preprocessing needed for SIRIUS.
OpenMS::SiriusAdapterAlgorithm::SiriusTemporaryFileSystemObjects::debug_level_
int debug_level_
Definition: SiriusAdapterAlgorithm.h:68
OpenMS::SiriusAdapterAlgorithm
Definition: SiriusAdapterAlgorithm.h:46
OpenMS::SiriusAdapterAlgorithm::callSiriusQProcess
const static std::vector< String > callSiriusQProcess(const String &tmp_ms_file, const String &tmp_out_dir, String &executable, const String &out_csifingerid, const SiriusAdapterAlgorithm &sirius_algo)
Call SIRIUS with QProcess.
OpenMS::MzMLFile
File adapter for MzML files.
Definition: MzMLFile.h:55
OpenMS::String
A more convenient string class.
Definition: String.h:59
OpenMS::SiriusAdapterAlgorithm::getTopNHits
int getTopNHits()
MzMLFile.h
OpenMS::MSExperiment
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
OpenMS::SiriusAdapterAlgorithm::precursor_mz_tolerance_unit_
String precursor_mz_tolerance_unit_
Definition: SiriusAdapterAlgorithm.h:142
OpenMS::MzTab
Data model of MzTab files. Please see the official MzTab specification at https://code....
Definition: MzTab.h:800
CsiFingerIdMzTabWriter.h
OpenMS::SiriusAdapterAlgorithm::getCandidates
int getCandidates()
OpenMS::SiriusAdapterAlgorithm::elements_
String elements_
Definition: SiriusAdapterAlgorithm.h:155
OpenMS::SiriusAdapterAlgorithm::most_intense_ms2_
String most_intense_ms2_
Definition: SiriusAdapterAlgorithm.h:164
OpenMS::SiriusAdapterAlgorithm::noise_
int noise_
Definition: SiriusAdapterAlgorithm.h:152
OpenMS::SiriusAdapterAlgorithm::profile_
String profile_
Definition: SiriusAdapterAlgorithm.h:149
OPENMS_LOG_WARN
#define OPENMS_LOG_WARN
Macro if a warning, a piece of information which should be read by the user, should be logged.
Definition: LogStream.h:460
OpenMS::SiriusAdapterAlgorithm::SiriusTemporaryFileSystemObjects::tmp_dir_
String tmp_dir_
Definition: SiriusAdapterAlgorithm.h:70
ListUtils.h
OpenMS::DefaultParamHandler
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:92
Element.h
OpenMS::SiriusAdapterAlgorithm::isotope_pattern_iterations_
int isotope_pattern_iterations_
Definition: SiriusAdapterAlgorithm.h:144
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::SiriusAdapterAlgorithm::tree_timeout_
int tree_timeout_
Definition: SiriusAdapterAlgorithm.h:157
OpenMS::MzMLFile::load
void load(const String &filename, PeakMap &map)
Loads a map from a MzML file. Spectra and chromatograms are sorted by default (this can be disabled u...
OpenMS::File::copyDirRecursively
static bool copyDirRecursively(const QString &from_dir, const QString &to_dir, File::CopyOptions option=CopyOptions::OVERWRITE)
SiriusMSConverter.h
OpenMS::SiriusMSFile::store
static void store(const MSExperiment &spectra, const OpenMS::String &msfile, const FeatureMapping::FeatureToMs2Indices &feature_mapping, const bool &feature_only, const int &isotope_pattern_iterations, const bool no_mt_info, std::vector< SiriusMSFile::CompoundInfo > &v_cmpinfo)
Internal structure used in SiriusAdapter that is used for the conversion of a MzMlFile to an internal...
OpenMS::SiriusAdapterAlgorithm::precursor_rt_tolerance_
double precursor_rt_tolerance_
Definition: SiriusAdapterAlgorithm.h:143
OpenMS::MzTabFile::store
void store(const String &filename, const MzTab &mz_tab) const
OpenMS::CsiFingerIdMzTabWriter::read
static void read(const std::vector< String > &sirius_output_paths, const String &original_input_mzml, const Size &top_n_hits, MzTab &result)
Conversion of CSI:FingerID output to mzTab.
OpenMS::SiriusAdapterAlgorithm::cores_
int cores_
Definition: SiriusAdapterAlgorithm.h:159
OpenMS::SiriusAdapterAlgorithm::checkFeatureSpectraNumber
static void checkFeatureSpectraNumber(const String &featureinfo, const FeatureMapping::FeatureToMs2Indices &feature_mapping, const MSExperiment &spectra, const SiriusAdapterAlgorithm &sirius_algo)
logs number of features and spectra used
OpenMS::SiriusMzTabWriter::extract_scan_index
static int extract_scan_index(const String &path)
Extract scan_index from filepath.
OpenMS::DefaultParamHandler::setParameters
void setParameters(const Param &param)
Sets the parameters.
SiriusMzTabWriter.h
OpenMS::String::toQString
QString toQString() const
Conversion to Qt QString.
main
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:73
FeatureMapping.h
OpenMS::SiriusAdapterAlgorithm::precursor_mz_tolerance_
double precursor_mz_tolerance_
Definition: SiriusAdapterAlgorithm.h:141
EmpiricalFormula.h
OpenMS::SiriusAdapterAlgorithm::compound_timeout_
int compound_timeout_
Definition: SiriusAdapterAlgorithm.h:156
OpenMS::SiriusAdapterAlgorithm::top_n_hits_
int top_n_hits_
Definition: SiriusAdapterAlgorithm.h:158
OpenMS::FeatureMapping::FeatureToMs2Indices
Definition: FeatureMapping.h:48
OpenMS::SiriusAdapterAlgorithm::no_masstrace_info_isotope_pattern_
String no_masstrace_info_isotope_pattern_
Definition: SiriusAdapterAlgorithm.h:147
OpenMS::SiriusAdapterAlgorithm::feature_only_
String feature_only_
Definition: SiriusAdapterAlgorithm.h:146
OpenMS::SiriusAdapterAlgorithm::database_
String database_
Definition: SiriusAdapterAlgorithm.h:151
OpenMS::Param
Management and storage of parameters / INI files.
Definition: Param.h:73
OpenMS::SiriusAdapterAlgorithm::no_recalibration_
String no_recalibration_
Definition: SiriusAdapterAlgorithm.h:163
OPENMS_LOG_INFO
#define OPENMS_LOG_INFO
Macro if a information, e.g. a status should be reported.
Definition: LogStream.h:465
SiriusAdapterAlgorithm.h
OpenMS::SiriusMzTabWriter::read
static void read(const std::vector< String > &sirius_output_paths, const String &original_input_mzml, const Size &top_n_hits, MzTab &result)
Conversion of sirius output to mzTab.
OpenMS::Param::insert
void insert(const String &prefix, const Param &param)
OpenMS::SiriusAdapterAlgorithm::SiriusTemporaryFileSystemObjects::tmp_out_dir_
String tmp_out_dir_
Definition: SiriusAdapterAlgorithm.h:72
OpenMS::SiriusAdapterAlgorithm::candidates_
int candidates_
Definition: SiriusAdapterAlgorithm.h:150
OpenMS::KDTreeFeatureMaps
Stores a set of features, together with a 2D tree for fast search.
Definition: KDTreeFeatureMaps.h:49
File.h
OpenMS::ProgressLogger::setLogType
void setLogType(LogType type) const
Sets the progress log that should be used. The default type is NONE!
TOPPBase.h
OpenMS::SiriusAdapterAlgorithm::filter_by_num_masstraces_
unsigned int filter_by_num_masstraces_
Definition: SiriusAdapterAlgorithm.h:140
OpenMS::SiriusAdapterAlgorithm::SiriusTemporaryFileSystemObjects::tmp_ms_file_
String tmp_ms_file_
Definition: SiriusAdapterAlgorithm.h:71
OpenMS::SiriusAdapterAlgorithm::getFeatureOnly
String getFeatureOnly()