OpenMS  3.0.0
CoarseIsotopePatternGenerator.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: Clemens Groepl, Andreas Bertsch, Chris Bielow $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
39 
40 #include <set>
41 
42 namespace OpenMS
43 {
103  class OPENMS_DLLAPI CoarseIsotopePatternGenerator
104  : public IsotopePatternGenerator
105  {
106 
107  public:
108  CoarseIsotopePatternGenerator(const Size max_isotope = 0, const bool round_masses = false);
109 
110  ~CoarseIsotopePatternGenerator() override;
111 
114 
120  void setMaxIsotope(const Size& max_isotope);
121 
123  void setRoundMasses(const bool round_masses);
124 
126  Size getMaxIsotope() const;
127 
129  bool getRoundMasses() const;
131 
139  IsotopeDistribution run(const EmpiricalFormula&) const override;
140 
147  IsotopeDistribution estimateFromPeptideWeight(double average_weight);
148 
158  IsotopeDistribution estimateFromPeptideWeightAndS(double average_weight, UInt S);
159 
179  static IsotopeDistribution approximateFromPeptideWeight(double mass, UInt num_peaks = 20, UInt charge = 1);
180 
191  static std::vector<double> approximateIntensities(double mass, UInt num_peaks = 20);
192 
199  IsotopeDistribution estimateFromRNAWeight(double average_weight);
200 
206  IsotopeDistribution estimateFromDNAWeight(double average_weight);
207 
213  IsotopeDistribution estimateFromWeightAndComp(double average_weight, double C, double H, double N, double O, double S, double P);
214 
229  IsotopeDistribution estimateFromWeightAndCompAndS(double average_weight, UInt S, double C, double H, double N, double O, double P);
230 
245  IsotopeDistribution estimateForFragmentFromPeptideWeight(double average_weight_precursor, double average_weight_fragment, const std::set<UInt>& precursor_isotopes);
246 
266  IsotopeDistribution estimateForFragmentFromPeptideWeightAndS(double average_weight_precursor, UInt S_precursor, double average_weight_fragment, UInt S_fragment, const std::set<UInt>& precursor_isotopes) const;
267 
282  IsotopeDistribution estimateForFragmentFromRNAWeight(double average_weight_precursor, double average_weight_fragment, const std::set<UInt>& precursor_isotopes);
283 
298  IsotopeDistribution estimateForFragmentFromDNAWeight(double average_weight_precursor, double average_weight_fragment, const std::set<UInt>& precursor_isotopes);
299 
321  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;
322 
341  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;
342 
344 
347 
348  protected:
349 
351  IsotopeDistribution::ContainerType convolvePow_(const IsotopeDistribution::ContainerType& input, Size factor) const;
352 
355 
357  IsotopeDistribution::ContainerType correctMass_(const IsotopeDistribution::ContainerType& input, const double mono_weight) const;
358 
365  IsotopeDistribution calcFragmentIsotopeDist_(const IsotopeDistribution::ContainerType& fragment_isotope_dist, const IsotopeDistribution::ContainerType& comp_fragment_isotope_dist, const std::set<UInt>& precursor_isotopes) const;
366 
369 
374 
375  };
376 
377 } // namespace OpenMS
OpenMS::IsotopeDistribution::ContainerType
std::vector< MassAbundance > ContainerType
Definition: IsotopeDistribution.h:72
ConsensusXMLFile.h
OpenMS::TOPPBase
Base class for TOPP applications.
Definition: TOPPBase.h:147
OpenMS::CoarseIsotopePatternGenerator::max_isotope_
Size max_isotope_
maximal isotopes which is used to calculate the distribution
Definition: CoarseIsotopePatternGenerator.h:371
Size
OpenMS::MasstraceCorrelator::scoreHullpoints
void scoreHullpoints(const MasstracePointsType &hull_points1, const MasstracePointsType &hull_points2, int &lag, double &lag_intensity, double &pearson_score, const double min_corr, const int max_lag, const double mindiff=0.1)
OpenMS::BaseFeature::getWidth
WidthType getWidth() const
Non-mutable access to the features width (full width at half max, FWHM)
OpenMS::CoarseIsotopePatternGenerator::round_masses_
bool round_masses_
flag to determine whether masses should be rounded or not
Definition: CoarseIsotopePatternGenerator.h:373
OpenMS::MSExperiment::sortSpectra
void sortSpectra(bool sort_mz=true)
Sorts the data points by retention time.
OpenMS::MasstraceCorrelator::createPseudoSpectra
void createPseudoSpectra(const ConsensusMap &map, MSExperiment &pseudo_spectra, Size min_peak_nr, double min_correlation, int max_lag, double max_rt_apex_difference)
OpenMS::MzMLFile::store
void store(const String &filename, const PeakMap &map) const
Stores a map in an MzML file.
OpenMS::Peak1D::setMZ
void setMZ(CoordinateType mz)
Mutable access to m/z.
Definition: Peak1D.h:119
OpenMS::MzMLFile
File adapter for MzML files.
Definition: MzMLFile.h:57
OpenMS::String
A more convenient string class.
Definition: String.h:58
MzMLFile.h
OpenMS::MSExperiment
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:70
OpenMS::CoarseIsotopePatternGenerator
Isotope pattern generator for coarse isotope distributions.
Definition: CoarseIsotopePatternGenerator.h:103
OpenMS::Size
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
OpenMS::Peak2D::getIntensity
IntensityType getIntensity() const
Definition: Peak2D.h:166
OpenMS::Peak1D::setIntensity
void setIntensity(IntensityType intensity)
Mutable access to the data point intensity (height)
Definition: Peak1D.h:110
OpenMS::MSExperiment::size
Size size() const
Definition: MSExperiment.h:120
OpenMS::ConsensusMap::sortByIntensity
void sortByIntensity(bool reverse=false)
Sorts the peaks according to ascending intensity.
OpenMS::Precursor
Precursor meta information.
Definition: Precursor.h:58
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
OpenMS::MSExperiment::addSpectrum
void addSpectrum(const MSSpectrum &spectrum)
adds a spectrum to the list
OpenMS::ProgressLogger
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:52
IsotopeDistribution.h
IsotopePatternGenerator.h
OpenMS::MasstraceCorrelator::createConsensusMapCache
void createConsensusMapCache(const ConsensusMap &map, std::vector< MasstracePointsType > &feature_points, std::vector< std::pair< double, double > > &max_intensities, std::vector< double > &rt_cache)
OpenMS::ConsensusFeature
A consensus feature spanning multiple LC-MS/MS experiments.
Definition: ConsensusFeature.h:69
MasstraceCorrelator.h
OpenMS::SpectrumSettings::setPrecursors
void setPrecursors(const std::vector< Precursor > &precursors)
sets the precursors
OpenMS::MSSpectrum::setMSLevel
void setMSLevel(UInt ms_level)
Sets the MS level.
OpenMS::Peak1D
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:53
OpenMS::ConsensusMap
A container for consensus elements.
Definition: ConsensusMap.h:82
OpenMS::Peak2D::getRT
CoordinateType getRT() const
Returns the RT coordinate (index 0)
Definition: Peak2D.h:208
OpenMS::ConsensusXMLFile::load
void load(const String &filename, ConsensusMap &map)
Loads a consensus map from file and calls updateRanges.
OpenMS::UInt
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
OpenMS::MSSpectrum::getFloatDataArrays
const FloatDataArrays & getFloatDataArrays() const
Returns a const reference to the float meta data arrays.
main
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:71
OpenMS::IsotopePatternGenerator
Provides an interface for different isotope pattern generator methods.
Definition: IsotopePatternGenerator.h:67
OpenMS::IsotopeDistribution
Definition: IsotopeDistribution.h:64
OpenMS::EmpiricalFormula
Representation of an empirical formula.
Definition: EmpiricalFormula.h:84
OpenMS::Peak2D::getMZ
CoordinateType getMZ() const
Returns the m/z coordinate (index 1)
Definition: Peak2D.h:196
OpenMS::MSSpectrum
The representation of a 1D spectrum.
Definition: MSSpectrum.h:66
OpenMS::MSSpectrum::setRT
void setRT(double rt)
Sets the absolute retention time (in seconds)
OpenMS::MasstraceCorrelator
Correlates individual masstraces found in mass spectrometric maps.
Definition: MasstraceCorrelator.h:53
OpenMS::Internal::ClassTest::infile
std::ifstream infile
Questionable file tested by TEST_FILE_EQUAL.
OpenMS::ProgressLogger::setLogType
void setLogType(LogType type) const
Sets the progress log that should be used. The default type is NONE!
TOPPBase.h
OpenMS::ConsensusXMLFile
This class provides Input functionality for ConsensusMaps and Output functionality for alignments and...
Definition: ConsensusXMLFile.h:58