Matrix Science header
Public Types | Public Member Functions

ms_fragment Class Reference
[Classes for calculating masses of peptides and fragments.]

Class representing a single peptide fragment. More...

#include <ms_fragment.hpp>

List of all members.

Public Types

enum  LABEL_FORMAT {
  LABEL_FORMAT_TRADITIONAL = 0,
  LABEL_FORMAT_PEPTIDE_VIEW = 1
}
 

Format of fragment labels returned by getLabel().

More...

Public Member Functions

 ms_fragment ()
 Default constructor (don't use it).
 ms_fragment (const ms_fragment &src)
 Copying constructor.
 ms_fragment (const ms_peptide::PSM psmComponent, const char *seriesName, const double massValue, const double nlValue, const int col, const int chargeState, const double matchedExptMass=0, const double matchedExptIntensity=0)
 A constructor for regular series ions of a crosslinked peptide.
 ms_fragment (const int seriesID, const double massValue, const double nlValue, const char *peptideStr, const int startPos, const int endPos, const int chargeState=1, const double matchedExptMass=0, const double matchedExptIntensity=0)
 A constructor for internal series ions only.
 ms_fragment (const int seriesID, const double massValue, const double nlValue, const int col, const int chargeState=1, const double matchedExptMass=0, const double matchedExptIntensity=0)
 A constructor for regular series ions.
 ms_fragment (const ms_peptide::PSM psmComponent, const int seriesID, const double massValue, const double nlValue, const char *peptideStr, const int startPos, const int endPos, const int chargeState, const double matchedExptMass=0, const double matchedExptIntensity=0)
 A constructor for internal series ions of a crosslinked peptide.
 ms_fragment (const char residueName, const double massValue, const double nlValue, const int col=-1, const int chargeState=1, const double matchedExptMass=0, const double matchedExptIntensity=0)
 A constructor for immonium ion.
 ms_fragment (const ms_peptide::PSM psmComponent, const int seriesID, const double massValue, const double nlValue, const int col, const int chargeState, const double matchedExptMass=0, const double matchedExptIntensity=0)
 A constructor for regular series ions of a crosslinked peptide.
 ms_fragment (const ms_peptide::PSM psmComponent, const char residueName, const double massValue, const double nlValue, const int col, const int chargeState, const double matchedExptMass=0, const double matchedExptIntensity=0)
 A constructor for immonium ion of a crosslinked peptide.
 ms_fragment (const double massValue, const double nlValue, const int chargeState, const double matchedExptMass=0, const double matchedExptIntensity=0)
 A constructor for precursor neutral loss peak.
 ms_fragment (const char *seriesName, const double massValue, const double nlValue, const int col, const int chargeState=1, const double matchedExptMass=0, const double matchedExptIntensity=0)
 A constructor for regular series ions.
void clearMatchedIon ()
 Sets the fragment to be 'unmatched'.
void copyFrom (const ms_fragment *src)
 Copies the whole content of another instance.
int getAllMatchedIons (std::vector< double > &masses, std::vector< double > &intensities) const
 Returns the list of all experimental data that matched the calculated fragment mass.
int getCharge () const
 Returns the charge state (1, 2, 3 etc.) for the ion.
int getColumn () const
 Returns the 1-based position index in case of a regular series.
int getEnd () const
 Returns the 1-based last position in case of an internal fragment.
std::string getLabel (const LABEL_FORMAT fmt=LABEL_FORMAT_TRADITIONAL) const
 Returns a symbolic label like "a*(6)++".
double getMass () const
 Returns the ion mass (m/z) value.
double getMatchedIonIntensity () const
 Returns the intensity of an experimental peak that matched the calculated mass value.
double getMatchedIonMass () const
 Returns the m/z value of an experimental peak that matched the calculated mass value.
double getNeutralLoss () const
 Returns the neutral loss (m/z) values applied to the fragment.
std::string getPeptideSubstring () const
 Returns the peptide substring for internal fragments, residue name for immonium.
std::string getSeriesName () const
 Returns the ion series name.
int getStart () const
 Returns the 1-based start position within the peptide sequence.
bool isCTerminal () const
 Returns TRUE for y, v, w, x, z series, and FALSE for other series, internal ions and immonium ions.
bool isFromAlpha () const
 Returns TRUE if this fragment comes from the alpha peptide of a crosslinked match.
bool isFromBeta () const
 Returns TRUE if this fragment comes from the beta peptide of a crosslinked match.
bool isImmonium () const
 Returns TRUE for immonium ions.
bool isInternal () const
 Returns TRUE for internal fragments ya and yb.
bool isNTerminal () const
 Returns TRUE for a, b, c, d series, and FALSE for other series, internal ions and immonium ions.
bool isPrecursorNL () const
 Returns TRUE for precursor neutral loss peaks.
bool isRegular () const
 Returns TRUE for a, b, c, d, y, v, w, x, z series and their derivatives.
ms_fragmentoperator= (const ms_fragment &right)
 Assignment operator for C++ programs.
void setMatchedIon (const double mass, const double intensity)

Detailed Description

Class representing a single peptide fragment.

Examples:

tools_aahelper.cpp.


Member Enumeration Documentation

Format of fragment labels returned by getLabel().

The traditional label format was introduced in Parser 2.2. It has three parts, in this order: fragment ID, charge state and neutral loss. NL is separated from charge state by a space. If NL is zero, there is no space. Fragment ID depends on the series:

  • Regular ion series: series name followed by column in parentheses, e.g. "a(1)" or "y(15)"
  • Immoniums: amino acid residue, e.g. "R" or "K"
  • Internal series: peptide substring, e.g. "LVIK" or "LV"
  • Precursor NL peaks: "M"

Examples of labels in traditional format: "b(3)++ -64", "LVIK -16", "a(1)++", "y(15)"

The Peptide View label format was introduced in Mascot 2.1. The format contains the same three parts as the traditional format, but the order is different: fragment ID, neutral loss, charge state. There is no space between the elements. Peptide View format supports negative doubly charged ions.

Examples of labels in Peptide View format: "b(3)-64++", "LVIK-16", "a(1)++", "y(15)", "b(3)-64--"

Enumerator:
LABEL_FORMAT_TRADITIONAL 

Format introduced in Parser 2.2.

LABEL_FORMAT_PEPTIDE_VIEW 

Format used by Peptide View since Mascot 2.1.


Constructor & Destructor Documentation

ms_fragment (  )

Default constructor (don't use it).

Initialises all values to defaults.

ms_fragment ( const ms_fragment src )

Copying constructor.

Note:
This constructor can only be used from C++. Use copyFrom() from other programming languages.
Parameters:
srcis the original fragment to base the new one on.
ms_fragment ( const int  seriesID,
const double  massValue,
const double  nlValue,
const int  col,
const int  chargeState = 1,
const double  matchedExptMass = 0,
const double  matchedExptIntensity = 0 
)

A constructor for regular series ions.

Parameters:
seriesIDion series number. It must be one of the values in matrix_science::ms_fragmentationrules::FRAG_SERIES_TYPE.
massValueion mass value.
nlValueneutral loss value.
colposition index for the ion.
chargeStatecharge state (1, 2, 3 etc.) of the ion.
matchedExptMassis the m/z value of an experimental peak that matches this calculated fragment ion.
matchedExptIntensityis the intensity of an experimental peak that matches this calculated fragment ion.
ms_fragment ( const ms_peptide::PSM  psmComponent,
const int  seriesID,
const double  massValue,
const double  nlValue,
const int  col,
const int  chargeState,
const double  matchedExptMass = 0,
const double  matchedExptIntensity = 0 
)

A constructor for regular series ions of a crosslinked peptide.

Parameters:
psmComponentOne of the values for ms_peptide::PSM. If ms_peptide::PSM_COMPLETE, the object is the same as if it had been constructed with ms_fragment(const int, const double, const double, const int, const int, const double, const double).
seriesIDion series number. It must be one of the values in matrix_science::ms_fragmentationrules::FRAG_SERIES_TYPE.
massValueion mass value.
nlValueneutral loss value.
colposition index for the ion.
chargeStatecharge state (1, 2, 3 etc.) of the ion.
matchedExptMassis the m/z value of an experimental peak that matches this calculated fragment ion.
matchedExptIntensityis the intensity of an experimental peak that matches this calculated fragment ion.
ms_fragment ( const char *  seriesName,
const double  massValue,
const double  nlValue,
const int  col,
const int  chargeState = 1,
const double  matchedExptMass = 0,
const double  matchedExptIntensity = 0 
)

A constructor for regular series ions.

Parameters:
seriesNameion series name.
massValueion mass value.
nlValueneutral loss value.
colposition index for the ion.
chargeStatecharge state (1, 2, 3 etc.) of the ion.
matchedExptMassis the m/z value of an experimental peak that matches this calculated fragment ion.
matchedExptIntensityis the intensity of an experimental peak that matches this calculated fragment ion.
ms_fragment ( const ms_peptide::PSM  psmComponent,
const char *  seriesName,
const double  massValue,
const double  nlValue,
const int  col,
const int  chargeState,
const double  matchedExptMass = 0,
const double  matchedExptIntensity = 0 
)

A constructor for regular series ions of a crosslinked peptide.

Parameters:
psmComponentOne of the values for ms_peptide::PSM. If ms_peptide::PSM_COMPLETE, the object is the same as if it had been constructed with ms_fragment(const char*, const double, const double, const int, const int, const double, const double).
seriesNameion series name.
massValueion mass value.
nlValueneutral loss value.
colposition index for the ion.
chargeStatecharge state (1, 2, 3 etc.) of the ion.
matchedExptMassis the m/z value of an experimental peak that matches this calculated fragment ion.
matchedExptIntensityis the intensity of an experimental peak that matches this calculated fragment ion.
ms_fragment ( const int  seriesID,
const double  massValue,
const double  nlValue,
const char *  peptideStr,
const int  startPos,
const int  endPos,
const int  chargeState = 1,
const double  matchedExptMass = 0,
const double  matchedExptIntensity = 0 
)

A constructor for internal series ions only.

Parameters:
seriesIDion series number. It must be one of the values in matrix_science::ms_fragmentationrules::FRAG_SERIES_TYPE.
massValueion mass value.
nlValueneutral loss value.
peptideStrpeptide sequence string.
startPosfirst position of the fragment.
endPoslast position of the fragment.
chargeStatefor the internals ions series -- should be 1 or 2.
matchedExptMassis the m/z value of an experimental peak that matches this calculated fragment ion.
matchedExptIntensityis the intensity of an experimental peak that matches this calculated fragment ion.
ms_fragment ( const ms_peptide::PSM  psmComponent,
const int  seriesID,
const double  massValue,
const double  nlValue,
const char *  peptideStr,
const int  startPos,
const int  endPos,
const int  chargeState,
const double  matchedExptMass = 0,
const double  matchedExptIntensity = 0 
)

A constructor for internal series ions of a crosslinked peptide.

Parameters:
psmComponentOne of the values for ms_peptide::PSM. If ms_peptide::PSM_COMPLETE, the object is the same as if it had been constructed with ms_fragment(const int, const double, const double, const char*, const int, const int, const int, const double, const double).
seriesIDion series number. It must be one of the values in matrix_science::ms_fragmentationrules::FRAG_SERIES_TYPE.
massValueion mass value.
nlValueneutral loss value.
peptideStrpeptide sequence string.
startPosfirst position of the fragment.
endPoslast position of the fragment.
chargeStatefor the internals ions series -- should be 1 or 2.
matchedExptMassis the m/z value of an experimental peak that matches this calculated fragment ion.
matchedExptIntensityis the intensity of an experimental peak that matches this calculated fragment ion.
ms_fragment ( const char  residueName,
const double  massValue,
const double  nlValue,
const int  col = -1,
const int  chargeState = 1,
const double  matchedExptMass = 0,
const double  matchedExptIntensity = 0 
)

A constructor for immonium ion.

This constructor is only used for immonium ions.

Parameters:
residueNameamino-acid name.
massValueion mass value.
nlValueneutral loss value.
colposition index for the ion.
chargeStatecharge state (1, 2, 3 etc.) of the ion.
matchedExptMassis the m/z value of an experimental peak that matches this calculated fragment ion.
matchedExptIntensityis the intensity of an experimental peak that matches this calculated fragment ion.
ms_fragment ( const ms_peptide::PSM  psmComponent,
const char  residueName,
const double  massValue,
const double  nlValue,
const int  col,
const int  chargeState,
const double  matchedExptMass = 0,
const double  matchedExptIntensity = 0 
)

A constructor for immonium ion of a crosslinked peptide.

This constructor is only used for immonium ions.

Parameters:
psmComponentOne of the values for ms_peptide::PSM. If ms_peptide::PSM_COMPLETE, the object is the same as if it had been constructed with ms_fragment(const char, const double, const double, const int, const int, const double, const double).
residueNameamino-acid name.
massValueion mass value.
nlValueneutral loss value.
colposition index for the ion.
chargeStatecharge state (1, 2, 3 etc.) of the ion.
matchedExptMassis the m/z value of an experimental peak that matches this calculated fragment ion.
matchedExptIntensityis the intensity of an experimental peak that matches this calculated fragment ion.
ms_fragment ( const double  massValue,
const double  nlValue,
const int  chargeState,
const double  matchedExptMass = 0,
const double  matchedExptIntensity = 0 
)

A constructor for precursor neutral loss peak.

This constructor is only used for precursor neutral loss peaks. Normally massValue = (mrCalc - nlValue + protonMass * chargeState) / chargeState, where mrCalc is the relative precursor mass.

Parameters:
massValueion mass value.
nlValueneutral loss value.
chargeStatecharge state (1, 2, 3 etc.) of the ion.
matchedExptMassis the m/z value of an experimental peak that matches this calculated fragment ion.
matchedExptIntensityis the intensity of an experimental peak that matches this calculated fragment ion.

Member Function Documentation

void copyFrom ( const ms_fragment src )

Copies the whole content of another instance.

Copy everything from src onto this fragment object.

Parameters:
srcvalid pointer to a ms_fragment object
int getAllMatchedIons ( std::vector< double > &  masses,
std::vector< double > &  intensities 
) const

Returns the list of all experimental data that matched the calculated fragment mass.

See ms_fragmentvector::addExperimentalData().

Parameters:
massesis used to return a vector of mass values. See Using STL vector classes vectori, vectord and VectorString in Perl, Java, Python and C#.
intensitiesis used to return a corresponding vector of intensity values. Using STL vector classes vectori, vectord and VectorString in Perl, Java, Python and C#.
Returns:
the number of mass/intensity values returned.
int getEnd (  ) const

Returns the 1-based last position in case of an internal fragment.

This will be -1 for a 'regular' series, immonium ions and precursor NL ions.

Returns:
end of the series
Examples:
tools_aahelper.cpp.
std::string getLabel ( const LABEL_FORMAT  fmt = LABEL_FORMAT_TRADITIONAL ) const

Returns a symbolic label like "a*(6)++".

Parameters:
fmtOutput format of the label. Default is ms_fragment::LABEL_FORMAT_TRADITIONAL.
Returns:
Formatted label; see ms_fragment::LABEL_FORMAT for examples.
Examples:
tools_aahelper.cpp.
double getMatchedIonIntensity (  ) const

Returns the intensity of an experimental peak that matched the calculated mass value.

See ms_fragmentvector::addExperimentalData().

Returns:
the intensity of the most intense experimental m/z value that matched the peak. This value will be zero if no peak matched.
double getMatchedIonMass (  ) const

Returns the m/z value of an experimental peak that matched the calculated mass value.

See ms_fragmentvector::addExperimentalData().

Returns:
the mass of the most intense experimental m/z value that matched the peak. This value will be zero if no peak matched.
std::string getSeriesName (  ) const

Returns the ion series name.

The ions series name will be one of:

  • a
  • a*
  • a0
  • b
  • b*
  • b0
  • c
  • x
  • y
  • y*
  • y0
  • z
  • z+1
  • d
  • v
  • w
  • z+2
  • ya
  • yb
  • immonium
  • precursor
Returns:
name of the series
Examples:
tools_aahelper.cpp.
int getStart (  ) const

Returns the 1-based start position within the peptide sequence.

Returns:
1-based position in case of an internal fragment, which will also be valid for a 'regular' series. Returns 0 if this is a precursor NL peak.
Examples:
tools_aahelper.cpp.
bool isFromAlpha (  ) const

Returns TRUE if this fragment comes from the alpha peptide of a crosslinked match.

Returns:
False if the fragment is from the beta peptide or from a linear (non-crosslinked) peptide. True otherwise.
bool isFromBeta (  ) const

Returns TRUE if this fragment comes from the beta peptide of a crosslinked match.

Returns:
False if the fragment is from the alpha peptide or from a linear (non-crosslinked) peptide. True otherwise.
ms_fragment & operator= ( const ms_fragment right )

Assignment operator for C++ programs.

Parameters:
rightis the original fragment to copy to the new one.
Returns:
reference to the current object
void setMatchedIon ( const double  mass,
const double  intensity 
)

Sets the mass and intensity of experimental data that matched the calculated mass value.

See ms_fragmentvector::addExperimentalData().

These values will be zero if no peak matched.

Parameters:
massis the experimental m/z value that matched the peak.
intensityis the experimental intensity value that matched the peak.

The documentation for this class was generated from the following files:

Copyright © 2022 Matrix Science Ltd.  All Rights Reserved. Generated on Thu Mar 31 2022 01:12:32