OpenMS
Loading...
Searching...
No Matches
Tagger.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: Eugen Netz $
6// $Authors: Timo Sachsenberg, Eugen Netz $
7// --------------------------------------------------------------------------
8
9#pragma once
10
12#include <map>
13
14namespace OpenMS
15{
16 class MSSpectrum;
17
26 class OPENMS_DLLAPI Tagger
27 {
28 public:
44 Tagger(size_t min_tag_length, double tolerance, 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(), bool tol_is_ppm = true);
45
56 void getTag(const std::vector<double>& mzs, std::vector<std::string>& tags) const;
57
68 void getTag(const MSSpectrum& spec, std::vector<std::string>& tags) const;
69
78 void setMaxCharge(size_t max_charge);
79
80
81 private:
82 double min_gap_;
83 double max_gap_;
84 double tolerance_;
88 size_t min_charge_;
89 size_t max_charge_;
90 std::map<double, char> mass2aa_;
91
93 char getAAByMass_(double m) const;
94
96 void getTag_(std::string& tag, const std::vector<double>& mzs, const size_t i, std::vector<std::string>& tags, const size_t charge) const;
97 };
98}
99
The representation of a 1D spectrum.
Definition MSSpectrum.h:44
Calculate sequence tags from m/z values.
Definition Tagger.h:27
Tagger(size_t min_tag_length, double tolerance, 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(), bool tol_is_ppm=true)
Constructor for Tagger.
bool tol_is_ppm_
is the tolerance in ppm
Definition Tagger.h:85
size_t min_tag_length_
minimum tag length
Definition Tagger.h:86
double max_gap_
will be set to highest residue mass in ResidueDB
Definition Tagger.h:83
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:88
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:82
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
double tolerance_
tolerance
Definition Tagger.h:84
void setMaxCharge(size_t max_charge)
Change the maximal charge considered by the tagger.
size_t max_charge_
maximal fragment charge
Definition Tagger.h:89
size_t max_tag_length_
maximum tag length
Definition Tagger.h:87
std::map< double, char > mass2aa_
mapping of residue masses to their one letter codes
Definition Tagger.h:90
std::vector< String > StringList
Vector of String.
Definition ListUtils.h:44
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19