11#include <OpenMS/OpenMSConfig.h>
129 Adduct(
Int charge,
Int amount,
double singleMass,
const std::string& formula,
double log_prob,
double rt_shift,
const std::string& label =
"");
One elementary adduct contribution to a feature's ionization state.
Definition Adduct.h:87
const double & getRTShift() const
RT shift induced by one entity (seconds). Non-zero only for adducts attached prior to ESI (e....
void setLogProb(const double &log_prob)
Set the log-prior on observing this adduct.
Adduct operator+(const Adduct &rhs)
Sum two Adducts that describe the same chemical entity.
Adduct()
Default constructor. All numeric fields zero-initialised; formula and label empty....
std::string label_
free-form tag (e.g. heavy-isotope label name)
Definition Adduct.h:286
double log_prob_
log-prior on observing this adduct
Definition Adduct.h:283
void setCharge(const Int &charge)
Set the per-entity charge.
Adduct operator*(const Int m) const
Multiply the stoichiometric amount by an integer factor.
friend bool operator==(const Adduct &a, const Adduct &b)
Equality on charge, amount, singleMass, log_prob, and formula. Deliberately ignores rt_shift and labe...
void setFormula(const std::string &formula)
Set the chemical formula of one entity. The input is parsed as an EmpiricalFormula and re-emitted in ...
void setAmount(const Int &amount)
Set the stoichiometric count. Logs a warning on negative values but accepts them.
const double & getSingleMass() const
Monoisotopic mass of one entity (Dalton).
std::string checkFormula_(const std::string &formula)
std::string toAdductString(const std::string &ion_string, const Int &charge)
Render ion_string + charge as a canonical adduct string, assuming a monomer (n=1).
const Int & getAmount() const
Stoichiometric count of this adduct in the ion.
Adduct(Int charge, Int amount, double singleMass, const std::string &formula, double log_prob, double rt_shift, const std::string &label="")
Construct with all fields populated.
const Int & getCharge() const
Per-entity charge; +1 for typical cation adducts (Na+, H+).
void operator+=(const Adduct &rhs)
In-place version of operator+. Same precondition (matching formulas).
Adduct(Int charge)
Construct with only the per-entity charge set.
const std::string & getLabel() const
Free-form label (typically a heavy-isotope tag).
double rt_shift_
RT shift induced by one entity (s); non-zero only for pre-ESI labels.
Definition Adduct.h:285
friend std::ostream & operator<<(std::ostream &os, const Adduct &a)
std::vector< Adduct > AdductsType
Convenience typedef for a list of Adducts (used by feature deconvolution).
Definition Adduct.h:91
void setSingleMass(const double &singleMass)
Set the monoisotopic mass of one entity.
std::string formula_
chemical formula of one entity (EmpiricalFormula-parseable, canonicalised)
Definition Adduct.h:284
static std::string toAdductString(const std::string &ion_string, const Int &charge, Int mol_multiplier)
Render ion_string + charge as a canonical adduct string, with an explicit n-mer multiplier.
double singleMass_
monoisotopic mass of one entity (Da)
Definition Adduct.h:282
const double & getLogProb() const
Log-prior on observing this adduct.
Int amount_
stoichiometric count of this entity
Definition Adduct.h:281
Int charge_
per-entity charge (e.g. +1 for Na+)
Definition Adduct.h:280
const std::string & getFormula() const
Chemical formula of one entity (canonicalised by EmpiricalFormula, e.g. "H2O" — not "OH2").
int Int
Signed integer type.
Definition Types.h:72
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
std::size_t hash_int(T value) noexcept
Hash for an integer type.
Definition HashUtils.h:107
void hash_combine(std::size_t &seed, std::size_t value) noexcept
Combine a hash value with additional data using golden ratio mixing.
Definition HashUtils.h:87
std::size_t hash_float(T value) noexcept
Hash for a floating point type (float or double).
Definition HashUtils.h:142
std::size_t fnv1a_hash_string(const std::string &s) noexcept
FNV-1a hash for a string.
Definition HashUtils.h:70
std::size_t operator()(const OpenMS::Adduct &a) const noexcept
Definition Adduct.h:306