OpenMS  2.8.0
Classes | List of all members
TheoreticalSpectrumGeneratorXLMS Class Reference

Generates theoretical spectra for cross-linked peptides. More...

#include <OpenMS/CHEMISTRY/TheoreticalSpectrumGeneratorXLMS.h>

Inheritance diagram for TheoreticalSpectrumGeneratorXLMS:
[legend]
Collaboration diagram for TheoreticalSpectrumGeneratorXLMS:
[legend]

Classes

struct  LossIndex
 

Constructors and Destructors

bool add_b_ions_
 
bool add_y_ions_
 
bool add_a_ions_
 
bool add_c_ions_
 
bool add_x_ions_
 
bool add_z_ions_
 
bool add_first_prefix_ion_
 
bool add_losses_
 
bool add_metainfo_
 
bool add_charges_
 
bool add_isotopes_
 
bool add_precursor_peaks_
 
bool add_abundant_immonium_ions_
 
double a_intensity_
 
double b_intensity_
 
double c_intensity_
 
double x_intensity_
 
double y_intensity_
 
double z_intensity_
 
Int max_isotope_
 
double rel_loss_intensity_
 
double pre_int_
 
double pre_int_H2O_
 
double pre_int_NH3_
 
bool add_k_linked_ions_
 
std::map< String, LossIndexloss_db_
 
double loss_H2O_ = 0
 
double loss_NH3_ = 0
 
 TheoreticalSpectrumGeneratorXLMS ()
 default constructor More...
 
 TheoreticalSpectrumGeneratorXLMS (const TheoreticalSpectrumGeneratorXLMS &source)
 copy constructor More...
 
 ~TheoreticalSpectrumGeneratorXLMS () override
 destructor More...
 
TheoreticalSpectrumGeneratorXLMSoperator= (const TheoreticalSpectrumGeneratorXLMS &tsg)
 assignment operator More...
 
virtual void getLinearIonSpectrum (PeakSpectrum &spectrum, AASequence &peptide, Size link_pos, bool frag_alpha, int charge=1, Size link_pos_2=0) const
 Generates fragment ions not containing the cross-linker for one peptide. More...
 
virtual void getXLinkIonSpectrum (PeakSpectrum &spectrum, AASequence &peptide, Size link_pos, double precursor_mass, bool frag_alpha, int mincharge, int maxcharge, Size link_pos_2=0) const
 Generates fragment ions containing the cross-linker for one peptide. More...
 
virtual void getXLinkIonSpectrum (PeakSpectrum &spectrum, OPXLDataStructs::ProteinProteinCrossLink &crosslink, bool frag_alpha, int mincharge, int maxcharge) const
 Generates fragment ions containing the cross-linker for a pair of peptides. More...
 
void updateMembers_ () override
 overwrite More...
 
virtual void addLinearPeaks_ (PeakSpectrum &spectrum, DataArrays::IntegerDataArray &charges, DataArrays::StringDataArray &ion_names, AASequence &peptide, Size link_pos, bool frag_alpha, Residue::ResidueType res_type, std::vector< LossIndex > &forward_losses, std::vector< LossIndex > &backward_losses, int charge=1, Size link_pos_2=0) const
 Adds cross-link-less ions of a specific ion type and charge to a spectrum and adds ion name and charge annotations to the DataArrays. More...
 
virtual void addPeak_ (PeakSpectrum &spectrum, DataArrays::IntegerDataArray &charges, DataArrays::StringDataArray &ion_names, double pos, double intensity, Residue::ResidueType res_type, Size ion_index, int charge, String ion_type) const
 Adds a single peak to a spectrum and its charge and ion name to the given DataArrays. More...
 
virtual void addPrecursorPeaks_ (PeakSpectrum &spectrum, DataArrays::IntegerDataArray &charges, DataArrays::StringDataArray &ion_names, double precursor_mass, int charge) const
 Adds precursor masses including neutral losses for the given charge and adds charge and ion name to the given DataArrays. More...
 
virtual void addLinearIonLosses_ (PeakSpectrum &spectrum, DataArrays::IntegerDataArray &charges, DataArrays::StringDataArray &ion_names, double mono_weight, Residue::ResidueType res_type, Size frag_index, double intensity, int charge, String ion_type, LossIndex &losses) const
 Adds losses for a linear ion. More...
 
