16 #include <OpenMS/OpenMSConfig.h>
173 const float mass_to_explain,
174 const float mass_delta,
175 const float thresh_log_p,
176 std::vector<Compomer>::const_iterator& firstExplanation,
177 std::vector<Compomer>::const_iterator& lastExplanation)
const;
std::vector< Adduct > AdductsType
Definition: Adduct.h:22
Holds information on an edge connecting two features from a (putative) charge ladder.
Definition: Compomer.h:49
Computes empirical formulas for given mass differences using a set of allowed elements.
Definition: MassExplainer.h:39
MassExplainer(AdductsType adduct_base)
Constructor with custom adduct base.
Adduct createAdduct_(const String &formula, const Int charge, const double p) const
Create a proper adduct from formula, charge, and probability.
Int q_max_
Maximum charge state to consider in explanations.
Definition: MassExplainer.h:208
MassExplainer & operator=(const MassExplainer &rhs)
Assignment operator.
void compute()
Compute all possible mass differences and their explanations.
Int q_min_
Minimum charge state to consider in explanations.
Definition: MassExplainer.h:205
SignedSize query(const Int net_charge, const float mass_to_explain, const float mass_delta, const float thresh_log_p, std::vector< Compomer >::const_iterator &firstExplanation, std::vector< Compomer >::const_iterator &lastExplanation) const
Search for explanations of a given mass difference.
const Compomer & getCompomerById(Size id) const
Get a specific compomer by its ID.
AdductsType getAdductBase() const
Get the current set of allowed adducts.
AdductsType adduct_base_
Set of allowed adducts that can be combined to explain mass differences.
Definition: MassExplainer.h:202
void init_(bool init_thresh_p)
Check consistency of input parameters and initialize internal data structures.
MassExplainer(Int q_min, Int q_max, Int max_span, double thresh_logp)
Constructor with custom charge parameters.
MassExplainer(AdductsType adduct_base, Int q_min, Int q_max, Int max_span, double thresh_logp, Size max_neutrals)
Constructor with all custom parameters.
void setAdductBase(AdductsType adduct_base)
Set the base set of allowed adducts.
Size max_neutrals_
Maximum number of neutral (q=0) adducts allowed in an explanation.
Definition: MassExplainer.h:217
double thresh_p_
Minimum required probability threshold for accepting explanations.
Definition: MassExplainer.h:214
Int max_span_
Maximum allowed charge span between related features (e.g., a cluster with q={3,6} has span=4)
Definition: MassExplainer.h:211
virtual ~MassExplainer()
Destructor.
MassExplainer()
Default constructor.
std::vector< Compomer > explanations_
Vector storing all possible explanations for mass differences.
Definition: MassExplainer.h:199
bool compomerValid_(const Compomer &cmp) const
Check if a generated compomer is valid based on its probability, charges, etc.
Adduct::AdductsType AdductsType
Type definition for a vector of Adduct objects.
Definition: MassExplainer.h:44
std::vector< Compomer >::const_iterator CompomerIterator
Type definition for an iterator over Compomer objects.
Definition: MassExplainer.h:47
A more convenient string class.
Definition: String.h:34
int Int
Signed integer type.
Definition: Types.h:72
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition: Types.h:104
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:97
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19