OpenMS
XTandemInfile.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Chris Bielow $
6 // $Authors: Andreas Bertsch, Chris Bielow $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
13 #include <OpenMS/FORMAT/XMLFile.h>
14 
15 namespace OpenMS
16 {
30  class OPENMS_DLLAPI XTandemInfile :
31  public Internal::XMLFile
32  {
33 public:
34 
36  enum ErrorUnit
37  {
38  DALTONS = 0,
39  PPM
40  };
41 
43  enum MassType
44  {
46  AVERAGE
47  };
48 
51 
53  ~XTandemInfile() override;
54 
56  void setFragmentMassTolerance(double tolerance);
57 
59  double getFragmentMassTolerance() const;
60 
63 
66 
69 
72 
74  void setPrecursorErrorType(MassType mono_isotopic);
75 
78 
81 
84 
87 
90 
92  void setNumberOfThreads(UInt threads);
93 
96 
99 
102 
104  void setOutputFilename(const String& output);
105 
107  const String& getOutputFilename() const;
108 
110  void setInputFilename(const String& input_file);
111 
113  const String& getInputFilename() const;
114 
116  void setTaxonomyFilename(const String& filename);
117 
119  const String& getTaxonomyFilename() const;
120 
122  void setDefaultParametersFilename(const String& filename);
123 
126 
128  void setTaxon(const String& taxon);
129 
131  const String& getTaxon() const;
132 
134  void setMaxPrecursorCharge(Int max_charge);
135 
138 
140  void setNumberOfMissedCleavages(UInt missed_cleavages);
141 
144 
146  void setOutputResults(const String& result);
147 
150 
152  void setMaxValidEValue(double value);
153 
155  double getMaxValidEValue() const;
156 
158  void setSemiCleavage(const bool semi_cleavage);
159 
161  void setAllowIsotopeError(const bool allow_isotope_error);
162 
164  bool getNoiseSuppression() const;
165 
167  void setNoiseSuppression(const bool noise_suppression);
168 
170  void setCleavageSite(const String& cleavage_site);
171 
173  const String& getCleavageSite() const;
174 
186  void write(const String& filename, bool ignore_member_parameters = false,
187  bool force_default_mods = false);
188 
189 protected:
190 
192 
194 
195  void writeTo_(std::ostream& os, bool ignore_member_parameters);
196 
197  void writeNote_(std::ostream& os, const String& label, const String& value);
198 
199  void writeNote_(std::ostream& os, const String& label, const char* value);
200 
201  void writeNote_(std::ostream& os, const String& label, bool value);
202 
216  String convertModificationSet_(const std::set<ModificationDefinition>& mods, std::map<String, double>& affected_origins) const;
217 
219 
221 
223 
225 
227 
229 
231 
233 
235 
237 
239 
241 
243 
245 
247 
249 
251 
253 
256 
258 
259  // scoring
261 
263 
264  // output parameters
266 
268 
269  // force writing of mods covered by special parameters?
271 
272  };
273 
274 } // namespace OpenMS
275 
Base class for loading/storing XML files that have a handler derived from XMLHandler.
Definition: XMLFile.h:23
Definition: ModificationDefinitionsSet.h:33
A more convenient string class.
Definition: String.h:34
XTandem input file.
Definition: XTandemInfile.h:32
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:244
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:37
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:257
MassType fragment_mass_type_
Definition: XTandemInfile.h:228
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:250
ErrorUnit precursor_mass_error_unit_
Definition: XTandemInfile.h:226
const ModificationDefinitionsSet & getModifications() const
returns the modifications set, using a modification definitions set
String cleavage_site_
Definition: XTandemInfile.h:252
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:260
UInt batch_size_
Definition: XTandemInfile.h:240
bool semi_cleavage_
semi cleavage
Definition: XTandemInfile.h:255
String output_results_
Definition: XTandemInfile.h:265
XTandemInfile()
constructor
double getPrecursorMassToleranceMinus() const
returns the precursor mass tolerance (minus only)
double fragment_lower_mz_
Definition: XTandemInfile.h:236
const String & getDefaultParametersFilename() const
returns the default parameters file
bool force_default_mods_
Definition: XTandemInfile.h:270
void setCleavageSite(const String &cleavage_site)
set the cleavage site with a X! Tandem conform regex
String output_filename_
Definition: XTandemInfile.h:246
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:242
void setOutputResults(const String &result)
sets the output result type ("all", "valid" or "stochastic")
void setInputFilename(const String &input_file)
sets the input filename
double precursor_mass_tolerance_minus_
Definition: XTandemInfile.h:222
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:248
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
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:220
MassType
Mass type of the precursor, either monoisotopic or average.
Definition: XTandemInfile.h:44
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:218
void setMaxPrecursorCharge(Int max_charge)
sets the max precursor charge
UInt max_precursor_charge_
Definition: XTandemInfile.h:232
~XTandemInfile() override
constructor
ErrorUnit fragment_mass_error_unit_
Definition: XTandemInfile.h:224
UInt number_of_threads_
Definition: XTandemInfile.h:238
void writeNote_(std::ostream &os, const String &label, const char *value)
MassType precursor_mass_type_
Definition: XTandemInfile.h:230
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:262
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:234
XTandemInfile(const XTandemInfile &rhs)
double max_valid_evalue_
Definition: XTandemInfile.h:267
int Int
Signed integer type.
Definition: Types.h:72
unsigned int UInt
Unsigned integer type.
Definition: Types.h:64
@ AVERAGE
Definition: MetaData.h:50
@ MONOISOTOPIC
Definition: MetaData.h:49
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
@ PPM
parts-per-million