OpenMS
TheoreticalSpectrumGenerator.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: Timo Sachsenberg, Eugen Netz $
6 // $Authors: Andreas Bertsch $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
16 
17 namespace OpenMS
18 {
19  class AASequence;
20 
43  class OPENMS_DLLAPI TheoreticalSpectrumGenerator :
44  public DefaultParamHandler
45  {
46  public:
47 
53 
56 
60 
63 
64 
71  void getPrefixAndSuffixIonsMZ(std::vector<float>& spectrum, const AASequence& peptide, int charge) const;
72 
79  virtual void getSpectrum(PeakSpectrum& spec, const AASequence& peptide, Int min_charge, Int max_charge, Int precursor_charge = 0) const;
80 
86  static MSSpectrum generateSpectrum(const Precursor::ActivationMethod& fm, const AASequence& seq, int precursor_charge);
87 
88 
90  void updateMembers_() override;
92 
93  protected:
94 
96  virtual void addPeaks_(PeakSpectrum& spectrum, const AASequence& peptide, DataArrays::StringDataArray& ion_names, DataArrays::IntegerDataArray& charges, MSSpectrum::Chunks& chunks, const Residue::ResidueType res_type, Int charge = 1) const;
97 
99  virtual void addPrecursorPeaks_(PeakSpectrum& spec, const AASequence& peptide, DataArrays::StringDataArray& ion_names, DataArrays::IntegerDataArray& charges, Int charge = 1) const;
100 
103 
105  void addIsotopeCluster_(PeakSpectrum& spectrum, const AASequence& ion, DataArrays::StringDataArray& ion_names, DataArrays::IntegerDataArray& charges, const Residue::ResidueType res_type, Int charge, double intensity) const;
106 
108  void addLosses_(PeakSpectrum& spectrum, const AASequence& ion, DataArrays::StringDataArray& ion_names, DataArrays::IntegerDataArray& charges, double intensity, const Residue::ResidueType res_type, int charge) const;
109 
111  void addLossesFaster_(PeakSpectrum& spectrum, double mz, const std::set<EmpiricalFormula>& f_losses, int ion_ordinal, DataArrays::StringDataArray& ion_names, DataArrays::IntegerDataArray& charges, const std::map<EmpiricalFormula, String>& formula_str_cache, double intensity, const String& annotation_prefix_string, bool add_metainfo, int charge) const;
112 
114  static void addPrefixAndSuffixIons_(std::vector<float>& spectrum, const AASequence& peptide, Residue::ResidueType res_type, int charge);
116  const AASequence& peptide,
117  DataArrays::StringDataArray& ion_names,
119  MSSpectrum::Chunks& chunks,
120  const Residue::ResidueType res_type,
121  Int charge) const;
141  double a_intensity_;
142  double b_intensity_;
143  double c_intensity_;
144  double x_intensity_;
145  double y_intensity_;
146  double z_intensity_;
147 
151  double pre_int_;
152  double pre_int_H2O_;
153  double pre_int_NH3_;
154  };
155 }
Representation of a peptide/protein sequence.
Definition: AASequence.h:86
Integer data array class.
Definition: DataArrays.h:75
String data array class.
Definition: DataArrays.h:125
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:66
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
ActivationMethod
Method of activation.
Definition: Precursor.h:59
ResidueType
Definition: Residue.h:152
A more convenient string class.
Definition: String.h:34
Generates theoretical spectra for peptides with various options.
Definition: TheoreticalSpectrumGenerator.h:45
bool add_x_ions_
Definition: TheoreticalSpectrumGenerator.h:126
bool add_precursor_peaks_
Definition: TheoreticalSpectrumGenerator.h:137
void addLosses_(PeakSpectrum &spectrum, const AASequence &ion, DataArrays::StringDataArray &ion_names, DataArrays::IntegerDataArray &charges, double intensity, const Residue::ResidueType res_type, int charge) const
helper to add full neutral loss ladders (for isotope clusters), also adds charges and ion names to th...
virtual void addPeaks_(PeakSpectrum &spectrum, const AASequence &peptide, DataArrays::StringDataArray &ion_names, DataArrays::IntegerDataArray &charges, MSSpectrum::Chunks &chunks, const Residue::ResidueType res_type, Int charge=1) const
adds peaks to a spectrum of the given ion-type, peptide, charge, and intensity, also adds charges and...
TheoreticalSpectrumGenerator()
default constructor
double rel_loss_intensity_
Definition: TheoreticalSpectrumGenerator.h:149
bool add_all_precursor_charges_
Definition: TheoreticalSpectrumGenerator.h:138
bool add_losses_
Definition: TheoreticalSpectrumGenerator.h:131
bool add_a_ions_
Definition: TheoreticalSpectrumGenerator.h:124
static void addPrefixAndSuffixIons_(std::vector< float > &spectrum, const AASequence &peptide, Residue::ResidueType res_type, int charge)
helper for getPrefixAndSuffixIonsMZ. For given Ion-Type and charge calculates a peaks
double max_isotope_probability_
Definition: TheoreticalSpectrumGenerator.h:150
double c_intensity_
Definition: TheoreticalSpectrumGenerator.h:143
bool add_b_ions_
Definition: TheoreticalSpectrumGenerator.h:122
double z_intensity_
Definition: TheoreticalSpectrumGenerator.h:146
~TheoreticalSpectrumGenerator() override
destructor
bool add_term_losses_
Definition: TheoreticalSpectrumGenerator.h:132
bool sort_by_position_
Definition: TheoreticalSpectrumGenerator.h:140
bool add_abundant_immonium_ions_
Definition: TheoreticalSpectrumGenerator.h:139
bool add_y_ions_
Definition: TheoreticalSpectrumGenerator.h:123
bool add_isotopes_
Definition: TheoreticalSpectrumGenerator.h:134
void addInternalFragmentPeaks_(PeakSpectrum &spectrum, const AASequence &peptide, DataArrays::StringDataArray &ion_names, DataArrays::IntegerDataArray &charges, MSSpectrum::Chunks &chunks, const Residue::ResidueType res_type, Int charge) const
bool add_zp1_ions_
Definition: TheoreticalSpectrumGenerator.h:128
double pre_int_NH3_
Definition: TheoreticalSpectrumGenerator.h:153
TheoreticalSpectrumGenerator(const TheoreticalSpectrumGenerator &source)
copy constructor
bool add_internal_fragments_
Definition: TheoreticalSpectrumGenerator.h:135
virtual void addPrecursorPeaks_(PeakSpectrum &spec, const AASequence &peptide, DataArrays::StringDataArray &ion_names, DataArrays::IntegerDataArray &charges, Int charge=1) const
adds the precursor peaks to the spectrum, also adds charges and ion names to the DataArrays,...
double x_intensity_
Definition: TheoreticalSpectrumGenerator.h:144
TheoreticalSpectrumGenerator & operator=(const TheoreticalSpectrumGenerator &tsg)
assignment operator
bool add_zp2_ions_
Definition: TheoreticalSpectrumGenerator.h:129
double a_intensity_
Definition: TheoreticalSpectrumGenerator.h:141
bool add_first_prefix_ion_
Definition: TheoreticalSpectrumGenerator.h:130
double b_intensity_
Definition: TheoreticalSpectrumGenerator.h:142
void addIsotopeCluster_(PeakSpectrum &spectrum, const AASequence &ion, DataArrays::StringDataArray &ion_names, DataArrays::IntegerDataArray &charges, const Residue::ResidueType res_type, Int charge, double intensity) const
helper to add an isotope cluster to a spectrum, also adds charges and ion names to the DataArrays,...
int isotope_model_
Definition: TheoreticalSpectrumGenerator.h:136
static MSSpectrum generateSpectrum(const Precursor::ActivationMethod &fm, const AASequence &seq, int precursor_charge)
void updateMembers_() override
overwrite
void addLossesFaster_(PeakSpectrum &spectrum, double mz, const std::set< EmpiricalFormula > &f_losses, int ion_ordinal, DataArrays::StringDataArray &ion_names, DataArrays::IntegerDataArray &charges, const std::map< EmpiricalFormula, String > &formula_str_cache, double intensity, const String &annotation_prefix_string, bool add_metainfo, int charge) const
helper to add full neutral loss ladders (for single peaks), also adds charges and ion names to the Da...
double pre_int_
Definition: TheoreticalSpectrumGenerator.h:151
double y_intensity_
Definition: TheoreticalSpectrumGenerator.h:145
void addAbundantImmoniumIons_(PeakSpectrum &spec, const AASequence &peptide, DataArrays::StringDataArray &ion_names, DataArrays::IntegerDataArray &charges) const
Adds the common, most abundant immonium ions to the theoretical spectra if the residue is contained i...
virtual void getSpectrum(PeakSpectrum &spec, const AASequence &peptide, Int min_charge, Int max_charge, Int precursor_charge=0) const
void getPrefixAndSuffixIonsMZ(std::vector< float > &spectrum, const AASequence &peptide, int charge) const
Int max_isotope_
Definition: TheoreticalSpectrumGenerator.h:148
bool add_c_ions_
Definition: TheoreticalSpectrumGenerator.h:125
bool add_z_ions_
Definition: TheoreticalSpectrumGenerator.h:127
bool add_metainfo_
Definition: TheoreticalSpectrumGenerator.h:133
double pre_int_H2O_
Definition: TheoreticalSpectrumGenerator.h:152
int Int
Signed integer type.
Definition: Types.h:72
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Container for organizing and managing multiple chunks in a spectrum.
Definition: MSSpectrum.h:77