virtual void addXLinkIonLosses_ (PeakSpectrum &spectrum, DataArrays::IntegerDataArray &charges, DataArrays::StringDataArray &ion_names, double mono_weight, double intensity, int charge, String ion_name, LossIndex &losses) const
 Adds losses for a cross-linked ion. More...
 
virtual void addKLinkedIonPeaks_ (PeakSpectrum &spectrum, DataArrays::IntegerDataArray &charges, DataArrays::StringDataArray &ion_names, AASequence &peptide, Size link_pos, double precursor_mass, bool frag_alpha, int charge) const
 Adds one-residue-linked ion peaks, that are specific to XLMS. More...
 
virtual void addXLinkIonPeaks_ (PeakSpectrum &spectrum, DataArrays::IntegerDataArray &charges, DataArrays::StringDataArray &ion_names, AASequence &peptide, Size link_pos, double precursor_mass, bool frag_alpha, Residue::ResidueType res_type, std::vector< LossIndex > &forward_losses, std::vector< LossIndex > &backward_losses, int charge, Size link_pos_2=0) const
 Adds cross-linked ions of a specific ion type and charge to a spectrum and adds ion name and charge annotations to the DataArrays. More...
 
virtual void addXLinkIonPeaks_ (PeakSpectrum &spectrum, DataArrays::IntegerDataArray &charges, DataArrays::StringDataArray &ion_names, OPXLDataStructs::ProteinProteinCrossLink &crosslink, bool frag_alpha, Residue::ResidueType res_type, std::vector< LossIndex > &forward_losses, std::vector< LossIndex > &backward_losses, LossIndex &losses_peptide2, int charge) const
 Adds cross-linked ions of a specific ion type and charge to a spectrum and adds ion name and charge annotations to the DataArrays. More...
 
std::vector< LossIndexgetForwardLosses_ (AASequence &peptide) const
 Calculates sets of possible neutral losses for each position in the given peptide. More...
 
std::vector< LossIndexgetBackwardLosses_ (AASequence &peptide) const
 Calculates sets of possible neutral losses for each position in the given peptide. More...
 

Additional Inherited Members

- Public Member Functions inherited from DefaultParamHandler
 DefaultParamHandler (const String &name)
 Constructor with name that is displayed in error messages. More...
 
 DefaultParamHandler (const DefaultParamHandler &rhs)
 Copy constructor. More...
 
virtual ~DefaultParamHandler ()
 Destructor. More...
 
virtual DefaultParamHandleroperator= (const DefaultParamHandler &rhs)
 Assignment operator. More...
 
virtual bool operator== (const DefaultParamHandler &rhs) const
 Equality operator. More...
 
void setParameters (const Param &param)
 Sets the parameters. More...
 
const ParamgetParameters () const
 Non-mutable access to the parameters. More...
 
const ParamgetDefaults () const
 Non-mutable access to the default parameters. More...
 
const StringgetName () const
 Non-mutable access to the name. More...
 
void setName (const String &name)
 Mutable access to the name. More...
 
const std::vector< String > & getSubsections () const
 Non-mutable access to the registered subsections. More...
 
- Static Public Member Functions inherited from DefaultParamHandler
static void writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const String &key_prefix="")
 Writes all parameters to meta values. More...
 
- Protected Member Functions inherited from DefaultParamHandler
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 
- Protected Attributes inherited from DefaultParamHandler
Param param_
 Container for current parameters. More...
 
Param defaults_
 Container for default parameters. This member should be filled in the constructor of derived classes! More...
 
std::vector< Stringsubsections_
 Container for registered subsections. This member should be filled in the constructor of derived classes! More...
 
String error_name_
 Name that is displayed in error messages during the parameter checking. More...
 
bool check_defaults_
 If this member is set to false no checking if parameters in done;. More...
 
bool warn_empty_defaults_
 If this member is set to false no warning is emitted when defaults are empty;. More...
 

Detailed Description

Generates theoretical spectra for cross-linked peptides.

