ISOSPEC_ISOORDEREDGENERATORTEMPLATE(3)
๐ IsoSpec::IsoOrderedGeneratorTemplate< MarginalType > โ Library Functions Manual ๐
okay bestie, buckle up, because this is a C++ template class from IsoSpec and it is literally the moment. We're in the Library Functions Manual (section 3, obviously), and this one is serving peak group-chat energy: it hands you isotopologues in order of how likely they are to exist. Iconic behaviour. ๐
โจ NAME โจ
IsoSpec::IsoOrderedGeneratorTemplate< MarginalType > โ the generator of isotopologues sorted by their probability of occurrence. Like a VIP list but for molecules, and the bouncer is a priority queue. ๐
๐ธ SYNOPSIS ๐ธ
#include <isoSpec++.h>
Inherits IsoSpec::IsoGenerator. So it's got a whole family tree, and it's eating. ๐ฆ
๐ Public Member Functions ๐
IsoOrderedGeneratorTemplate (const IsoOrderedGeneratorTemplate &other)=deleteโ nope, no copy constructor for you. deleted, periodt. ๐ซIsoOrderedGeneratorTemplate & operator= (const IsoOrderedGeneratorTemplate &other)=deleteโ and no copy-assignment either. it said "not today". ๐bool advanceToNextConfiguration () override finalโ move along to the next not-yet-visited, most probable isotopologue. the next most likely baddie steps up to the mic. ๐คvoid get_conf_signature (int *space) const override finalโ save the counts of isotopes intospace. it's giving "write it down so we don't forget". โ๏ธIsoOrderedGeneratorTemplate (Iso &&iso, int _tabSize=1000, int _hashSize=1000)โ the move-constructor. it moves, it doesn't copy. main character energy. ๐ซvirtual ~IsoOrderedGeneratorTemplate ()โ destructor. we love a clean exit. ๐ซถvoid get_conf_by_indexes (int *space)โ no description given, but it exists and it's here and we respect it. ๐
๐ง Public Member Functions inherited from IsoSpec::IsoGenerator
virtual double lprob () constโ get the log-probability of the current isotopologue. maths but make it cute. ๐virtual double mass () constโ get the mass of the current isotopologue.virtual double prob () constโ get the probability of the current isotopologue.IsoGenerator (Iso &&iso, bool alloc_partials=true)โ move constructor.virtual ~IsoGenerator ()โ destructor.
๐ Public Member Functions inherited from IsoSpec::Iso
Iso (int _dimNumber, const int *_isotopeNumbers, const int *_atomCounts, const double *_isotopeMasses, const double *_isotopeProbabilities)โ the general constructor. the OG.Iso (int _dimNumber, const int *_isotopeNumbers, const int *_atomCounts, const double *const *_isotopeMasses, const double *const *_isotopeProbabilities)โ the same vibe, but the mass and probability arrays areconst-pointed-to-const. extra const, extra respect. โจ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 a C++std::stringchemical formula. same energy, more C++.Iso (Iso &&other)โ the move constructor.Iso & operator= (const Iso &other)=deleteโ deleted. not on the menu. ๐Iso (const Iso &other, bool fullcopy)โ the copy constructor. yes,fullcopyis a thing, and yes, it matters.virtual ~Iso ()โ destructor.double getLightestPeakMass () constโ get the mass of the lightest peak in the isotopic distribution. the little one. ๐double getHeaviestPeakMass () constโ get the mass of the heaviest peak in the isotopic distribution. the big one. ๐double getMonoisotopicPeakMass () constโ no extra description, but it gets you the monoisotopic peak mass and that's that.double getModeLProb () constโ get the log-probability of the mode-configuration. heads up: if there are many modes, they all share this value. ๐คdouble getUnlikeliestPeakLProb () constโ get the log-probability of the least probable subisotopologue. the underdog. ๐ญdouble getModeMass () constโ get the mass of the mode-configuration. ngl, if there are many modes, it is undefined which one will be selected. so don't come for it. โ ๏ธ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 BEFOREIsois used to construct anIsoGeneratorinstance. read it twice, bestie.void saveMarginalLogSizeEstimates (double *priorities, double target_total_prob) constโ save estimates of logarithms of target sizes of marginals, using a Gaussian approximation, into the argument array. ๐ the arrayprioritiesmust have length equal todimNumber.
๐ฆ Additional Inherited Members ๐ฆ
โญ Static Public Member Functions inherited from IsoSpec::Iso
static Iso FromFASTA (const char *fasta, bool use_nominal_masses=false, bool add_water=true)โ constructor (named) from an aminoacid FASTA sequence as a C string. ๐งฌstatic Iso FromFASTA (const std::string &fasta, bool use_nominal_masses=false, bool add_water=true)โ constructor (named) from an aminoacid FASTA sequence as a C++std::string. See above for details. yes bestie, same rules apply.
๐ Public Attributes inherited from IsoSpec::IsoGenerator
const double mode_lprobโ it'sconst, it's adouble, it's the mode's log-probability. respect the const. โจ
๐ Protected Member Functions inherited from IsoSpec::Iso
bool doMarginalsNeedSorting () constโ protected, mysterious, does exactly what it says on the tin.
๐ง Protected Attributes inherited from IsoSpec::IsoGenerator
double * partialLProbsdouble * partialMassesdouble * partialProbs
๐ Protected Attributes inherited from IsoSpec::Iso
int dimNumberint * isotopeNumbersint * atomCountsunsigned int confSizeint allDimMarginal ** marginals
๐ Detailed Description ๐
template<typename MarginalType>
class IsoSpec::IsoOrderedGeneratorTemplate< MarginalType >
"The generator of isotopologues sorted by their probability of occurrence."
The subsequent isotopologues are generated with diminishing probability, starting from the mode. So like, first one out is the most likely, and then it just keeps going down the list of "yeah that's less likely". ๐
This algorithm takes O(N*log(N)) to compute the N isotopologues, because of using the Priority Queue data structure. (the priority queue is doing a LOT of emotional labour here.) ๐ฎโ๐จ
Obtaining the N isotopologues can be achieved in O(N) if they are not required to be spit out in the descending order. so: sorted = O(N*log(N)), unsorted = O(N). pick your fighter. โ๏ธ
Definition at line 238 of file isoSpec++.h.
๐ธ Constructor & Destructor Documentation ๐ธ
template<typename MarginalType> IsoSpec::IsoOrderedGeneratorTemplate< MarginalType >::IsoOrderedGeneratorTemplate (Iso && iso, int _tabSize = 1000, int _hashSize = 1000)
The move-constructor. it MOVES. no copying, no drama. ๐ซ
Definition at line 821 of file isoSpec++.cpp.
template<typename MarginalType> IsoSpec::IsoOrderedGeneratorTemplate< MarginalType >::~IsoOrderedGeneratorTemplate () [virtual]
Destructor. say bye bestie, we're cleaning up. ๐
Definition at line 860 of file isoSpec++.cpp.
๐ Member Function Documentation ๐
template<typename MarginalType> bool IsoSpec::IsoOrderedGeneratorTemplate< MarginalType >::advanceToNextConfiguration () [final], [override], [virtual]
Advance to the next, not yet visited, most probable isotopologue. literally the whole point of this class. ๐ฏ
Returns
Return false if it is not possible to advance. (i.e. that's the end of the line, babe. ๐ฅฒ)
Implements IsoSpec::IsoGenerator.
Definition at line 871 of file isoSpec++.cpp.
template<typename MarginalType> void IsoSpec::IsoOrderedGeneratorTemplate< MarginalType >::get_conf_by_indexes (int * space) [inline]
No description given in the original, so we're just going to look at it and nod. ๐
Definition at line 291 of file isoSpec++.h.
template<typename MarginalType> void IsoSpec::IsoOrderedGeneratorTemplate< MarginalType >::get_conf_signature (int * space) const [inline], [final], [override], [virtual]
Save the counts of isotopes in the space. ๐พ
Parameters
space โ An array where counts of isotopes shall be written. โ ๏ธ It must be as big as the overall number of isotopes. do not play with this, bestie, it will not end well.
Implements IsoSpec::IsoGenerator.
Definition at line 263 of file isoSpec++.h.
๐ซถ Author ๐ซถ
Generated automatically by Doxygen for IsoSpec from the source code. no human wrote this, the robot did, and honestly? it ate. ๐คโจ
and that's the whole page, bestie!! this came out of IsoSpec, living in the Library Functions Manual, section 3 โ and the footer is just the title again (IsoSpec::I...inalType >(3)), so consider this your cute sign-off: IsoSpec, Library Functions Manual, page IsoSpec::I...inalType >(3). slay, go generate some isotopologues. ๐๐๐ฆ๐ธ๐
๐๐โญ
๐ฆ where this page comes from
- ubuntu resolute: libisospec++-dev 2.3.2-1build1 ยท BSD-2-Clause
- ubuntu stonking: libisospec++-dev 2.3.2-2 ยท BSD-2-Clause
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms