OpenMS  2.4.0
XTandemInfile.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-2018.
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: Chris Bielow $
32 // $Authors: Andreas Bertsch, Chris Bielow $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
39 #include <OpenMS/FORMAT/XMLFile.h>
40 
41 namespace OpenMS
42 {
56  class OPENMS_DLLAPI XTandemInfile :
57  public Internal::XMLFile
58  {
59 public:
60 
62  enum ErrorUnit
63  {
64  DALTONS = 0,
65  PPM
66  };
67 
69  enum MassType
70  {
71  MONOISOTOPIC = 0,
72  AVERAGE
73  };
74 
76  XTandemInfile();
77 
79  ~XTandemInfile() override;
80 
82  void setFragmentMassTolerance(double tolerance);
83 
85  double getFragmentMassTolerance() const;
86 
88  void setPrecursorMassTolerancePlus(double tol);
89 
91  double getPrecursorMassTolerancePlus() const;
92 
94  void setPrecursorMassToleranceMinus(double tol);
95 
97  double getPrecursorMassToleranceMinus() const;
98 
100  void setPrecursorErrorType(MassType mono_isotopic);
101 
103  MassType getPrecursorErrorType() const;
104 
106  void setFragmentMassErrorUnit(ErrorUnit unit);
107 
109  ErrorUnit getFragmentMassErrorUnit() const;
110 
112  void setPrecursorMassErrorUnit(ErrorUnit unit);
113 
115  ErrorUnit getPrecursorMassErrorUnit() const;
116 
118  void setNumberOfThreads(UInt threads);
119 
121  UInt getNumberOfThreads() const;
122 
124  void setModifications(const ModificationDefinitionsSet& mods);
125 
127  const ModificationDefinitionsSet& getModifications() const;
128 
130  void setOutputFilename(const String& output);
131 
133  const String& getOutputFilename() const;
134 
136  void setInputFilename(const String& input_file);
137 
139  const String& getInputFilename() const;
140 
142  void setTaxonomyFilename(const String& filename);
143 
145  const String& getTaxonomyFilename() const;
146 
148  void setDefaultParametersFilename(const String& filename);
149 
151  const String& getDefaultParametersFilename() const;
152 
154  void setTaxon(const String& taxon);
155 
157  const String& getTaxon() const;
158 
160  void setMaxPrecursorCharge(Int max_charge);
161 
163  Int getMaxPrecursorCharge() const;
164 
166  void setNumberOfMissedCleavages(UInt missed_cleavages);
167 
169  UInt getNumberOfMissedCleavages() const;
170 
172  void setOutputResults(String result);
173 
175  String getOutputResults() const;
176 
178  void setMaxValidEValue(double value);
179 
181  double getMaxValidEValue() const;
182 
184  void setSemiCleavage(const bool semi_cleavage);
185 
187  void setAllowIsotopeError(const bool allow_isotope_error);
188 
190  bool getNoiseSuppression() const;
191 
193  void setNoiseSuppression(const bool noise_suppression);
194 
196  void setCleavageSite(const String& cleavage_site);
197 
199  const String& getCleavageSite() const;
200 
212  void write(const String& filename, bool ignore_member_parameters = false,
213  bool force_default_mods = false);
214 
215 protected:
216 
217  XTandemInfile(const XTandemInfile& rhs);
218 
219  XTandemInfile& operator=(const XTandemInfile& rhs);
220 
221  void writeTo_(std::ostream& os, bool ignore_member_parameters);
222 
223  void writeNote_(std::ostream& os, const String& label, const String& value);
224 
225  void writeNote_(std::ostream& os, const String& label, const char* value);
226 
227  void writeNote_(std::ostream& os, const String& label, bool value);
228 
242  String convertModificationSet_(const std::set<ModificationDefinition>& mods, std::map<String, double>& affected_origins) const;
243 
245 
247 
249 
251 
253 
255 
257 
259 
261 
263 
265 
267 
269 
271 
273 
275 
277 
279 
282 
284 
285  // scoring
287 
289 
290  // output parameters
292 
294 
295  // force writing of mods covered by special parameters?
297 
298  };
299 
300 } // namespace OpenMS
301 
MassType fragment_mass_type_
Definition: XTandemInfile.h:254
bool force_default_mods_
Definition: XTandemInfile.h:296
A more convenient string class.
Definition: String.h:57
UInt max_precursor_charge_
Definition: XTandemInfile.h:258
XTandem input file.
Definition: XTandemInfile.h:56
ErrorUnit
error unit, either Da or ppm
Definition: XTandemInfile.h:62
UInt batch_size_
Definition: XTandemInfile.h:266
ErrorUnit precursor_mass_error_unit_
Definition: XTandemInfile.h:252
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
String default_parameters_file_
Definition: XTandemInfile.h:288
bool allow_isotope_error_
Definition: XTandemInfile.h:283
UInt number_of_threads_
Definition: XTandemInfile.h:264
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
ErrorUnit fragment_mass_error_unit_
Definition: XTandemInfile.h:250
MassType
Mass type of the precursor, either monoisotopic or average.
Definition: XTandemInfile.h:69
String input_filename_
Definition: XTandemInfile.h:270
MassType precursor_mass_type_
Definition: XTandemInfile.h:256
String taxonomy_file_
Definition: XTandemInfile.h:274
Representation of a set of modification definitions.
Definition: ModificationDefinitionsSet.h:58
UInt number_of_missed_cleavages_
Definition: XTandemInfile.h:286
String output_filename_
Definition: XTandemInfile.h:272
double precursor_mass_tolerance_plus_
Definition: XTandemInfile.h:246
double fragment_mass_tolerance_
Definition: XTandemInfile.h:244
String output_results_
Definition: XTandemInfile.h:291
double precursor_lower_mz_
Definition: XTandemInfile.h:260
String cleavage_site_
Definition: XTandemInfile.h:278
Base class for loading/storing XML files that have a handler derived from XMLHandler.
Definition: XMLFile.h:48
bool semi_cleavage_
semi cleavage
Definition: XTandemInfile.h:281
String taxon_
Definition: XTandemInfile.h:276
double max_valid_evalue_
Definition: XTandemInfile.h:293
int Int
Signed integer type.
Definition: Types.h:102
ModificationDefinitionsSet modifications_
Definition: XTandemInfile.h:268
double precursor_mass_tolerance_minus_
Definition: XTandemInfile.h:248
double fragment_lower_mz_
Definition: XTandemInfile.h:262