The spectra this class generates are instances of the PeakSpectrum class. This class generates the same peak types as SimpleTSGXLMS and the interface is very similar, but it is more complex and slower. If the parameters add_metainfo and add_charges are set to true, it will generate a StringDataArray for String annotations of ion types and an IntegerDataArray for peak charges and add them to the DataArrays of the produced PeakSpectrum. The spectra from this class are mainly used for annotation of matched experimental spectra.


Class Documentation

◆ OpenMS::TheoreticalSpectrumGeneratorXLMS::LossIndex

struct OpenMS::TheoreticalSpectrumGeneratorXLMS::LossIndex
Collaboration diagram for TheoreticalSpectrumGeneratorXLMS::LossIndex:
[legend]
Class Members
bool has_H2O_loss
bool has_NH3_loss

Constructor & Destructor Documentation

◆ TheoreticalSpectrumGeneratorXLMS() [1/2]

default constructor

◆ TheoreticalSpectrumGeneratorXLMS() [2/2]

copy constructor

◆ ~TheoreticalSpectrumGeneratorXLMS()

destructor

Member Function Documentation

◆ addKLinkedIonPeaks_()

virtual void addKLinkedIonPeaks_ ( PeakSpectrum spectrum,
DataArrays::IntegerDataArray charges,
DataArrays::StringDataArray ion_names,
AASequence peptide,
Size  link_pos,
double  precursor_mass,
bool  frag_alpha,
int  charge 
) const
protectedvirtual

Adds one-residue-linked ion peaks, that are specific to XLMS.

These fragments consist of one whole peptide, the cross-linker and a part of the linked residue from the second peptide. The residue fragment on the linker is an internal ion from a y- and an a-fragmentation with the length of one residue. The function is called KLinked for now, but instead of K it is whatever the linker is attached to.

Parameters
spectrumThe spectrum to which the peaks are added
chargesA DataArray collecting the charges of the added peaks
ion_namesA DataArray collecting the ion names of the added peaks
peptideThe fragmented peptide
link_posposition of the linker on the fragmented peptide
precursor_massThe mass of the whole cross-link candidate or the precursor mass of the experimental MS2 spectrum.
frag_alphaTrue, if the fragmented peptide is the Alpha peptide. Used for ion-name annotation.
chargeThe charge of the ion

◆ addLinearIonLosses_()

virtual void addLinearIonLosses_ ( PeakSpectrum spectrum,
DataArrays::IntegerDataArray charges,
DataArrays::StringDataArray ion_names,
double  mono_weight,
Residue::ResidueType  res_type,
Size  frag_index,
double  intensity,
int  charge,
String  ion_type,
LossIndex losses 
) const
protectedvirtual

Adds losses for a linear ion.

Parameters
spectrumThe spectrum to which the new peak is added
chargesA DataArray collecting the charges of the added peaks
ion_namesA DataArray collecting the ion names of the added peaks
mono_weightmonoisotopic mass of the current ion
res_typeThe ion type of the current ion
frag_indexThe index of the ion (fragmentation position)
intensity
chargeThe charge of the ion
ion_typeAnother cross-linking specific ion-type
lossesa set of LossMasses with which to modify the current ion

◆ addLinearPeaks_()

virtual void addLinearPeaks_ ( PeakSpectrum spectrum,
DataArrays::IntegerDataArray charges,
DataArrays::StringDataArray ion_names,
AASequence peptide,
Size  link_pos,
bool  frag_alpha,
Residue::ResidueType  res_type,
std::vector< LossIndex > &  forward_losses,
std::vector< LossIndex > &  backward_losses,
int  charge = 1,
Size  link_pos_2 = 0 
) const
protectedvirtual

Adds cross-link-less ions of a specific ion type and charge to a spectrum and adds ion name and charge annotations to the DataArrays.

