IsoSpec::Marginal(3)

๐Ÿ“ฆ
version 2.3.2 ยท 4 versions
, in ubuntu resolute, ubuntu stonking

๐Ÿ’– NAME ๐Ÿ’–

IsoSpec::Marginal โ€” the marginal distribution class (a subisotopologue). ๐Ÿฆ‹ no cap, that's the whole vibe of this page, bestie.

This one lives in the Library Functions Manual, section 3, and it's all about the IsoSpec C++ library. Grab a snack, we're going deep ๐Ÿ’…


โœจ SYNOPSIS โœจ

#include <marginalTrek++.h>

Inherited by IsoSpec::LayeredMarginal, IsoSpec::LoggingMarginal< T >, IsoSpec::MarginalTrek, IsoSpec::PrecalculatedMarginal, and IsoSpec::SingleAtomMarginal< add_guards >.

๐ŸŒธ Public Member Functions ๐ŸŒธ

  • Marginal (const double *_masses, const double *_probs, int _isotopeNo, int _atomCnt) โ€” the class constructor, the origin story, the main character intro ๐ŸŽฌ
  • Marginal & operator= (const Marginal &other)=delete โ€” the copy-assign operator, and nope, it's deleted. Not available. Gone. Periodt.
  • Marginal (const Marginal &other) โ€” copy constructor ๐Ÿซถ
  • Marginal (Marginal &&other) โ€” move constructor ๐Ÿš€
  • virtual ~Marginal () โ€” destructor, the farewell arc ๐Ÿ˜ญ
  • int get_isotopeNo () const โ€” get the number of isotopes of the investigated element
  • const double * get_lProbs () const โ€” hands you back the log-probs pointer, no further comment given ๐Ÿ™ˆ
  • double getLightestConfMass () const โ€” get the mass of the lightest subisotopologue ๐Ÿชถ
  • double getHeaviestConfMass () const โ€” get the mass of the heaviest subisotopologue ๐Ÿ‹๏ธ
  • double getMonoisotopicConfMass () const โ€” get the mass of the monoisotopic subisotopologue
  • size_t getMonoisotopicAtomIndex () const โ€” get the index of the monoisotopic (most probable) atom ๐Ÿ‘‘
  • double getModeMass () โ€” the the mass of the mode subisotopologue
  • double getModeLProb () โ€” get the log-probability of the mode subisotopologue
  • double fastGetModeLProb () โ€” get the log-probability of the mode subisotopologue, but โš ๏ธ results are undefined if ensureModeConf() wasn't called before
  • Conf computeModeConf () const โ€” the the probability of the mode subisotopologue
  • double getSmallestLProb () const โ€” the the log-probability of the lightest subisotopologue
  • double getAtomAverageMass () const โ€” the average mass of a single atom
  • double getTheoreticalAverageMass () const โ€” the theoretical average mass of the molecule
  • double variance () const โ€” calculate the variance of the theoretical distribution describing the subisotopologue
  • double getLogSizeEstimate (double logEllipsoidRadius) const โ€” return estimated logarithm of size of the marginal at a given ellipsoid radius
  • void ensureModeConf () โ€” the setup step your girl fastGetModeLProb() is literally begging you to call first

๐ŸŽ€ Protected Member Functions ๐ŸŽ€

  • ISOSPEC_FORCE_INLINE double unnormalized_logProb (Conf conf) const โ€” calculate the log-probability of a given subisotopologue
  • ISOSPEC_FORCE_INLINE double logProb (Conf conf) const โ€” the inline one, no blurb attached, it's mysterious like that ๐Ÿ’€

๐Ÿงš Protected Attributes ๐Ÿงš

  • const unsigned int isotopeNo โ€” how many isotopes the element has
  • const unsigned int atomCnt โ€” how many atoms of that element you've got
  • const double *const atom_lProbs โ€” the log-prob table
  • const double *const atom_masses โ€” the mass table
  • const double loggamma_nominator โ€” the constant one, the multinomial math girlie
  • Conf mode_conf โ€” the mode subisotopologue herself
  • double mode_lprob โ€” her log-probability

๐Ÿ”ฅ Detailed Description ๐Ÿ”ฅ

The marginal distribution class (a subisotopologue). That's the whole name, we love a self-titled icon โœจ

So like โ€” this class mostly provides some basic common API for subclasses, but itself is not abstract. She's concrete. She's real. This class represents the probability distribution generated by one element only โ€” a subisotopologue. For instance, it might be the distribution of C200, that might be part of, say, C200H402. It corresponds to the multinomial distribution, where each configuration can also be attributed a precise mass. The constructor method perform initial hill-climbing to find the most probable sub-isotopologue (the mode). ๐Ÿ”๏ธ climb that hill, bestie.

