| OpenMS 2.5.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
37 #include <OpenMS/ANALYSIS/MAPMATCHING/FeatureMapping.h>
38 #include <OpenMS/DATASTRUCTURES/DefaultParamHandler.h>
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:
50 SiriusAdapterAlgorithm();
51
53 struct OPENMS_DLLAPI SiriusTemporaryFileSystemObjects
54 {
55 public:
56
58 SiriusTemporaryFileSystemObjects(int debug_level);
59
61 ~SiriusTemporaryFileSystemObjects();
62
63 const String& getTmpDir() const;
64 const String& getTmpOutDir() const;
65 const String& getTmpMsFile() const;
66
67 private:
68 int debug_level_;
69
70 String tmp_dir_;
71 String tmp_ms_file_;
72 String tmp_out_dir_;
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)
140 unsigned int filter_by_num_masstraces_;
141 double precursor_mz_tolerance_;
142 String precursor_mz_tolerance_unit_;
143 double precursor_rt_tolerance_;
144 int isotope_pattern_iterations_;
145 // flags
146 String feature_only_;
147 String no_masstrace_info_isotope_pattern_;
148 // parameters for SIRIUS (sirius)
149 String profile_;
150 int candidates_;
151 String database_;
152 int noise_;
153 int ppm_max_;
154 String isotope_;
155 String elements_;
156 int compound_timeout_;
157 int tree_timeout_;
158 int top_n_hits_;
159 int cores_;
160 // flags
161 String auto_charge_;
162 String ion_tree_;
163 String no_recalibration_;
164 String most_intense_ms2_;
165
166 void updateMembers_() override;
167 };
168 } // namespace OpenMS
OpenMS::String
A more convenient string class.
Definition: String.h:58
OpenMS::SiriusAdapterAlgorithm::feature_only_
String feature_only_
Definition: SiriusAdapterAlgorithm.h:146
OpenMS::SiriusAdapterAlgorithm::cores_
int cores_
Definition: SiriusAdapterAlgorithm.h:159
OpenMS::DefaultParamHandler
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:91
OpenMS::SiriusAdapterAlgorithm::noise_
int noise_
Definition: SiriusAdapterAlgorithm.h:152
OpenMS::SiriusAdapterAlgorithm::isotope_pattern_iterations_
int isotope_pattern_iterations_
Definition: SiriusAdapterAlgorithm.h:144
OpenMS::MSExperiment
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
OpenMS::SiriusAdapterAlgorithm::auto_charge_
String auto_charge_
Definition: SiriusAdapterAlgorithm.h:161
OpenMS::SiriusAdapterAlgorithm::precursor_mz_tolerance_
double precursor_mz_tolerance_
Definition: SiriusAdapterAlgorithm.h:141
OpenMS::SiriusAdapterAlgorithm::tree_timeout_
int tree_timeout_
Definition: SiriusAdapterAlgorithm.h:157
OpenMS::SiriusAdapterAlgorithm::most_intense_ms2_
String most_intense_ms2_
Definition: SiriusAdapterAlgorithm.h:164
OpenMS::KDTreeFeatureMaps
Stores a set of features, together with a 2D tree for fast search.
Definition: KDTreeFeatureMaps.h:49
OpenMS::SiriusAdapterAlgorithm::database_
String database_
Definition: SiriusAdapterAlgorithm.h:151
OpenMS::SiriusAdapterAlgorithm::candidates_
int candidates_
Definition: SiriusAdapterAlgorithm.h:150
OpenMS::SiriusAdapterAlgorithm
Definition: SiriusAdapterAlgorithm.h:46
OpenMS::SiriusAdapterAlgorithm::filter_by_num_masstraces_
unsigned int filter_by_num_masstraces_
Definition: SiriusAdapterAlgorithm.h:140
OpenMS::SiriusAdapterAlgorithm::no_masstrace_info_isotope_pattern_
String no_masstrace_info_isotope_pattern_
Definition: SiriusAdapterAlgorithm.h:147
OpenMS::SiriusAdapterAlgorithm::SiriusTemporaryFileSystemObjects::debug_level_
int debug_level_
Definition: SiriusAdapterAlgorithm.h:68
OpenMS::SiriusAdapterAlgorithm::profile_
String profile_
Definition: SiriusAdapterAlgorithm.h:149
OpenMS::SiriusAdapterAlgorithm::precursor_rt_tolerance_
double precursor_rt_tolerance_
Definition: SiriusAdapterAlgorithm.h:143
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::SiriusAdapterAlgorithm::SiriusTemporaryFileSystemObjects::tmp_out_dir_
String tmp_out_dir_
Definition: SiriusAdapterAlgorithm.h:72
FeatureMapping.h
DefaultParamHandler.h
OpenMS::SiriusAdapterAlgorithm::elements_
String elements_
Definition: SiriusAdapterAlgorithm.h:155
OpenMS::SiriusAdapterAlgorithm::SiriusTemporaryFileSystemObjects::tmp_dir_
String tmp_dir_
Definition: SiriusAdapterAlgorithm.h:70
OpenMS::SiriusAdapterAlgorithm::ppm_max_
int ppm_max_
Definition: SiriusAdapterAlgorithm.h:153
OpenMS::SiriusAdapterAlgorithm::compound_timeout_
int compound_timeout_
Definition: SiriusAdapterAlgorithm.h:156
OpenMS::SiriusAdapterAlgorithm::SiriusTemporaryFileSystemObjects::tmp_ms_file_
String tmp_ms_file_
Definition: SiriusAdapterAlgorithm.h:71
OpenMS::SiriusAdapterAlgorithm::top_n_hits_
int top_n_hits_
Definition: SiriusAdapterAlgorithm.h:158
OpenMS::SiriusAdapterAlgorithm::SiriusTemporaryFileSystemObjects
Struct for temporary folder structure.
Definition: SiriusAdapterAlgorithm.h:53
OpenMS::SiriusAdapterAlgorithm::isotope_
String isotope_
Definition: SiriusAdapterAlgorithm.h:154
OpenMS::SiriusAdapterAlgorithm::no_recalibration_
String no_recalibration_
Definition: SiriusAdapterAlgorithm.h:163
OpenMS::FeatureMapping::FeatureToMs2Indices
Definition: FeatureMapping.h:48
OpenMS::SiriusAdapterAlgorithm::ion_tree_
String ion_tree_
Definition: SiriusAdapterAlgorithm.h:162
OpenMS::SiriusAdapterAlgorithm::precursor_mz_tolerance_unit_
String precursor_mz_tolerance_unit_
Definition: SiriusAdapterAlgorithm.h:142