OpenMS
Loading...
Searching...
No Matches
AdductInfo.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Timo Sachsenberg $
6// $Authors: Erhan Kenar, Chris Bielow $
7// --------------------------------------------------------------------------
8
9#pragma once
10
13
14namespace OpenMS
15{
16 class OPENMS_DLLAPI AdductInfo
17 {
18 public:
28 AdductInfo(const String& name, const EmpiricalFormula& adduct, int charge, UInt mol_multiplier = 1);
29
31 double getNeutralMass(double observed_mz) const;
32
34 double getMZ(double neutral_mass) const;
35
37 double getMassShift(bool use_avg_mass = false) const;
38
42 bool isCompatible(const EmpiricalFormula& db_entry) const;
43
45 int getCharge() const;
46
48 const String& getName() const;
49
52
55
60 static AdductInfo parseAdductString(const String& adduct);
61
63 bool operator==(const AdductInfo& other) const;
64
65 private:
69 double mass_;
70 int charge_;
72 };
73}
Definition AdductInfo.h:17
double getMassShift(bool use_avg_mass=false) const
returns the mass shift caused by this adduct if charges are compensated with protons
AdductInfo(const String &name, const EmpiricalFormula &adduct, int charge, UInt mol_multiplier=1)
double mass_
computed from ef_.getMonoWeight(), but stored explicitly for efficiency
Definition AdductInfo.h:69
EmpiricalFormula ef_
Sum formula for the actual adduct e.g. 'H' in 2M+H;+1.
Definition AdductInfo.h:68
String name_
members
Definition AdductInfo.h:67
UInt getMolMultiplier() const
get molecular multiplier
bool operator==(const AdductInfo &other) const
equality operator
double getNeutralMass(double observed_mz) const
returns the neutral mass of the small molecule without adduct (creates monomer from nmer,...
int getCharge() const
get charge of adduct
static AdductInfo parseAdductString(const String &adduct)
UInt mol_multiplier_
Mol multiplier, e.g. 2 in 2M+H;+1.
Definition AdductInfo.h:71
const String & getName() const
original string used for parsing
int charge_
negative or positive charge; must not be 0
Definition AdductInfo.h:70
bool isCompatible(const EmpiricalFormula &db_entry) const
double getMZ(double neutral_mass) const
returns the m/z of the small molecule with neutral mass neutral_mass if the adduct is added (given ma...
const EmpiricalFormula & getEmpiricalFormula() const
sum formula of adduct itself. Useful for comparison with feature adduct annotation
Representation of an empirical formula.
Definition EmpiricalFormula.h:63
A more convenient string class.
Definition String.h:34
unsigned int UInt
Unsigned integer type.
Definition Types.h:64
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19