OpenMS
SimpleTSGXLMS Class Reference

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

#include <OpenMS/CHEMISTRY/SimpleTSGXLMS.h>

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

Classes

struct  LossIndex
 
struct  SimplePeak
 A simple struct to represent peaks with mz and charge and sort them easily. More...
 
struct  SimplePeakComparator
 Comparator to sort SimplePeaks by mz. More...
 

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_charges_
 
bool add_isotopes_
 
bool add_precursor_peaks_
 
bool add_abundant_immonium_ions_
 
Int max_isotope_
 
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
 
 SimpleTSGXLMS ()
 default constructor More...
 
 SimpleTSGXLMS (const SimpleTSGXLMS &source)
 copy constructor More...
 
 ~SimpleTSGXLMS () override
 destructor More...
 
SimpleTSGXLMSoperator= (const SimpleTSGXLMS &tsg)
 assignment operator More...
 
virtual void getLinearIonSpectrum (std::vector< SimplePeak > &spectrum, AASequence &peptide, Size link_pos, int charge=1, Size link_pos_2=0) const
 Generates fragment ions not containing the cross-linker for one peptide. More...
 
virtual void getXLinkIonSpectrum (std::vector< SimplePeak > &spectrum, AASequence &peptide, Size link_pos, double precursor_mass, int mincharge, int maxcharge, Size link_pos_2=0) const
 Generates fragment ions containing the cross-linker for one peptide. More...
 
virtual void getXLinkIonSpectrum (std::vector< SimplePeak > &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_ (std::vector< SimplePeak > &spectrum, AASequence &peptide, Size link_pos, 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. More...
 
virtual void addPrecursorPeaks_ (std::vector< SimplePeak > &spectrum, double precursor_mass, int charge) const
 Adds precursor masses including neutral losses for the given charge. More...
 
virtual void addLosses_ (std::vector< SimplePeak > &spectrum, double mono_weight, int charge, LossIndex &losses) const
 Adds neutral losses for an ion to a spectrum. More...
 
virtual void addKLinkedIonPeaks_ (std::vector< SimplePeak > &spectrum, AASequence &peptide, Size link_pos, double precursor_mass, int charge) const
 Adds one-residue-linked ion peaks, that are specific to XLMS. More...
 
virtual void addXLinkIonPeaks_ (std::vector< SimplePeak > &spectrum, AASequence &peptide, Size link_pos, double precursor_mass, 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. More...
 
virtual void addXLinkIonPeaks_ (std::vector< SimplePeak > &spectrum, 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. 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...
 
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 vectors of SimplePeaks. This class generates the same peak types as TheoreticalSpectrumGeneratorXLMS and the interface is very similar, but it is simpler and faster. SimplePeak only contains an mz value and a charge. No intensity values or String annotations or other additional DataArrays are generated.


Class Documentation

◆ OpenMS::SimpleTSGXLMS::LossIndex

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

Constructor & Destructor Documentation

◆ SimpleTSGXLMS() [1/2]

default constructor

◆ SimpleTSGXLMS() [2/2]

SimpleTSGXLMS ( const SimpleTSGXLMS source)

copy constructor

◆ ~SimpleTSGXLMS()

~SimpleTSGXLMS ( )
override

destructor

Member Function Documentation

◆ addKLinkedIonPeaks_()

virtual void addKLinkedIonPeaks_ ( std::vector< SimplePeak > &  spectrum,
AASequence peptide,
Size  link_pos,
double  precursor_mass,
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 residue the linker is bound to.

Parameters
spectrumThe spectrum to which the peaks are added
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.
chargeThe charge of the ion

◆ addLinearPeaks_()

virtual void addLinearPeaks_ ( std::vector< SimplePeak > &  spectrum,
AASequence peptide,
Size  link_pos,
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.

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
res_typeThe ion type of the added peaks
forward_lossesvector of LossIndex generated by getForwardLosses_
backward_lossesvector of LossIndex generated by getBackwardLosses_
chargeThe charge of the added peaks
link_pos_2A second position for the linker, in case it is a loop link

◆ addLosses_()

virtual void addLosses_ ( std::vector< SimplePeak > &  spectrum,
double  mono_weight,
int  charge,
LossIndex losses 
) const
protectedvirtual

Adds neutral losses for an ion to a spectrum.

Parameters
spectrumThe spectrum to which the new peak is added
mono_weightmonoisotopic mass of the current ion
chargeThe charge of the ion
lossesa LossIndex with which to modify the current ion

◆ addPrecursorPeaks_()

virtual void addPrecursorPeaks_ ( std::vector< SimplePeak > &  spectrum,
double  precursor_mass,
int  charge 
) const
protectedvirtual

Adds precursor masses including neutral losses for the given charge.

Parameters
spectrumThe spectrum to which the peaks are added
precursor_massThe mass of the uncharged precursor
chargeThe charge of the precursor

◆ addXLinkIonPeaks_() [1/2]

virtual void addXLinkIonPeaks_ ( std::vector< SimplePeak > &  spectrum,
AASequence peptide,
Size  link_pos,
double  precursor_mass,
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.

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.
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.
res_typeThe ion type of the added peaks
forward_lossesvector of LossIndex generated by getForwardLosses_
backward_lossesvector of LossIndex 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_ ( std::vector< SimplePeak > &  spectrum,
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.

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.
crosslinkThe ProteinProteinCrossLink to be fragmented
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 LossIndex generated by getForwardLosses_ for the fragmented peptide
backward_lossesvector of LossIndex 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 ( std::vector< SimplePeak > &  spectrum,
AASequence peptide,
Size  link_pos,
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
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 ( std::vector< SimplePeak > &  spectrum,
AASequence peptide,
Size  link_pos,
double  precursor_mass,
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.
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 ( std::vector< SimplePeak > &  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 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. This function is not suitable to generate fragments for mono-links or 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.
crosslinkProteinProteinCrossLink to be fragmented
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.
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=()

SimpleTSGXLMS& operator= ( const SimpleTSGXLMS tsg)

assignment operator

◆ updateMembers_()

void updateMembers_ ( )
overridevirtual

overwrite

Reimplemented from DefaultParamHandler.

Member Data Documentation

◆ 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_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

◆ 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