libXpertMass Developer Documentation

libXpertMass Namespace

MsXpS::libXpertMass

Contains libXpertMass documentation. More...

Header: #include <libXpertMass>

Classes

class ChemicalGroupProp
class ModifProp

Types

enum CapType { CAP_NONE, CAP_LEFT, CAP_RIGHT, CAP_BOTH }
enum ChemicalGroupRuleFate { LOST, PRESERVED }
enum ChemicalGroupTrapping { NEVER_TRAPPED, LEFT_TRAPPED, RIGHT_TRAPPED }
enum CrossLinkEncompassed { CROSS_LINK_ENCOMPASSED_NO, CROSS_LINK_ENCOMPASSED_PARTIAL, CROSS_LINK_ENCOMPASSED_FULL }
enum class FormulaSplitResult { NOT_SET, FAILURE, HAS_PLUS_COMPONENT, HAS_MINUS_COMPONENT, HAS_BOTH_COMPONENTS }
enum FragEnd { FRAG_END_NONE, FRAG_END_LEFT, FRAG_END_RIGHT, FRAG_END_BOTH }
enum HashAccountData { HASH_ACCOUNT_SEQUENCE, HASH_ACCOUNT_MONOMER_MODIF, HASH_ACCOUNT_POLYMER_MODIF }
enum class IsotopeFields { ID, ELEMENT, SYMBOL, ATOMIC_NUMBER, MASS, …, RADIOACTIVE }
enum class IsotopicDataType { NOT_SET, LIBRARY_CONFIG, USER_CONFIG, MANUAL_CONFIG }
enum class MassPeakShapeType { GAUSSIAN, LORENTZIAN }
enum class MassPeakWidthLogic { FWHM, RESOLUTION }
enum MassToleranceType { MASS_TOLERANCE_NONE, MASS_TOLERANCE_PPM, MASS_TOLERANCE_MZ, MASS_TOLERANCE_AMU, MASS_TOLERANCE_RES }
enum MassType { MASS_NONE, MASS_MONO, MASS_AVG, MASS_BOTH }
enum MonomerChemEnt { MONOMER_CHEMENT_NONE, MONOMER_CHEMENT_MODIF, MONOMER_CHEMENT_CROSS_LINK }
enum PolymerChemEnt { POLYMER_CHEMENT_NONE, POLYMER_CHEMENT_LEFT_END_MODIF, POLYMER_CHEMENT_FORCE_LEFT_END_MODIF, POLYMER_CHEMENT_RIGHT_END_MODIF, POLYMER_CHEMENT_FORCE_RIGHT_END_MODIF, …, POLYMER_CHEMENT_FORCE_BOTH_END_MODIF }
enum PolymerEnd { END_NONE, END_LEFT, END_RIGHT, END_BOTH }
enum SelectionType { SELECTION_TYPE_RESIDUAL_CHAINS, SELECTION_TYPE_OLIGOMERS }

Variables

int ATOM_DEC_PLACES
int FWHM_PEAK_SPAN_FACTOR
int OLIGOMER_DEC_PLACES
int PH_PKA_DEC_PLACES
int POLYMER_DEC_PLACES
const int POL_CHEM_DEF_FILE_FORMAT_VERSION
const int POL_SEQ_FILE_FORMAT_VERSION
int gEndOfLineRegExp
int gXyFormatMassDataRegExp
int massToleranceTypeMap
int subFormulaRegExp

Functions

int addPpm(double value, double ppm)
int addRes(double value, double res)
int almostEqual(double value1, double value2, int decimal_places = 10)
int countZeroDecimals(double value)
int doubleListStatistics(int list, double *sum, double *average, double *variance, double *stdDeviation, double *nonZeroSmallest, double *smallest, double *smallestMedian, double *greatest)
int ppm(double value, double ppm)
int removePpm(double value, double ppm)
int removeRes(double value, double res)
int res(double value, double res)

Detailed Description

Classes

class ChemicalGroupProp

The ChemicalGroupProp class provides a Prop instance of which the member data points to a dynamically allocated ChemicalGroup instance. More...

class ModifProp

The ModifProp class provides a Prop instance of which the member data points to a dynamically allocated Modif instance. More...

Type Documentation