Definition at line 43 of file marginalTrek++.h.

๐Ÿ› ๏ธ Constructor & Destructor Documentation ๐Ÿ› ๏ธ

IsoSpec::Marginal::Marginal (const double * _masses, const double * _probs, int _isotopeNo, int _atomCnt)

Class constructor. The birth scene ๐Ÿ’ซ

Parameters

  • _masses โ€” a table of masses of the stable isotopes of the investigated element, e.g. for C10 it is 2: C12 and C13.
  • _probs โ€” a table of natural frequencies of the stable isotopes of the investigated element, see IUPAC at https://iupac.org/isotopesmatter/
  • _isotopeNo โ€” number of isotopes of a given element.
  • _atomCnt โ€” the number of atoms of the given element, e.g. 10 for C10.

Returns

An instance of the Marginal class. ๐Ÿซถ

Definition at line 165 of file marginalTrek++.cpp.

IsoSpec::Marginal::Marginal (const Marginal & other)

Copy constructor. Making a twin, a little clone, iconic behaviour ๐Ÿ’…

Definition at line 181 of file marginalTrek++.cpp.

IsoSpec::Marginal::Marginal (Marginal && other)

Move constructor. She's moving out, taking the data with her, no forwarding address ๐Ÿšš

Definition at line 203 of file marginalTrek++.cpp.

IsoSpec::Marginal::~Marginal () [virtual]

Destructor. Saying goodbye, wiping the tears ๐Ÿ˜ญ

Definition at line 224 of file marginalTrek++.cpp.

๐Ÿ’œ Member Function Documentation ๐Ÿ’œ

Conf IsoSpec::Marginal::computeModeConf () const

The the probability of the mode subisotopologue. (Yes, "the the", that's the original's whole thing, we respect the source ๐Ÿ’€)

Returns

The probability of a/the most probable subisotopologue. Computes and returns the mode configuration, a isotopeNo-large array that the caller is responsible for delete[]-ing.

โš ๏ธ Bestie, listen: YOU are the one who has to delete[] that array. It's your responsibility. Do not forget. I'm watching. ๐Ÿ‘€
Definition at line 235 of file marginalTrek++.cpp.

void IsoSpec::Marginal::ensureModeConf () [inline]

Just the definition, no description, she's lowkey mysterious.

Definition at line 176 of file marginalTrek++.h.

double IsoSpec::Marginal::fastGetModeLProb () [inline]

Get the log-probability of the mode subisotopologue. Results undefined if ensureModeConf() wasn't called before. ๐Ÿšจ

Definition at line 132 of file marginalTrek++.h.

int IsoSpec::Marginal::get_isotopeNo () const [inline]

Get the number of isotopes of the investigated element.

Returns

The integer number of isotopes of the investigated element. ๐Ÿ”ข

Definition at line 89 of file marginalTrek++.h.

const double * IsoSpec::Marginal::get_lProbs () const [inline]

No description given. It just returns the pointer. Silent, powerful, main character energy โœจ

Definition at line 91 of file marginalTrek++.h.

double IsoSpec::Marginal::getAtomAverageMass () const

The average mass of a single atom.

Returns

The average mass of a single atom. (Yes, the returns blurb and the summary are the same sentence. She said what she said. ๐Ÿ’…)

Definition at line 287 of file marginalTrek++.cpp.

double IsoSpec::Marginal::getHeaviestConfMass () const

Get the mass of the heaviest subisotopologue. This is trivially obtained by considering all atomNo atoms to be the heaviest isotope possible.

Returns

The mass of the heaviest subisotopologue. ๐Ÿ‹๏ธ

Definition at line 259 of file marginalTrek++.cpp.

double IsoSpec::Marginal::getLightestConfMass () const

Get the mass of the lightest subisotopologue. This is trivially obtained by considering all atomNo atoms to be the lightest isotope possible.

Returns

