| OpenMS 2.5.0

Public Member Functions | Private Member Functions | Private Attributes | List of all members
Tagger Class Reference

Calculate sequence tags from m/z values. More...

`#include <OpenMS/CHEMISTRY/Tagger.h>`

## Public Member Functions

| 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. More...
void | getTag (const std::vector< double > &mzs, std::vector< std::string > &tags) const
| Generate tags from mass vector `mzs`. More...
void | getTag (const MSSpectrum &spec, std::vector< std::string > &tags) const
| Generate tags from an MSSpectrum. More...
void | setMaxCharge (size_t max_charge)
| Change the maximal charge considered by the tagger. More...

## Private Member Functions

char | getAAByMass_ (double m) const
| get a residue one letter code by matching the mass `m` to the map of residues mass2aa_, returns ' ' if there is no match More...
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` More...

## Private Attributes

double | min_gap_
| will be set to smallest residue mass in ResidueDB More...
double | max_gap_
| will be set to highest residue mass in ResidueDB More...
double | ppm_
| tolerance More...
size_t | min_tag_length_
| minimum tag length More...
size_t | max_tag_length_
| maximum tag length More...
size_t | min_charge_
| minimal fragment charge More...
size_t | max_charge_
| maximal fragment charge More...
std::map< double, char > | mass2aa_
| mapping of residue masses to their one letter codes More...

## Detailed Description

Calculate sequence tags from m/z values.

Current restrictions and potential extensions:

- first prefix/suffix ion don't give rise to first character in tags (as currently ion types are not specified)
- gaps are not supported
- I/L are treated redundantly, all possible combinations are written out

## Constructor & Destructor Documentation

## ◆ Tagger()

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.

The parameter `max_charge_` should be >= `min_charge_`. Also `max_tag_length` should be >= `min_tag_length`.

Parameters

  min_tag_length | the minimal sequence tag length.
  ppm | the tolerance for matching residue masses to peak delta masses.
  max_tag_length | the maximal sequence tag length.
  min_charge | minimal fragment charge considered for each sequence tag.
  max_charge | maximal fragment charge considered for each sequence tag.
  fixed_mods | a list of modification names. The modified residues replace the unmodified versions.
  var_mods | a list of modification names. The modified residues are added as additional entries to the list of residues.

## Member Function Documentation

## ◆ getAAByMass_()

char getAAByMass_ | ( | double | m | ) | const

private

get a residue one letter code by matching the mass `m` to the map of residues mass2aa_, returns ' ' if there is no match

## ◆ getTag() [1/2]

void getTag | ( | const std::vector< double > & | mzs,
|  | std::vector< std::string > & | tags
| ) |  | const

Generate tags from mass vector `mzs`.

The parameter `tags` is filled with one string per sequence tag. It uses the standard residues from ResidueDB including the fixed and variable modificatins given to the constructor.

Parameters

  mzs | a vector of mz values, containing the mz values from a centroided fragment spectrum.
  tags | the vector of tags, that is filled with this function.

## ◆ getTag() [2/2]

void getTag | ( | const MSSpectrum & | spec,
|  | std::vector< std::string > & | tags
| ) |  | const

Generate tags from an MSSpectrum.

The parameter `tags` is filled with one string per sequence tag. It uses the standard residues from ResidueDB including the fixed and variable modificatins given to the constructor.

Parameters

  spec | a centroided fragment spectrum.
  tags | the vector of tags, that is filled with this function.

## ◆ getTag_()

void getTag_ | ( | std::string & | tag,
|  | const std::vector< double > & | mzs,
|  | const size_t | i,
|  | std::vector< std::string > & | tags,
|  | const size_t | charge
| ) |  | const

private

start searching for tags starting from peak `i` of the mz vector `mzs`

## ◆ setMaxCharge()

void setMaxCharge | ( | size_t | max_charge | ) |

Change the maximal charge considered by the tagger.

Allows to change the maximal considered charge e.g. based on a spectrums precursor charge without calling the constructor multiple times.

Parameters

  max_charge | the new maximal charge.

## Member Data Documentation

## ◆ mass2aa_

std::map<double, char> mass2aa_

private

mapping of residue masses to their one letter codes

## ◆ max_charge_

size_t max_charge_

private

maximal fragment charge

## ◆ max_gap_

double max_gap_

private

will be set to highest residue mass in ResidueDB

## ◆ max_tag_length_

size_t max_tag_length_

private

maximum tag length

## ◆ min_charge_

size_t min_charge_

private

minimal fragment charge

## ◆ min_gap_

double min_gap_

private

will be set to smallest residue mass in ResidueDB

## ◆ min_tag_length_

size_t min_tag_length_

private

minimum tag length

## ◆ ppm_

double ppm_

private

tolerance