IsoSpec  2.1.2
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
IsoSpec::Iso Class Reference

The Iso class for the calculation of the isotopic distribution. More...

#include <isoSpec++.h>

Inheritance diagram for IsoSpec::Iso:
IsoSpec::IsoGenerator IsoSpec::IsoLayeredGenerator IsoSpec::IsoOrderedGenerator IsoSpec::IsoStochasticGenerator IsoSpec::IsoThresholdGenerator

Public Member Functions

 Iso (int _dimNumber, const int *_isotopeNumbers, const int *_atomCounts, const double *_isotopeMasses, const double *_isotopeProbabilities)
 General constructror. More...
 
 Iso (int _dimNumber, const int *_isotopeNumbers, const int *_atomCounts, const double *const *_isotopeMasses, const double *const *_isotopeProbabilities)
 
 Iso (const char *formula, bool use_nominal_masses=false)
 Constructor from the formula object.
 
 Iso (const std::string &formula, bool use_nominal_masses=false)
 Constructor from C++ std::string chemical formula.
 
 Iso (Iso &&other)
 The move constructor.
 
Isooperator= (const Iso &other)=delete
 
 Iso (const Iso &other, bool fullcopy)
 The copy constructor. More...
 
virtual ~Iso ()
 Destructor.
 
double getLightestPeakMass () const
 Get the mass of the lightest peak in the isotopic distribution.
 
double getHeaviestPeakMass () const
 Get the mass of the heaviest peak in the isotopic distribution.
 
double getMonoisotopicPeakMass () const
 
double getModeLProb () const
 Get the log-probability of the mode-configuration (if there are many modes, they share this value).
 
double getUnlikeliestPeakLProb () const
 Get the logprobability of the least probable subisotopologue.
 
double getModeMass () const
 Get the mass of the mode-configuration (if there are many modes, it is undefined which one will be selected).
 
double getTheoreticalAverageMass () const
 Get the theoretical average mass of the molecule.
 
double variance () const
 Get the theoretical variance of the distribution.
 
double stddev () const
 Get the standard deviation of the theoretical distribution.
 
int getDimNumber () const
 Get the number of elements in the chemical formula of the molecule.
 
int getAllDim () const
 Get the total number of isotopes of elements present in a chemical formula.
 
void addElement (int atomCount, int noIsotopes, const double *isotopeMasses, const double *isotopeProbabilities)
 Add an element to the molecule. Note: this method can only be used BEFORE Iso is used to construct an IsoGenerator instance.
 
void saveMarginalLogSizeEstimates (double *priorities, double target_total_prob) const
 Save estimates of logarithms of target sizes of marginals using Gaussian approximation into argument array. Array priorities must have length equal to dimNumber.
 

Static Public Member Functions

static Iso FromFASTA (const char *fasta, bool use_nominal_masses=false, bool add_water=true)
 Constructor (named) from aminoacid FASTA sequence as C string. More...
 
static Iso FromFASTA (const std::string &fasta, bool use_nominal_masses=false, bool add_water=true)
 Constructor (named) from aminoacid FASTA sequence as C++ std::string. See above for details.
 

Protected Member Functions

bool doMarginalsNeedSorting () const
 

Protected Attributes

int dimNumber
 
int * isotopeNumbers
 
int * atomCounts
 
unsigned int confSize
 
int allDim
 
Marginal ** marginals
 

Detailed Description

The Iso class for the calculation of the isotopic distribution.

It contains full description of the molecule for which one would like to calculate the isotopic distribution.

Definition at line 49 of file isoSpec++.h.

Constructor & Destructor Documentation

◆ Iso() [1/2]

IsoSpec::Iso::Iso ( int  _dimNumber,
const int *  _isotopeNumbers,
const int *  _atomCounts,
const double *  _isotopeMasses,
const double *  _isotopeProbabilities 
)

General constructror.

Parameters
_dimNumberThe number of elements in the formula, e.g. for C100H202 it would be 2, as there are only carbon and hydrogen atoms.
_isotopeNumbersA table with numbers of isotopes for each element, e.g. for C100H202 it would be {2, 2}, because both C and H have two stable isotopes.
_atomCountsNumber of atoms of each element in the formula, e.g. for C100H202 corresponds to {100, 202}.
_isotopeMassesA table of tables of masses of isotopes of the elements in the chemical formula, e.g. {{12.0, 13.003355}, {1.007825, 2.014102}} for C100H202.
_isotopeProbabilitiesA table of tables of isotope frequencies of the elements in the chemical formula, e.g. {{.989212, .010788}, {.999885, .000115}} for C100H202.

Definition at line 109 of file isoSpec++.cpp.

◆ Iso() [2/2]

IsoSpec::Iso::Iso ( const Iso other,
bool  fullcopy 
)

The copy constructor.

Parameters
otherThe other instance of the Iso class.
fullcopyIf false, copy only the number of atoms in the formula, the size of the configuration, the total number of isotopes, and the probability of the mode isotopologue.

Definition at line 153 of file isoSpec++.cpp.

Member Function Documentation

◆ FromFASTA()

Iso IsoSpec::Iso::FromFASTA ( const char *  fasta,
bool  use_nominal_masses = false,
bool  add_water = true 
)
static

Constructor (named) from aminoacid FASTA sequence as C string.

Parameters
fastaAn aminoacid FASTA sequence. May be upper/lower/mixed case, may contain selenocystein (U) or xleucine (J). Other characters, including FASTA codes of indeterminate chemical formula (X, *, -, B, ...) are silently ignored. That means "AEDA", "AE-DA", "EAXXDA", "AE DA" will all result in the same chemical formula. Subisotopologues will be in order: CHNOS, possibly with Se added at an end if present. \use_nominal_masses Whether to use nucleon number instead of the real mass of each isotope during calculations. \add_water Whether the chain should have the terminating -H and -OH groups at the N and C terminus, respectively.

Definition at line 169 of file isoSpec++.cpp.

◆ getMonoisotopicPeakMass()

double IsoSpec::Iso::getMonoisotopicPeakMass ( ) const

Get the mass of the monoisotopic peak in the isotopic distribution. Monoisotopc molecule is defined as consisting only of the most frequent isotopes of each element. These are often (but not always) the lightest ones, making this often (but again, not always) equal to getLightestPeakMass()

Definition at line 261 of file isoSpec++.cpp.

Member Data Documentation

◆ allDim

int IsoSpec::Iso::allDim
protected

The total number of isotopes of elements present in a chemical formula, e.g. for H20 it is 2+3=5.

Definition at line 67 of file isoSpec++.h.

◆ atomCounts

int* IsoSpec::Iso::atomCounts
protected

A table with numbers of isotopes for each element.

Definition at line 65 of file isoSpec++.h.

◆ confSize

unsigned int IsoSpec::Iso::confSize
protected

The number of bytes needed to represent the counts of isotopes present in the extended chemical formula.

Definition at line 66 of file isoSpec++.h.

◆ dimNumber

int IsoSpec::Iso::dimNumber
protected

The number of elements in the chemical formula of the molecule.

Definition at line 63 of file isoSpec++.h.

◆ isotopeNumbers

int* IsoSpec::Iso::isotopeNumbers
protected

A table with numbers of isotopes for each element.

Definition at line 64 of file isoSpec++.h.

◆ marginals

Marginal** IsoSpec::Iso::marginals
protected

The table of pointers to the distributions of individual subisotopologues.

Definition at line 68 of file isoSpec++.h.


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