OpenMS
Loading...
Searching...
No Matches
CoarseIsotopePatternGenerator.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: Clemens Groepl, Andreas Bertsch, Chris Bielow $
7// --------------------------------------------------------------------------
8
9#pragma once
10
13
14#include <map>
15#include <set>
16
17namespace OpenMS
18{
19 class Element;
81 {
82
83 public:
84 CoarseIsotopePatternGenerator(const Size max_isotope = 0, const bool round_masses = false);
85
87
90
96 void setMaxIsotope(const Size& max_isotope);
97
99 void setRoundMasses(const bool round_masses);
100
103
105 bool getRoundMasses() const;
106
118 void setIsotopeOverride(const Element* element, const IsotopeDistribution& isotopes);
119
122
124 const std::map<const Element*, IsotopeDistribution>& getIsotopeOverrides() const;
126
139 IsotopeDistribution run(const EmpiricalFormula& ef) const override;
140
148
157
158
169
190 static IsotopeDistribution approximateFromPeptideWeight(double mass, UInt num_peaks = 20, UInt charge = 1);
191
202 static std::vector<double> approximateIntensities(double mass, UInt num_peaks = 20);
203
211
219
220
227
233 IsotopeDistribution estimateFromWeightAndComp(double average_weight, double C, double H, double N, double O, double S, double P);
234
240 IsotopeDistribution estimateFromMonoWeightAndComp(double mono_weight, double C, double H, double N, double O, double S, double P);
241
242
257 IsotopeDistribution estimateFromWeightAndCompAndS(double average_weight, UInt S, double C, double H, double N, double O, double P);
258
273 IsotopeDistribution estimateForFragmentFromPeptideWeight(double average_weight_precursor, double average_weight_fragment, const std::set<UInt>& precursor_isotopes);
274
294 IsotopeDistribution estimateForFragmentFromPeptideWeightAndS(double average_weight_precursor, UInt S_precursor, double average_weight_fragment, UInt S_fragment, const std::set<UInt>& precursor_isotopes) const;
295
310 IsotopeDistribution estimateForFragmentFromRNAWeight(double average_weight_precursor, double average_weight_fragment, const std::set<UInt>& precursor_isotopes);
311
326 IsotopeDistribution estimateForFragmentFromDNAWeight(double average_weight_precursor, double average_weight_fragment, const std::set<UInt>& precursor_isotopes);
327
349 IsotopeDistribution estimateForFragmentFromWeightAndComp(double average_weight_precursor, double average_weight_fragment, const std::set<UInt>& precursor_isotopes, double C, double H, double N, double O, double S, double P) const;
350
369 IsotopeDistribution calcFragmentIsotopeDist(const IsotopeDistribution& fragment_isotope_dist, const IsotopeDistribution& comp_fragment_isotope_dist, const std::set<UInt>& precursor_isotopes, const double fragment_mono_mass) const;
370
372
375
376 protected:
377
380
383
386
393 IsotopeDistribution calcFragmentIsotopeDist_(const IsotopeDistribution::ContainerType& fragment_isotope_dist, const IsotopeDistribution::ContainerType& comp_fragment_isotope_dist, const std::set<UInt>& precursor_isotopes) const;
394
397
403 std::map<const Element*, IsotopeDistribution> isotope_overrides_;
404
405 };
406
407} // namespace OpenMS
Isotope pattern generator for coarse isotope distributions.
Definition CoarseIsotopePatternGenerator.h:81
IsotopeDistribution estimateForFragmentFromDNAWeight(double average_weight_precursor, double average_weight_fragment, const std::set< UInt > &precursor_isotopes)
Estimate DNA fragment IsotopeDistribution from the precursor's average weight, fragment's average wei...
IsotopeDistribution estimateFromPeptideWeightAndS(double average_weight, UInt S)
Estimate peptide IsotopeDistribution from average weight and exact number of sulfurs.
IsotopeDistribution calcFragmentIsotopeDist_(const IsotopeDistribution::ContainerType &fragment_isotope_dist, const IsotopeDistribution::ContainerType &comp_fragment_isotope_dist, const std::set< UInt > &precursor_isotopes) const
calculates the fragment distribution for a fragment molecule and stores it in result.
Size max_isotope_
maximal isotopes which is used to calculate the distribution
Definition CoarseIsotopePatternGenerator.h:399
Size getMaxIsotope() const
returns the currently set maximum isotope
IsotopeDistribution estimateFromRNAMonoWeight(double mono_weight)
Estimate Nucleotide Isotopedistribution from monoisotopic weight and number of isotopes that should b...
IsotopeDistribution estimateFromWeightAndComp(double average_weight, double C, double H, double N, double O, double S, double P)
Estimate Isotopedistribution from weight, average composition, and number of isotopes that should be ...
IsotopeDistribution estimateFromDNAWeight(double average_weight)
Estimate Nucleotide Isotopedistribution from weight and number of isotopes that should be reported av...
IsotopeDistribution estimateFromRNAWeight(double average_weight)
Estimate Nucleotide Isotopedistribution from weight and number of isotopes that should be reported.
IsotopeDistribution estimateFromWeightAndCompAndS(double average_weight, UInt S, double C, double H, double N, double O, double P)
Estimate IsotopeDistribution from weight, exact number of sulfurs, and average remaining composition.
static std::vector< double > approximateIntensities(double mass, UInt num_peaks=20)
roughly approximate intensity distribution of peptidic isotope patterns from monoisotopic weight usin...
std::map< const Element *, IsotopeDistribution > isotope_overrides_
per-element isotope distribution overrides applied in run() (empty = use ElementDB defaults)
Definition CoarseIsotopePatternGenerator.h:403
IsotopeDistribution estimateFromPeptideWeight(double average_weight)
Estimate Peptide Isotopedistribution from weight and number of isotopes that should be reported.
const std::map< const Element *, IsotopeDistribution > & getIsotopeOverrides() const
returns the currently registered per-element isotope overrides (may be empty)
static IsotopeDistribution approximateFromPeptideWeight(double mass, UInt num_peaks=20, UInt charge=1)
roughly approximate peptide IsotopeDistribution from monoisotopic weight using Poisson distribution....
IsotopeDistribution::ContainerType convolve(const IsotopeDistribution::ContainerType &left, const IsotopeDistribution::ContainerType &right) const
convolves the distributions left and right and stores the result in result
CoarseIsotopePatternGenerator & operator=(const CoarseIsotopePatternGenerator &iso)
bool getRoundMasses() const
returns the current value of the flag to return expected masses (true) or atomic numbers (false).
bool round_masses_
flag to determine whether masses should be rounded or not
Definition CoarseIsotopePatternGenerator.h:401
IsotopeDistribution estimateFromPeptideMonoWeight(double mono_weight)
Estimate Peptide Isotopedistribution from monoisotopic weight and number of isotopes that should be r...
void clearIsotopeOverrides()
removes all isotope overrides previously set via setIsotopeOverride()
IsotopeDistribution run(const EmpiricalFormula &ef) const override
Creates an isotope distribution from an empirical sum formula.
IsotopeDistribution::ContainerType convolvePow_(const IsotopeDistribution::ContainerType &input, Size factor) const
convolves the distribution input factor times and stores the result in result
void setMaxIsotope(const Size &max_isotope)
sets the maximal isotope with max_isotope
IsotopeDistribution::ContainerType correctMass_(const IsotopeDistribution::ContainerType &input, const double mono_weight) const
converts the masses of distribution input from atomic numbers to accurate masses (based on mass delta...
IsotopeDistribution estimateForFragmentFromWeightAndComp(double average_weight_precursor, double average_weight_fragment, const std::set< UInt > &precursor_isotopes, double C, double H, double N, double O, double S, double P) const
Estimate fragment IsotopeDistribution from the precursor's average weight, fragment's average weight,...
IsotopeDistribution estimateForFragmentFromRNAWeight(double average_weight_precursor, double average_weight_fragment, const std::set< UInt > &precursor_isotopes)
Estimate RNA fragment IsotopeDistribution from the precursor's average weight, fragment's average wei...
IsotopeDistribution estimateFromMonoWeightAndComp(double mono_weight, double C, double H, double N, double O, double S, double P)
Estimate Isotopedistribution from monoisotopic weight, average composition, and number of isotopes th...
IsotopeDistribution::ContainerType fillGaps_(const IsotopeDistribution::ContainerType &id) const
fill a gapped isotope pattern (i.e. certain masses are missing), with zero probability masses
IsotopeDistribution::ContainerType convolveSquare_(const IsotopeDistribution::ContainerType &input) const
convolves the distribution input with itself and stores the result in result
IsotopeDistribution calcFragmentIsotopeDist(const IsotopeDistribution &fragment_isotope_dist, const IsotopeDistribution &comp_fragment_isotope_dist, const std::set< UInt > &precursor_isotopes, const double fragment_mono_mass) const
Calculate isotopic distribution for a fragment molecule.
IsotopeDistribution estimateForFragmentFromPeptideWeight(double average_weight_precursor, double average_weight_fragment, const std::set< UInt > &precursor_isotopes)
Estimate peptide fragment IsotopeDistribution from the precursor's average weight,...
CoarseIsotopePatternGenerator(const Size max_isotope=0, const bool round_masses=false)
void setRoundMasses(const bool round_masses)
round masses to integer values (true) or return accurate masses (false)
void setIsotopeOverride(const Element *element, const IsotopeDistribution &isotopes)
Override the isotope distribution used for a specific element when computing patterns.
IsotopeDistribution estimateForFragmentFromPeptideWeightAndS(double average_weight_precursor, UInt S_precursor, double average_weight_fragment, UInt S_fragment, const std::set< UInt > &precursor_isotopes) const
Estimate peptide fragment IsotopeDistribution from the precursor's average weight,...
Representation of an element.
Definition Element.h:34
Representation of an empirical formula.
Definition EmpiricalFormula.h:62
Definition IsotopeDistribution.h:40
std::vector< MassAbundance > ContainerType
Definition IsotopeDistribution.h:47
Provides an interface for different isotope pattern generator methods.
Definition IsotopePatternGenerator.h:42
You can set more CMake variables adding< code > linking and adding include directories</td ></tr >< tr >< th valign="top"> CMAKE_PREFIX_PATH</td >< td > Additional search path for the contrib libraries[MacOSX only] If you want to use libraries installed via Homebrew or MacPorts you might need to provide the corresponding paths< code > e g< code > C
Definition common-cmake-parameters.doxygen:35
unsigned int UInt
Unsigned integer type.
Definition Types.h:64
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19