OpenMS  2.8.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-2021.
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  {
72  AVERAGE
73  };
74 
77 
79  ~XTandemInfile() override;
80 
82  void setFragmentMassTolerance(double tolerance);
83 
85  double getFragmentMassTolerance() const;
86 
89 
92 
95 
98 
100  void setPrecursorErrorType(MassType mono_isotopic);
101 
104 
107 
110 
113 
116 
118  void setNumberOfThreads(UInt threads);
119 
122 
125 
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 
152 
154  void setTaxon(const String& taxon);
155 
157  const String& getTaxon() const;
158 
160  void setMaxPrecursorCharge(Int max_charge);
161 
164 
166  void setNumberOfMissedCleavages(UInt missed_cleavages);
167 
170 
172  void setOutputResults(String result);
173 
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 
218 
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 
Base class for loading/storing XML files that have a handler derived from XMLHandler.
Definition: XMLFile.h:49
Representation of a set of modification definitions.
Definition: ModificationDefinitionsSet.h:59
A more convenient string class.
Definition: String.h:60
XTandem input file.
Definition: XTandemInfile.h:58
void setNumberOfThreads(UInt threads)
sets the number of threads used during the identifications
String getOutputResults() const
returns the output result type ("all", "valid" or "stochastic")
String input_filename_
Definition: XTandemInfile.h:270
MassType getPrecursorErrorType() const
returns the precursor mass type
void setTaxonomyFilename(const String &filename)
set the filename of the taxonomy file
const String & getOutputFilename() const
returns the output filename
ErrorUnit
error unit, either Da or ppm
Definition: XTandemInfile.h:63
void write(const String &filename, bool ignore_member_parameters=false, bool force_default_mods=false)
Writes the X! Tandem input file to the given filename.
bool allow_isotope_error_
Definition: XTandemInfile.h:283
MassType fragment_mass_type_
Definition: XTandemInfile.h:254
void setNoiseSuppression(const bool noise_suppression)
set state of noise suppression
void setFragmentMassErrorUnit(ErrorUnit unit)
sets the fragment mass error unit (Da, ppm)
String taxon_
Definition: XTandemInfile.h:276
ErrorUnit precursor_mass_error_unit_
Definition: XTandemInfile.h:252
const ModificationDefinitionsSet & getModifications() const
returns the modifications set, using a modification definitions set
String cleavage_site_
Definition: XTandemInfile.h:278
void setTaxon(const String &taxon)
sets the taxon used in the taxonomy file
UInt getNumberOfMissedCleavages() const
returns the number of missed cleavages allowed
UInt number_of_missed_cleavages_
Definition: XTandemInfile.h:286
UInt batch_size_
Definition: XTandemInfile.h:266
bool semi_cleavage_
semi cleavage
Definition: XTandemInfile.h:281
String output_results_
Definition: XTandemInfile.h:291
XTandemInfile()
constructor
double getPrecursorMassToleranceMinus() const
returns the precursor mass tolerance (minus only)
double fragment_lower_mz_
Definition: XTandemInfile.h:262
const String & getDefaultParametersFilename() const
returns the default parameters file
bool force_default_mods_
Definition: XTandemInfile.h:296
void setCleavageSite(const String &cleavage_site)
set the cleavage site with a X! Tandem conform regex
String output_filename_
Definition: XTandemInfile.h:272
const String & getInputFilename() const
returns the input filename
void setPrecursorMassToleranceMinus(double tol)
set the precursor mass tolerance (minus only)
void setNumberOfMissedCleavages(UInt missed_cleavages)
sets the number of missed cleavages allowed
ModificationDefinitionsSet modifications_
Definition: XTandemInfile.h:268
void setInputFilename(const String &input_file)
sets the input filename
double precursor_mass_tolerance_minus_
Definition: XTandemInfile.h:248
void setMaxValidEValue(double value)
sets the max valid E-value allowed in the list
void writeTo_(std::ostream &os, bool ignore_member_parameters)
UInt getNumberOfThreads() const
returns the number of threads
double getMaxValidEValue() const
returns the max valid E-value allowed in the list
bool getNoiseSuppression() const
get state of noise suppression
Int getMaxPrecursorCharge() const
returns the max precursor charge
XTandemInfile & operator=(const XTandemInfile &rhs)
double getFragmentMassTolerance() const
returns the fragment mass tolerance
void setDefaultParametersFilename(const String &filename)
sets the default parameters file
void writeNote_(std::ostream &os, const String &label, bool value)
String taxonomy_file_
Definition: XTandemInfile.h:274
void setPrecursorErrorType(MassType mono_isotopic)
sets the precursor mass type
void setPrecursorMassErrorUnit(ErrorUnit unit)
sets the precursor mass error unit (Da, ppm)
void setAllowIsotopeError(const bool allow_isotope_error)
set if misassignment of precursor to first and second 13C isotopic peak should also be considered
void setOutputResults(String result)
sets the output result type ("all", "valid" or "stochastic")
const String & getCleavageSite() const
returns the cleavage site regex
double getPrecursorMassTolerancePlus() const
returns the precursor mass tolerance (plus only)
const String & getTaxon() const
returns the taxon used in the taxonomy file
void setModifications(const ModificationDefinitionsSet &mods)
sets the modifications using a modification definitions set
void setFragmentMassTolerance(double tolerance)
setter for the fragment mass tolerance
double precursor_mass_tolerance_plus_
Definition: XTandemInfile.h:246
MassType
Mass type of the precursor, either monoisotopic or average.
Definition: XTandemInfile.h:70
void setSemiCleavage(const bool semi_cleavage)
set state of semi cleavage
String convertModificationSet_(const std::set< ModificationDefinition > &mods, std::map< String, double > &affected_origins) const
Converts the given set of Modifications into a format compatible to X!Tandem.
void setOutputFilename(const String &output)
sets the output filename
double fragment_mass_tolerance_
Definition: XTandemInfile.h:244
void setMaxPrecursorCharge(Int max_charge)
sets the max precursor charge
UInt max_precursor_charge_
Definition: XTandemInfile.h:258
~XTandemInfile() override
constructor
ErrorUnit fragment_mass_error_unit_
Definition: XTandemInfile.h:250
UInt number_of_threads_
Definition: XTandemInfile.h:264
void writeNote_(std::ostream &os, const String &label, const char *value)
MassType precursor_mass_type_
Definition: XTandemInfile.h:256
void setPrecursorMassTolerancePlus(double tol)
sets the precursor mass tolerance (plus only)
void writeNote_(std::ostream &os, const String &label, const String &value)
const String & getTaxonomyFilename() const
returns the filename of the taxonomy file
String default_parameters_file_
Definition: XTandemInfile.h:288
ErrorUnit getPrecursorMassErrorUnit() const
returns the precursor mass error unit (Da, ppm)
ErrorUnit getFragmentMassErrorUnit() const
returns the fragment mass error unit (Da, ppm)
double precursor_lower_mz_
Definition: XTandemInfile.h:260
XTandemInfile(const XTandemInfile &rhs)
double max_valid_evalue_
Definition: XTandemInfile.h:293
int Int
Signed integer type.
Definition: Types.h:102
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
@ AVERAGE
Definition: MetaData.h:76
@ MONOISOTOPIC
Definition: MetaData.h:75
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47