The mass of the lightiest subisotopologue. (Their typo, not mine, I'm just the messenger ๐Ÿซก)

Definition at line 250 of file marginalTrek++.cpp.

double IsoSpec::Marginal::getLogSizeEstimate (double logEllipsoidRadius) const

Return estimated logarithm of size of the marginal at a given ellipsoid radius.

Definition at line 307 of file marginalTrek++.cpp.

double IsoSpec::Marginal::getModeLProb () [inline]

Get the log-probability of the mode subisotopologue.

Returns

The log-probability of a/the most probable subisotopologue. ๐Ÿ‘‘

Definition at line 129 of file marginalTrek++.h.

double IsoSpec::Marginal::getModeMass () [inline]

The the mass of the mode subisotopologue.

Returns

The mass of one of the most probable subisotopologues. Note: one of โ€” if there's a tie she's not picking favourites ๐Ÿ’…

Definition at line 123 of file marginalTrek++.h.

size_t IsoSpec::Marginal::getMonoisotopicAtomIndex () const

Get the index of the monoisotopic (most probable) atom.

Returns

The index of the most probable isotope of the element. ๐ŸŒŸ

Definition at line 268 of file marginalTrek++.cpp.

double IsoSpec::Marginal::getMonoisotopicConfMass () const

Get the mass of the monoisotopic subisotopologue. The monoisotopic subisotopologue is defined as the molecule consiting only of the most likely isotope. This is frequently the lightest subisotopologue, making this frequently (but not always) equal to getLightestConfMass().

โš ๏ธ "frequently (but not always)" โ€” do NOT assume they're the same thing. That's a trap and it's giving chaos ๐ŸŒช๏ธ
Definition at line 281 of file marginalTrek++.cpp.

double IsoSpec::Marginal::getSmallestLProb () const [inline]

The the log-probability of the lightest subisotopologue.

Returns

The logarithm of the smallest non-zero probability of a subisotopologue. ๐Ÿ”ฌ

Definition at line 147 of file marginalTrek++.h.

double IsoSpec::Marginal::getTheoreticalAverageMass () const [inline]

The theoretical average mass of the molecule.

Returns

The theoretical average mass of the molecule. ๐Ÿงฎ

Definition at line 159 of file marginalTrek++.h.

ISOSPEC_FORCE_INLINE double IsoSpec::Marginal::logProb (Conf conf) const [inline], [protected]

No description. Protected. Off-limits unless you're family ๐Ÿšซ

Definition at line 168 of file marginalTrek++.h.

ISOSPEC_FORCE_INLINE double IsoSpec::Marginal::unnormalized_logProb (Conf conf) const [inline], [protected]

Calculate the log-probability of a given subisotopologue.

Parameters

  • conf โ€” a subisotopologue (a table of integers describing subsequent isotope-counts).

Returns

The log-probability of the input subisotopologue. โœจ

Definition at line 167 of file marginalTrek++.h.

double IsoSpec::Marginal::variance () const

Calculate the variance of the theoretical distribution describing the subisotopologue.

Definition at line 295 of file marginalTrek++.cpp.

๐Ÿ“ Member Data Documentation ๐Ÿ“

const double* const IsoSpec::Marginal::atom_lProbs [protected]

Table of log-probabilities of all the isotopeNo isotopes.

Definition at line 50 of file marginalTrek++.h.

const double* const IsoSpec::Marginal::atom_masses [protected]

Table of atomic masses of all the isotopeNo isotopes.

Definition at line 51 of file marginalTrek++.h.

const unsigned int IsoSpec::Marginal::atomCnt [protected]

The number of atoms of the given element.

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

const unsigned int IsoSpec::Marginal::isotopeNo [protected]

The number of isotopes of the given element.

Definition at line 48 of file marginalTrek++.h.

const double IsoSpec::Marginal::loggamma_nominator [protected]

The constant nominator that appears in the expressions for the multinomial probabilities.

Definition at line 52 of file marginalTrek++.h.

Conf IsoSpec::Marginal::mode_conf [protected]

A subisotopologue with most probability. If not unique, one of the representatives of that class of subisotopologues. ๐Ÿ‘‘

Definition at line 53 of file marginalTrek++.h.

double IsoSpec::Marginal::mode_lprob [protected]

The log-probability of the mode subisotopologue.

Definition at line 54 of file marginalTrek++.h.

๐Ÿฆ„ Author ๐Ÿฆ„

Generated automatically by Doxygen for IsoSpec from the source code. So like, a robot wrote this, not me, I just did the glow-up ๐Ÿ’…โœจ


okay that's the whole page bestie, you ate that, go compile something iconic ๐ŸŒˆ

This was IsoSpec::Marginal(3) out of the IsoSpec source, straight from the Doxygen-generated Library Functions Manual โ€” no date stamped on this footer, so don't come for me about timestamps, it's giving undated and unbothered ๐Ÿซถ mwah ๐Ÿ’–

๐Ÿ“ฆ where this page comes from