OpenMS  3.0.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-2022.
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  {
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 
OpenMS::XTandemInfile
XTandem input file.
Definition: XTandemInfile.h:56
DefaultParamHandler.h
OpenMS::XTandemInfile::semi_cleavage_
bool semi_cleavage_
semi cleavage
Definition: XTandemInfile.h:281
OpenMS::File::rename
static bool rename(const String &from, const String &to, bool overwrite_existing=true, bool verbose=true)
Rename a file.
OpenMS::ProteinIdentification::SearchParameters::digestion_enzyme
Protease digestion_enzyme
The cleavage site information in details (from ProteaseDB)
Definition: ProteinIdentification.h:273
OpenMS::XTandemXMLFile::load
void load(const String &filename, ProteinIdentification &protein_identification, std::vector< PeptideIdentification > &id_data, ModificationDefinitionsSet &mod_def_set)
loads data from an X! Tandem XML file
OpenMS::IdentificationDataInternal::MassType
MassType
Definition: MetaData.h:73
FileHandler.h
XMLFile.h
Size
OpenMS::XTandemInfile::modifications_
ModificationDefinitionsSet modifications_
Definition: XTandemInfile.h:268
OpenMS::IdXMLFile::store
void store(const String &filename, const std::vector< ProteinIdentification > &protein_ids, const std::vector< PeptideIdentification > &peptide_ids, const String &document_id="")
Stores the data in an idXML file.
OpenMS::XTandemInfile::fragment_lower_mz_
double fragment_lower_mz_
Definition: XTandemInfile.h:262
OpenMS::DigestionEnzymeDB::getInstance
static InstanceType * getInstance()
this member function serves as a replacement of the constructor
Definition: DigestionEnzymeDB.h:69
OpenMS::XTandemInfile::number_of_threads_
UInt number_of_threads_
Definition: XTandemInfile.h:264
OpenMS::ModificationDefinitionsSet
Representation of a set of modification definitions.
Definition: ModificationDefinitionsSet.h:58
OpenMS::ProteinIdentification::PeakMassType
PeakMassType
Peak mass type.
Definition: ProteinIdentification.h:247
OpenMS::ProteinIdentification::setSearchEngineVersion
void setSearchEngineVersion(const String &search_engine_version)
Sets the search engine version.
OpenMS::ProteinIdentification::SearchParameters::missed_cleavages
UInt missed_cleavages
The number of allowed missed cleavages.
Definition: ProteinIdentification.h:268
OpenMS::XTandemInfile::precursor_mass_tolerance_minus_
double precursor_mass_tolerance_minus_
Definition: XTandemInfile.h:248
OpenMS::MzMLFile
File adapter for MzML files.
Definition: MzMLFile.h:57
OpenMS::String
A more convenient string class.
Definition: String.h:58
MzMLFile.h
Int
OpenMS::XTandemInfile::force_default_mods_
bool force_default_mods_
Definition: XTandemInfile.h:296
OpenMS::MSExperiment
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:70
SearchEngineBase.h
OpenMS::PeakFileOptions::addMSLevel
void addMSLevel(int level)
adds a desired MS level for peaks to load
IdXMLFile.h
OpenMS::XTandemInfile::max_precursor_charge_
UInt max_precursor_charge_
Definition: XTandemInfile.h:258
OpenMS::ProteinIdentification::MONOISOTOPIC
Definition: ProteinIdentification.h:249
OpenMS::XTandemInfile::PPM
Definition: XTandemInfile.h:65
XTandemXMLFile.h
OpenMS::XTandemInfile::taxonomy_file_
String taxonomy_file_
Definition: XTandemInfile.h:274
OpenMS::XTandemInfile::precursor_mass_error_unit_
ErrorUnit precursor_mass_error_unit_
Definition: XTandemInfile.h:252
OpenMS::ProteinIdentification
Representation of a protein identification run.
Definition: ProteinIdentification.h:70
OpenMS::MSExperiment::size
Size size() const
Definition: MSExperiment.h:120
OpenMS::ProteinIdentification::SearchParameters::fragment_mass_tolerance_ppm
bool fragment_mass_tolerance_ppm
Mass tolerance unit of fragment ions (true: ppm, false: Dalton)
Definition: ProteinIdentification.h:270
OpenMS::File::find
static String find(const String &filename, StringList directories=StringList())
Looks up the location of the file filename.
OpenMS::XTandemInfile::ErrorUnit
ErrorUnit
error unit, either Da or ppm
Definition: XTandemInfile.h:62
OpenMS::ModificationsDB::getInstance
static ModificationsDB * getInstance()
Returns a pointer to the modifications DB (singleton)
OpenMS::Int
int Int
Signed integer type.
Definition: Types.h:102
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
OpenMS::ProteinIdentification::SearchParameters::variable_modifications
std::vector< String > variable_modifications
Allowed variable modifications.
Definition: ProteinIdentification.h:267
OpenMS::ProteinIdentification::SearchParameters::mass_type
PeakMassType mass_type
Mass type of the peaks.
Definition: ProteinIdentification.h:265
ProteaseDB.h
OpenMS::ProteinIdentification::setPrimaryMSRunPath
void setPrimaryMSRunPath(const StringList &s, bool raw=false)
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::SpectrumLookup::findByNativeID
Size findByNativeID(const String &native_id) const
Look up spectrum by native ID.
OpenMS::ProteinIdentification::SearchParameters::db
String db
The used database.
Definition: ProteinIdentification.h:261
OpenMS::XTandemInfile::precursor_mass_tolerance_plus_
double precursor_mass_tolerance_plus_
Definition: XTandemInfile.h:246
OpenMS::SpectrumLookup
Helper class for looking up spectra based on different attributes.
Definition: SpectrumLookup.h:67
ModificationDefinitionsSet.h
OpenMS::XTandemInfile::DALTONS
Definition: XTandemInfile.h:64
OpenMS::XTandemInfile::output_results_
String output_results_
Definition: XTandemInfile.h:291
OpenMS::SpectrumLookup::readSpectra
void readSpectra(const SpectrumContainer &spectra, const String &scan_regexp=default_scan_regexp)
Read and index spectra for later look-up.
Definition: SpectrumLookup.h:103
SpectrumLookup.h
OpenMS::XTandemInfile::MassType
MassType
Mass type of the precursor, either monoisotopic or average.
Definition: XTandemInfile.h:69
OpenMS::String::toQString
QString toQString() const
Conversion to Qt QString.
OpenMS::XTandemInfile::fragment_mass_tolerance_
double fragment_mass_tolerance_
Definition: XTandemInfile.h:244
OpenMS::ProteinIdentification::setSearchParameters
void setSearchParameters(const SearchParameters &search_parameters)
Sets the search parameters.
OpenMS::PeakFileOptions::setFillData
void setFillData(bool only)
sets whether to fill the actual data into the container (spectrum/chromatogram)
OpenMS::ProteinIdentification::SearchParameters::fragment_mass_tolerance
double fragment_mass_tolerance
Mass tolerance of fragment ions (Dalton or ppm)
Definition: ProteinIdentification.h:269
OpenMS::XTandemInfile::precursor_lower_mz_
double precursor_lower_mz_
Definition: XTandemInfile.h:260
OpenMS::XTandemInfile::cleavage_site_
String cleavage_site_
Definition: XTandemInfile.h:278
OpenMS::XTandemInfile::fragment_mass_error_unit_
ErrorUnit fragment_mass_error_unit_
Definition: XTandemInfile.h:250
OpenMS::UInt
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
OpenMS::XTandemInfile::precursor_mass_type_
MassType precursor_mass_type_
Definition: XTandemInfile.h:256
OpenMS::SearchEngineBase
Base class for Search Engine Adapters.
Definition: SearchEngineBase.h:54
OpenMS::ProteinIdentification::getSearchParameters
const SearchParameters & getSearchParameters() const
Returns the search parameters.
OpenMS::ProteinIdentification::SearchParameters::fixed_modifications
std::vector< String > fixed_modifications
Used fixed modifications.
Definition: ProteinIdentification.h:266
ModificationsDB.h
OpenMS::XTandemInfile::max_valid_evalue_
double max_valid_evalue_
Definition: XTandemInfile.h:293
main
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:71
OpenMS::ProteinIdentification::setSearchEngine
void setSearchEngine(const String &search_engine)
Sets the search engine type.
MSExperiment.h
OpenMS::ProteinIdentification::SearchParameters::precursor_mass_tolerance
double precursor_mass_tolerance
Mass tolerance of precursor ions (Dalton or ppm)
Definition: ProteinIdentification.h:271
OPENMS_LOG_ERROR
#define OPENMS_LOG_ERROR
Macro to be used if non-fatal error are reported (processing continues)
Definition: LogStream.h:455
OpenMS::File::TempDir
Class representing a temporary directory.
Definition: File.h:64
OpenMS::PeptideIdentification
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:63
OpenMS::XTandemInfile::input_filename_
String input_filename_
Definition: XTandemInfile.h:270
OpenMS::XTandemInfile::taxon_
String taxon_
Definition: XTandemInfile.h:276
OpenMS::PeptideIndexing
Refreshes the protein references for all peptide hits in a vector of PeptideIdentifications and adds ...
Definition: PeptideIndexing.h:113
OpenMS::XTandemInfile::output_filename_
String output_filename_
Definition: XTandemInfile.h:272
OpenMS::Internal::XMLFile
Base class for loading/storing XML files that have a handler derived from XMLHandler.
Definition: XMLFile.h:48
OpenMS::IdentificationDataInternal::MONOISOTOPIC
Definition: MetaData.h:75
OpenMS::TOPPBase::ExitCodes
ExitCodes
Exit codes.
Definition: TOPPBase.h:152
PeptideIndexing.h
String.h
OpenMS::IdentificationDataInternal::AVERAGE
Definition: MetaData.h:76
OpenMS::XTandemXMLFile
Used to load XTandemXML files.
Definition: XTandemXMLFile.h:56
OpenMS::ModificationsDB::getAllSearchModifications
void getAllSearchModifications(std::vector< String > &modifications) const
Collects all modifications that can be used for identification searches.
OpenMS::ProteinIdentification::SearchParameters::precursor_mass_tolerance_ppm
bool precursor_mass_tolerance_ppm
Mass tolerance unit of precursor ions (true: ppm, false: Dalton)
Definition: ProteinIdentification.h:272
OpenMS::XTandemInfile::number_of_missed_cleavages_
UInt number_of_missed_cleavages_
Definition: XTandemInfile.h:286
OPENMS_LOG_INFO
#define OPENMS_LOG_INFO
Macro if a information, e.g. a status should be reported.
Definition: LogStream.h:465
OpenMS::XTandemInfile::fragment_mass_type_
MassType fragment_mass_type_
Definition: XTandemInfile.h:254
OpenMS::ProteinIdentification::SearchParameters
Search parameters of the DB search.
Definition: ProteinIdentification.h:258
OpenMS::DefaultParamHandler::writeParametersToMetaValues
static void writeParametersToMetaValues(const Param &write_this, MetaInfoInterface &write_here, const String &key_prefix="")
Writes all parameters to meta values.
File.h
OpenMS::Internal::ClassTest::infile
std::ifstream infile
Questionable file tested by TEST_FILE_EQUAL.
XTandemInfile.h
OpenMS::XTandemInfile::default_parameters_file_
String default_parameters_file_
Definition: XTandemInfile.h:288
OpenMS::MzMLFile::getOptions
PeakFileOptions & getOptions()
Mutable access to the options for loading/storing.
OpenMS::ProgressLogger::setLogType
void setLogType(LogType type) const
Sets the progress log that should be used. The default type is NONE!
OpenMS::XTandemInfile::batch_size_
UInt batch_size_
Definition: XTandemInfile.h:266
OpenMS::IdXMLFile
Used to load and store idXML files.
Definition: IdXMLFile.h:68
OpenMS::XTandemInfile::allow_isotope_error_
bool allow_isotope_error_
Definition: XTandemInfile.h:283