enum libXpertMass::CapType

This enum specifies the type of cap (the chemical entities that are set to the polymer ends so as to finish its polymerization state from a chain of residues to an actual polymer molecule.

ConstantValueDescription
MsXpS::libXpertMass::CAP_NONE0 << 1The cap is not defined
MsXpS::libXpertMass::CAP_LEFT1 << 1The left cap
MsXpS::libXpertMass::CAP_RIGHT2 << 1The right cap
MsXpS::libXpertMass::CAP_BOTH(CAP_LEFT | CAP_RIGHT)(CAP_LEFT | CAP_RIGHT)

enum libXpertMass::ChemicalGroupRuleFate

This enum specifies how the chemical group behaves when the chemical entity that it holds polymerizes into a Polymer.

This example clarifies the concept:

<monomer>
  <code>C</code>
  <mnmchemgroup>
    <name>N-term NH2</name>
    <pka>9.6</pka>
    <acidcharged>TRUE</acidcharged>
    <polrule>left_trapped</polrule>
    <chemgrouprule>
      <entity>LE_PLM_MODIF</entity>
      <name>Acetylation</name>
      <outcome>LOST</outcome>
    </chemgrouprule>
  </mnmchemgroup>

When the Cysteine's amino group is modified because the Cys residue on on the N-terminal end of the polymer, if it gets acetylated, then the amino group is lost because it is trapped in the amide bond. It is thus not accounted for when computing the pI of the protein.

ConstantValueDescription
MsXpS::libXpertMass::LOST0The chemical group is lost upon modification of the Monomer.
MsXpS::libXpertMass::PRESERVED1The chemical group is preserved upon modification of the Monomer.

enum libXpertMass::ChemicalGroupTrapping

This enum specifies how the chemical group behaves when the chemical entity that it holds polymerizes into a Polymer.

One example will clear things out:

An amino acid has a amino group and a carboxylic acid group. The amino group gets entrapped in the monomer-to-monomer bond (the peptide bond) if the polymerization occurs at the left of the monomer. That means that if the Monomer holding this ChemicalGroup is N-terminal, then the amino group should be accounted for because it is intact. Conversely, the carboxylic acid group gets entrapped in the peptide bond if the polymerization occurs at the right of the monomer. That means that if the Monomer holding this ChemicalGroup is C-terminal, then the carboxylic acid group should be accounted for because it is intact.

ConstantValueDescription
MsXpS::libXpertMass::NEVER_TRAPPED1 << 0The chemical group is not lost upon polymerization, it should thus always be accounted for.
MsXpS::libXpertMass::LEFT_TRAPPED1 << 1The chemical group gets trapped in the inter-monomer bond if polymerization occurs at left of the Monomer.
MsXpS::libXpertMass::RIGHT_TRAPPED1 << 2The chemical group gets trapped in the inter-monomer bond if polymerization occurs at right of the Monomer.

enum libXpertMass::CrossLinkEncompassed

This enum type specifies the manner in which a sequence region in a Polymer or in an Oligomer contains fully, or partially not does not contain all the monomers involved in a CrossLink:

ConstantValueDescription
MsXpS::libXpertMass::CROSS_LINK_ENCOMPASSED_NO0The region does not contain any Monomer involved in a CrossLink.
MsXpS::libXpertMass::CROSS_LINK_ENCOMPASSED_PARTIAL1The region contains one or more Monomers involved in a CrossLink but not all.
MsXpS::libXpertMass::CROSS_LINK_ENCOMPASSED_FULL2All the Monomers involved in the CrossLink are contained in the Polymer or Oligomer region.

enum class libXpertMass::FormulaSplitResult

This enum type specifies the result of an actionformula parsing process:

ConstantValueDescription
MsXpS::libXpertMass::FormulaSplitResult::NOT_SET0x0000The value was not set
MsXpS::libXpertMass::FormulaSplitResult::FAILURE1 << 0The splitting work failed
MsXpS::libXpertMass::FormulaSplitResult::HAS_PLUS_COMPONENT1 << 1The action formula has a plus component
MsXpS::libXpertMass::FormulaSplitResult::HAS_MINUS_COMPONENT1 << 2The action formula has a minus component
MsXpS::libXpertMass::FormulaSplitResult::HAS_BOTH_COMPONENTS(HAS_PLUS_COMPONENT | HAS_MINUS_COMPONENT)The action formula has both plus and minus components

enum libXpertMass::FragEnd

This enum specifies the end of the Oligomer that will be contained in the fragment resulting from its fragmentation. In protein chemistry, for example, a,b and x fragments are N-terminal fragments, that is, they contain the left end of the framgented Oligomer's sequence.

ConstantValueDescription
MsXpS::libXpertMass::FRAG_END_NONE1 << 0The value is not set.
MsXpS::libXpertMass::FRAG_END_LEFT1 << 1The generated fragment contains the left end of the oligomer
MsXpS::libXpertMass::FRAG_END_RIGHT1 << 2The generated fragment contains the right end of the oligomer
MsXpS::libXpertMass::FRAG_END_BOTH(FRAG_END_LEFT | FRAG_END_RIGHT)The generated fragment contains both the left and the right end of the oligomer (that is, is all the oligomer)

enum libXpertMass::HashAccountData

This enum specifies the chemical entites to account for when calculating a hash.

ConstantValueDescription
MsXpS::libXpertMass::HASH_ACCOUNT_SEQUENCE1 << 0The sequence
MsXpS::libXpertMass::HASH_ACCOUNT_MONOMER_MODIF1 << 1Monomer modifications
MsXpS::libXpertMass::HASH_ACCOUNT_POLYMER_MODIF1 << 2Polymer modifications

enum class libXpertMass::IsotopeFields

This enum type documents the various member data in Isotope.

The values assigned to the various enum members are used to specify the columsn in the GUI table view. They are also used to access substrings in the proper order in the Isotope::initialize().

ConstantValueDescription
MsXpS::libXpertMass::IsotopeFields::ID0Indicates Isotope::m_id.
MsXpS::libXpertMass::IsotopeFields::ELEMENT1Indicates Isotope::m_element.
MsXpS::libXpertMass::IsotopeFields::SYMBOL2Indicates the Isotope::m_symbol.
MsXpS::libXpertMass::IsotopeFields::ATOMIC_NUMBER3Indicates the Isotope::m_atomicNo.
MsXpS::libXpertMass::IsotopeFields::MASS4Indicates the Isotope::m_mass.
MsXpS::libXpertMass::IsotopeFields::MASS_NUMBER5Indicates the Isotope::m_massNo.
MsXpS::libXpertMass::IsotopeFields::EXTRA_NEUTRONS6Indicates the Isotope::m_extraNeutrons.
MsXpS::libXpertMass::IsotopeFields::PROBABILITY7Indicates the Isotope::m_probability.
MsXpS::libXpertMass::IsotopeFields::LN_PROBABILITY8Indicates the Isotope::m_lnProbability.
MsXpS::libXpertMass::IsotopeFields::RADIOACTIVE9Indicates the Isotope::m_radioactive.

enum class libXpertMass::IsotopicDataType

This enum specifies the type of isotopic data.

ConstantValueDescription
MsXpS::libXpertMass::IsotopicDataType::NOT_SET0: Not configured. .
MsXpS::libXpertMass::IsotopicDataType::LIBRARY_CONFIG1: The isotopic data are loaded intact from the IsoSpec library data and are considered pristine natural abundance data. .
MsXpS::libXpertMass::IsotopicDataType::USER_CONFIG2: The isotopic data are in the same format as for LIBRARY_CONFIG but might have been modified by the user to configure new abundances. .
MsXpS::libXpertMass::IsotopicDataType::MANUAL_CONFIG3: The isotopic data are in a specific format, different than the two above, that actually crafts the isotopes starting from scratch.

enum class libXpertMass::MassPeakShapeType

This enum specifies the type of mass peak shape to be computed around a m/z peak centroid.

ConstantValueDescription
MsXpS::libXpertMass::MassPeakShapeType::GAUSSIAN1The peak will be shaped using the Gaussian model.
MsXpS::libXpertMass::MassPeakShapeType::LORENTZIAN2The peak will be shaped using the Lorentizan model.

enum class libXpertMass::MassPeakWidthLogic

This enum specifies the logic used to computed the width of the mass peak shape around a m/z peak centroid.

ConstantValueDescription
MsXpS::libXpertMass::MassPeakWidthLogic::FWHM1The full width at half maximum is directly used to compute the peak shape width.
MsXpS::libXpertMass::MassPeakWidthLogic::RESOLUTION2The resolving power of the instrument is the starting point to compute the FWHM.

enum libXpertMass::MassToleranceType

This enum type specifies the kind of mass tolerance to use for a mass calculation or a mass comparison.

ConstantValueDescription
MsXpS::libXpertMass::MASS_TOLERANCE_NONE0The tolerance is not specified
MsXpS::libXpertMass::MASS_TOLERANCE_PPM1The tolerance is based on parts per million
MsXpS::libXpertMass::MASS_TOLERANCE_MZ2The tolerance is based on an absolute m/z value
MsXpS::libXpertMass::MASS_TOLERANCE_AMU3The tolerance is based on an absolute mass value
MsXpS::libXpertMass::MASS_TOLERANCE_RES4The tolerance is based on resolution

enum libXpertMass::MassType

This enum type specifies the type of mass:

ConstantValueDescription
MsXpS::libXpertMass::MASS_NONE0x0000The mass type is not defined
MsXpS::libXpertMass::MASS_MONO1 << 0The mass is monoisotopic
MsXpS::libXpertMass::MASS_AVG1 << 1The mass is average
MsXpS::libXpertMass::MASS_BOTH(MASS_MONO | MASS_AVG)(MASS_MONO | MASS_AVG)

enum libXpertMass::MonomerChemEnt

This enum specifies the monomer chemical entities to account for in a calculation.

This enum is typically used when mass calculations need to account or not for the various chemical entities that are attached to a given monomer.

ConstantValueDescription
MsXpS::libXpertMass::MONOMER_CHEMENT_NONE0 << 1The monomer chemical entity is not defined.
MsXpS::libXpertMass::MONOMER_CHEMENT_MODIF1 << 1The monomer modifications
MsXpS::libXpertMass::MONOMER_CHEMENT_CROSS_LINK1 << 2The monomer cross-links

enum libXpertMass::PolymerChemEnt

This enum specifies the polymer sequence chemical entities to account for in a calculation.

This enum is typically used when mass calculations need to account or not for the various chemical entities that are attached to a given polymer.

ConstantValueDescription
MsXpS::libXpertMass::POLYMER_CHEMENT_NONE1 << 0The polymer chemical entity is not defined.
MsXpS::libXpertMass::POLYMER_CHEMENT_LEFT_END_MODIF1 << 1The left end modification
MsXpS::libXpertMass::POLYMER_CHEMENT_FORCE_LEFT_END_MODIF1 << 2The left end modification, even if that polymer's end is not selected
MsXpS::libXpertMass::POLYMER_CHEMENT_RIGHT_END_MODIF1 << 3The right end modification
MsXpS::libXpertMass::POLYMER_CHEMENT_FORCE_RIGHT_END_MODIF1 << 4The right end modification, even if that polymer's end is not selected
MsXpS::libXpertMass::POLYMER_CHEMENT_BOTH_END_MODIF(POLYMER_CHEMENT_LEFT_END_MODIF | POLYMER_CHEMENT_RIGHT_END_MODIF)(POLYMER_CHEMENT_LEFT_END_MODIF | POLYMER_CHEMENT_RIGHT_END_MODIF)
MsXpS::libXpertMass::POLYMER_CHEMENT_FORCE_BOTH_END_MODIF(POLYMER_CHEMENT_FORCE_LEFT_END_MODIF | POLYMER_CHEMENT_FORCE_RIGHT_END_MODIF)(POLYMER_CHEMENT_FORCE_LEFT_END_MODIF | POLYMER_CHEMENT_FORCE_RIGHT_END_MODIF)

enum libXpertMass::PolymerEnd

This enum specifies the polymer end.

ConstantValueDescription
MsXpS::libXpertMass::END_NONE0 << 1Not defined
MsXpS::libXpertMass::END_LEFT1 << 1The left end
MsXpS::libXpertMass::END_RIGHT2 << 1The right end
MsXpS::libXpertMass::END_BOTH(END_LEFT | END_RIGHT)(END_LEFT | END_RIGHT)

enum libXpertMass::SelectionType

This enum specifies the selection type in a polymer sequence.

ConstantValueDescription
MsXpS::libXpertMass::SELECTION_TYPE_RESIDUAL_CHAINS0The selection comprises only residues
MsXpS::libXpertMass::SELECTION_TYPE_OLIGOMERS1The selection comprises oligomers, that is, residual chains capped with the left and right caps.

Variable Documentation

int libXpertMass::ATOM_DEC_PLACES

Number of decimal places after the decimal symbol for atom masses.

int libXpertMass::FWHM_PEAK_SPAN_FACTOR

This variable holds the compounding factor to account for when shaping the sides of the peak.

The shape of the peak needs to reflect a real mass peak. In particular, the shape of the peak has to return, on each one of both sides, to the baseline, thus mimicking the baseline for a m/z distance equivalent to FWHM_PEAK_SPAN_FACTOR times the FWHM m/z range from left to right. That means that the simulated peak region at the left hand side of the centroid value will span (FWHM_PEAK_SPAN_FACTOR/2) times the FWHM and the same one right. Empirically, a good FWHM_PEAK_SPAN_FACTOR is 4, meaning that the left half of the peak (that is centered on the centroid) will have a size corresponding to two times the FHWM, and the same for the right half of the peak.

This is best exemplified as follows:

                    Centroid value
                     ^
                     |
[ m/z - (2 * FWHM) <-|-> m/z + (2 * FWHM) ]
<----- width of the whole peak shape ----->

int libXpertMass::OLIGOMER_DEC_PLACES

Number of decimal places after the decimal symbol for oligomer masses.

int libXpertMass::PH_PKA_DEC_PLACES

Number of decimal places after the decimal symbol for pH/pKa values.

int libXpertMass::POLYMER_DEC_PLACES

Number of decimal places after the decimal symbol for polymer masses.

const int libXpertMass::POL_CHEM_DEF_FILE_FORMAT_VERSION

This variable holds the latest version of the format of the file containing the polymer chemistry definition.

Brought to 1 20230130 for massXpert2

const int libXpertMass::POL_SEQ_FILE_FORMAT_VERSION

Version number of the polymer sequence file format.

int libXpertMass::gEndOfLineRegExp

Regular expression that matches the end of line in text files.

int libXpertMass::gXyFormatMassDataRegExp

Regular expression that matches the m/z,i pairs in text files.

int libXpertMass::massToleranceTypeMap

Map relating the MassToleranceType to a textual representation

int libXpertMass::subFormulaRegExp

Regular expression used to deconstruct the main formula into minus and plus component subformulas.

"([+-]?)([A-Z][a-z]*)(\\d*[\\.]?\\d*)"

See also Formula::splitActionParts().

Function Documentation

int libXpertMass::addPpm(double value, double ppm)

Returns value incremented by the matching ppm part.

int libXpertMass::addRes(double value, double res)

Returns value incremented by the matching res part.

int libXpertMass::almostEqual(double value1, double value2, int decimal_places = 10)

Returns true if both double values value1 and value2, are equal within the double representation capabilities of the platform, false otherwise.

In the comparison, the decimal_places are taken into account.

int libXpertMass::countZeroDecimals(double value)

Returns the number of zero decimals in value that are found between the decimal point and the first non-zero decimal.

For example, 0.11 would return 0 (no empty decimal)

2.001 would return 2

1000.0001254 would return 3

int libXpertMass::doubleListStatistics(int list, double *sum, double *average, double *variance, double *stdDeviation, double *nonZeroSmallest, double *smallest, double *smallestMedian, double *greatest)

Returns the average of the list of double values.

All the values in list are process in order to compute the following:

statistical values if the corresponding parameters are non-nullptr.

See also doubleVectorStatistics().

int libXpertMass::ppm(double value, double ppm)

Returns the delta value corresponding to value and ppm part-per-million.

int libXpertMass::removePpm(double value, double ppm)

Returns value decremented by the matching ppm part.

int libXpertMass::removeRes(double value, double res)

Returns value decremented by the matching res part.

int libXpertMass::res(double value, double res)

Return the delta corresponding to value and resolution res.