Parameters
spectrumThe spectrum to which the new peaks are added. Does not have to be empty, the generated peaks will be pushed onto it.
chargesA DataArray collecting the charges of the added peaks
ion_namesA DataArray collecting the ion names of the added peaks
peptideThe peptide to fragment
link_posThe position of the cross-linker on the given peptide
frag_alphaTrue, if the fragmented peptide is the Alpha peptide. Used for ion-name annotation.
res_typeThe ion type of the added peaks
forward_lossesvector of sets of losses generated by getForwardLosses_
backward_lossesvector of sets of losses generated by getBackwardLosses_
chargeThe charge of the added peaks
link_pos_2A second position for the linker, in case it is a loop link

◆ addPeak_()

virtual void addPeak_ ( PeakSpectrum spectrum,
DataArrays::IntegerDataArray charges,
DataArrays::StringDataArray ion_names,
double  pos,
double  intensity,
Residue::ResidueType  res_type,
Size  ion_index,
int  charge,
String  ion_type 
) const
protectedvirtual

Adds a single peak to a spectrum and its charge and ion name to the given DataArrays.

The ion_type is a string in this form: "alpha|xi", the first word can be either "alpha" or "beta" and indicates the fragmented peptide, the two letters at the end are either "ci" or "xi" for linear ion or cross-linked ion.

Parameters
spectrumThe spectrum to which the new peak is added
chargesA DataArray collecting the charges of the added peaks
ion_namesA DataArray collecting the ion names of the added peaks
pos
intensity
res_typeThe ion type of the added peak
ion_indexThe index of the ion (fragmentation position)
chargeThe charge of the ion
ion_typeAnother cross-linking specific ion-type

◆ addPrecursorPeaks_()

virtual void addPrecursorPeaks_ ( PeakSpectrum spectrum,
DataArrays::IntegerDataArray charges,
DataArrays::StringDataArray ion_names,
double  precursor_mass,
int  charge 
) const
protectedvirtual

Adds precursor masses including neutral losses for the given charge and adds charge and ion name to the given DataArrays.

Parameters
spectrumThe spectrum to which the peaks are added
chargesA DataArray collecting the charges of the added peaks
ion_namesA DataArray collecting the ion names of the added peaks
precursor_massThe mass of the uncharged precursor
chargeThe charge of the precursor

◆ addXLinkIonLosses_()

virtual void addXLinkIonLosses_ ( PeakSpectrum spectrum,
DataArrays::IntegerDataArray charges,
DataArrays::StringDataArray ion_names,
double  mono_weight,
double  intensity,
int  charge,
String  ion_name,
LossIndex losses 
) const
protectedvirtual

Adds losses for a cross-linked ion.

Parameters
spectrumThe spectrum to which the new peak is added
chargesA DataArray collecting the charges of the added peaks
ion_namesA DataArray collecting the ion names of the added peaks
mono_weightmonoisotopic mass of the current ion
res_typeThe ion type of the current ion
frag_indexThe index of the ion (fragmentation position)
intensity
chargeThe charge of the ion
ion_typeAnother cross-linking specific ion-type
lossesa set of LossMasses with which to modify the current ion

◆ addXLinkIonPeaks_() [1/2]

virtual void addXLinkIonPeaks_ ( PeakSpectrum spectrum,
DataArrays::IntegerDataArray charges,
DataArrays::StringDataArray ion_names,
AASequence peptide,
Size  link_pos,
double  precursor_mass,
bool  frag_alpha,
Residue::ResidueType  res_type,
std::vector< LossIndex > &  forward_losses,
std::vector< LossIndex > &  backward_losses,
int  charge,
Size  link_pos_2 = 0 
) const
protectedvirtual

Adds cross-linked ions of a specific ion type and charge to a spectrum and adds ion name and charge annotations to the DataArrays.

This version of the function is for mono-links and loop-links.

Parameters
spectrumThe spectrum to which the new peaks are added. Does not have to be empty, the generated peaks will be pushed onto it.
chargesA DataArray collecting the charges of the added peaks
ion_namesA DataArray collecting the ion names of the added peaks
peptideThe peptide to fragment
link_posThe position of the cross-linker on the given peptide
precursor_massThe mass of the whole cross-link candidate or the precursor mass of the experimental MS2 spectrum.
frag_alphaTrue, if the fragmented peptide is the Alpha peptide. Used for ion-name annotation.
res_typeThe ion type of the added peaks
forward_lossesvector of sets of losses generated by getForwardLosses_
backward_lossesvector of sets of losses generated by getBackwardLosses_
chargeThe charge of the added peaks
link_pos_2A second position for the linker, in case it is a loop link

