OpenMS
Tagger.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Eugen Netz $
6 // $Authors: Timo Sachsenberg, Eugen Netz $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
12 #include <map>
13 
14 namespace OpenMS
15 {
16  class MSSpectrum;
17 
26  class OPENMS_DLLAPI Tagger
27  {
28  public:
43  Tagger(size_t min_tag_length, double ppm, size_t max_tag_length = 65535, size_t min_charge = 1, size_t max_charge = 1, const StringList& fixed_mods = StringList(), const StringList& var_mods = StringList());
44 
55  void getTag(const std::vector<double>& mzs, std::vector<std::string>& tags) const;
56 
67  void getTag(const MSSpectrum& spec, std::vector<std::string>& tags) const;
68 
77  void setMaxCharge(size_t max_charge);
78 
79  private:
80  double min_gap_;
81  double max_gap_;
82  double ppm_;
83  size_t min_tag_length_;
84  size_t max_tag_length_;
85  size_t min_charge_;
86  size_t max_charge_;
87  std::map<double, char> mass2aa_;
88 
90  char getAAByMass_(double m) const;
92  void getTag_(std::string& tag, const std::vector<double>& mzs, const size_t i, std::vector<std::string>& tags, const size_t charge) const;
93  };
94 }
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
Calculate sequence tags from m/z values.
Definition: Tagger.h:27
size_t min_tag_length_
minimum tag length
Definition: Tagger.h:83
double max_gap_
will be set to highest residue mass in ResidueDB
Definition: Tagger.h:81
void getTag(const std::vector< double > &mzs, std::vector< std::string > &tags) const
Generate tags from mass vector mzs.
size_t min_charge_
minimal fragment charge
Definition: Tagger.h:85
char getAAByMass_(double m) const
get a residue one letter code by matching the mass m to the map of residues mass2aa_,...
double min_gap_
will be set to smallest residue mass in ResidueDB
Definition: Tagger.h:80
void getTag(const MSSpectrum &spec, std::vector< std::string > &tags) const
Generate tags from an MSSpectrum.
void getTag_(std::string &tag, const std::vector< double > &mzs, const size_t i, std::vector< std::string > &tags, const size_t charge) const
start searching for tags starting from peak i of the mz vector mzs
void setMaxCharge(size_t max_charge)
Change the maximal charge considered by the tagger.
size_t max_charge_
maximal fragment charge
Definition: Tagger.h:86
Tagger(size_t min_tag_length, double ppm, size_t max_tag_length=65535, size_t min_charge=1, size_t max_charge=1, const StringList &fixed_mods=StringList(), const StringList &var_mods=StringList())
Constructor for Tagger.
size_t max_tag_length_
maximum tag length
Definition: Tagger.h:84
double ppm_
tolerance
Definition: Tagger.h:82
std::map< double, char > mass2aa_
mapping of residue masses to their one letter codes
Definition: Tagger.h:87
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:44
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19