◆ addXLinkIonPeaks_() [2/2]

virtual void addXLinkIonPeaks_ ( PeakSpectrum spectrum,
DataArrays::IntegerDataArray charges,
DataArrays::StringDataArray ion_names,
OPXLDataStructs::ProteinProteinCrossLink crosslink,
bool  frag_alpha,
Residue::ResidueType  res_type,
std::vector< LossIndex > &  forward_losses,
std::vector< LossIndex > &  backward_losses,
LossIndex losses_peptide2,
int  charge 
) const
protectedvirtual

Adds cross-linked ions of a specific ion type and charge to a spectrum and adds ion name and charge annotations to the DataArrays.

This version of the function is for cross-linked peptide pairs.

Parameters
spectrumThe spectrum to which the new peaks are added. Does not have to be empty, the generated peaks will be pushed onto it.
chargesA DataArray collecting the charges of the added peaks
ion_namesA DataArray collecting the ion names of the added peaks
crosslinkThe ProteinProteinCrossLink to be fragmented
frag_alphaTrue, if the fragmented peptide is the Alpha peptide. Used for ion-name annotation.
res_typeThe ion type of the added peaks
forward_lossesvector of sets of losses generated by getForwardLosses_ for the fragmented peptide
backward_lossesvector of sets of losses generated by getBackwardLosses_ for the fragmented peptide
losses_peptide2set of losses for the second, not fragmented peptide, e.g. last set from getForwardLosses_ for the second peptide
chargeThe charge of the added peaks

◆ getBackwardLosses_()

std::vector< LossIndex > getBackwardLosses_ ( AASequence peptide) const
protected

Calculates sets of possible neutral losses for each position in the given peptide.

This function generates a vector of sets. Each set contains the possible neutral losses for a specific suffix of the peptide.

Parameters
peptideThe peptide or ion for which to collect possible losses

◆ getForwardLosses_()

std::vector< LossIndex > getForwardLosses_ ( AASequence peptide) const
protected

Calculates sets of possible neutral losses for each position in the given peptide.

This function generates a vector of sets. Each set contains the possible neutral losses for a specific prefix of the peptide.

Parameters
peptideThe peptide or ion for which to collect possible losses

◆ getLinearIonSpectrum()

virtual void getLinearIonSpectrum ( PeakSpectrum spectrum,
AASequence peptide,
Size  link_pos,
bool  frag_alpha,
int  charge = 1,
Size  link_pos_2 = 0 
) const
virtual

Generates fragment ions not containing the cross-linker for one peptide.

B-ions are generated from the beginning of the peptide up to the first linked position, y-ions are generated from the second linked position up the end of the peptide. If link_pos_2 is 0, a mono-link or cross-link is assumed and the second position is the same as the first position. For a loop-link two different positions can be set and link_pos_2 must be larger than link_pos. The generated ion types and other additional settings are determined by the tool parameters.

Parameters
spectrumThe spectrum to which the new peaks are added. Does not have to be empty, the generated peaks will be pushed onto it.
peptideThe peptide to fragment
link_posThe position of the cross-linker on the given peptide
frag_alphaTrue, if the fragmented peptide is the Alpha peptide. Used for ion-name annotation.
chargeThe maximal charge of the ions
link_pos_2A second position for the linker, in case it is a loop link

◆ getXLinkIonSpectrum() [1/2]

virtual void getXLinkIonSpectrum ( PeakSpectrum spectrum,
AASequence peptide,
Size  link_pos,
double  precursor_mass,
bool  frag_alpha,
int  mincharge,
int  maxcharge,
Size  link_pos_2 = 0 
) const
virtual

Generates fragment ions containing the cross-linker for one peptide.

B-ions are generated from the first linked position up to the end of the peptide, y-ions are generated from the beginning of the peptide up to the second linked position. If link_pos_2 is 0, a mono-link or cross-link is assumed and the second position is the same as the first position. For a loop-link two different positions can be set and link_pos_2 must be larger than link_pos. Since in the case of a cross-link a whole second peptide is attached to the other side of the cross-link, a precursor mass for the two peptides and the linker is needed. In the case of a loop link the precursor mass is the mass of the only peptide and the linker. Although this function is more general, currently it is mainly used for loop-links and mono-links, because residues in the second, unknown peptide cannot be considered for possible neutral losses. The generated ion types and other additional settings are determined by the tool parameters.

Parameters
spectrumThe spectrum to which the new peaks are added. Does not have to be empty, the generated peaks will be pushed onto it.
peptideThe peptide to fragment
link_posThe position of the cross-linker on the given peptide
precursor_massThe mass of the whole cross-link candidate or the precursor mass of the experimental MS2 spectrum.
frag_alphaTrue, if the fragmented peptide is the Alpha peptide. Used for ion-name annotation.
minchargeThe minimal charge of the ions
maxchargeThe maximal charge of the ions, it should be the precursor charge and is used to generate precursor ion peaks
link_pos_2A second position for the linker, in case it is a loop link

◆ getXLinkIonSpectrum() [2/2]

virtual void getXLinkIonSpectrum ( PeakSpectrum spectrum,
OPXLDataStructs::ProteinProteinCrossLink crosslink,
bool  frag_alpha,
int  mincharge,
int  maxcharge 
) const
virtual

Generates fragment ions containing the cross-linker for a pair of peptides.

B-ions are generated from the first linked position up to the end of the peptide, y-ions are generated from the beginning of the peptide up to the second linked position. This function generates neutral loss ions by considering both linked peptides. Only one of the peptides, decided by @frag_alpha, is fragmented. This function is not suitable to generate fragments for mono-links or loop-links. This simplifies the function, but it has to be called twice to get all fragments of a peptide pair. The generated ion types and other additional settings are determined by the tool parameters.

Parameters
spectrumThe spectrum to which the new peaks are added. Does not have to be empty, the generated peaks will be pushed onto it.
crosslinkProteinProteinCrossLink to be fragmented
frag_alphaTrue, if the fragmented peptide is the Alpha peptide.
minchargeThe minimal charge of the ions
maxchargeThe maximal charge of the ions, it should be the precursor charge and is used to generate precursor ion peaks

◆ operator=()

assignment operator

◆ updateMembers_()

void updateMembers_ ( )
overridevirtual

overwrite

Reimplemented from DefaultParamHandler.

Member Data Documentation

◆ a_intensity_

double a_intensity_
protected

◆ add_a_ions_

bool add_a_ions_
protected

◆ add_abundant_immonium_ions_

bool add_abundant_immonium_ions_
protected

◆ add_b_ions_

bool add_b_ions_
protected

◆ add_c_ions_

bool add_c_ions_
protected

◆ add_charges_

bool add_charges_
protected

◆ add_first_prefix_ion_

bool add_first_prefix_ion_
protected

◆ add_isotopes_

bool add_isotopes_
protected

◆ add_k_linked_ions_

bool add_k_linked_ions_
protected

◆ add_losses_

bool add_losses_
protected

◆ add_metainfo_

bool add_metainfo_
protected

◆ add_precursor_peaks_

bool add_precursor_peaks_
protected

◆ add_x_ions_

bool add_x_ions_
protected

◆ add_y_ions_

bool add_y_ions_
protected

◆ add_z_ions_

bool add_z_ions_
protected

◆ b_intensity_

double b_intensity_
protected

◆ c_intensity_

double c_intensity_
protected

◆ loss_db_

std::map< String, LossIndex > loss_db_
protected

◆ loss_H2O_

double loss_H2O_ = 0
protected

◆ loss_NH3_

double loss_NH3_ = 0
protected

◆ max_isotope_

Int max_isotope_
protected

◆ pre_int_

double pre_int_
protected

◆ pre_int_H2O_

double pre_int_H2O_
protected

◆ pre_int_NH3_

double pre_int_NH3_
protected

◆ rel_loss_intensity_

double rel_loss_intensity_
protected

◆ x_intensity_

double x_intensity_
protected

◆ y_intensity_

double y_intensity_
protected

◆ z_intensity_

double z_intensity_
protected