OpenMS
Precursor Class Reference

Precursor meta information. More...

#include <OpenMS/METADATA/Precursor.h>

Inheritance diagram for Precursor:
[legend]
Collaboration diagram for Precursor:
[legend]

Public Types

enum  ActivationMethod {
  CID , PSD , PD , SID ,
  BIRD , ECD , IMD , SORI ,
  HCID , LCID , PHD , ETD ,
  PQD , TRAP , HCD , INSOURCE ,
  LIFT , SIZE_OF_ACTIVATIONMETHOD
}
 Method of activation. More...
 
- Public Types inherited from Peak1D
enum  { DIMENSION = 1 }
 
using IntensityType = float
 Intensity type. More...
 
using PositionType = DPosition< 1 >
 Position type. More...
 
using CoordinateType = double
 Coordinate type. More...
 

Public Member Functions

 Precursor ()=default
 Constructor. More...
 
 Precursor (const Precursor &)=default
 Copy constructor. More...
 
 Precursor (Precursor &&) noexcept
 Move constructor. More...
 
 ~Precursor () override=default
 Destructor. More...
 
Precursoroperator= (const Precursor &)=default
 Assignment operator. More...
 
Precursoroperator= (Precursor &&) &=default
 Move assignment operator. More...
 
bool operator== (const Precursor &rhs) const
 Equality operator. More...
 
bool operator!= (const Precursor &rhs) const
 Equality operator. More...
 
const std::set< ActivationMethod > & getActivationMethods () const
 returns a const reference to the activation methods More...
 
std::set< ActivationMethod > & getActivationMethods ()
 returns a mutable reference to the activation methods More...
 
StringList getActivationMethodsAsString () const
 convenience function, returning string representation of getActivationMethods() More...
 
void setActivationMethods (const std::set< ActivationMethod > &activation_methods)
 sets the activation methods More...
 
double getActivationEnergy () const
 returns the activation energy (in electronvolt) More...
 
void setActivationEnergy (double activation_energy)
 sets the activation energy (in electronvolt) More...
 
double getIsolationWindowLowerOffset () const
 Returns the lower offset from the target m/z. More...
 
void setIsolationWindowLowerOffset (double bound)
 sets the lower offset from the target m/z More...
 
double getIsolationWindowUpperOffset () const
 Returns the upper offset from the target m/z. More...
 
void setIsolationWindowUpperOffset (double bound)
 sets the upper offset from the target m/z More...
 
double getDriftTime () const
 Returns the ion mobility drift time in milliseconds (-1 means it is not set) More...
 
void setDriftTime (double drift_time)
 sets the ion mobility drift time in milliseconds More...
 
DriftTimeUnit getDriftTimeUnit () const
 Returns the ion mobility drift time unit. More...
 
void setDriftTimeUnit (DriftTimeUnit dt)
 Sets the ion mobility drift time unit. More...
 
double getDriftTimeWindowLowerOffset () const
 Returns the lower offset from the target ion mobility in milliseconds. More...
 
void setDriftTimeWindowLowerOffset (double drift_time)
 sets the lower offset from the target ion mobility More...
 
double getDriftTimeWindowUpperOffset () const
 Returns the upper offset from the target ion mobility in milliseconds. More...
 
void setDriftTimeWindowUpperOffset (double drift_time)
 sets the upper offset from the target ion mobility More...
 
Int getCharge () const
 Non-mutable access to the charge. More...
 
void setCharge (Int charge)
 Mutable access to the charge. More...
 
std::vector< Int > & getPossibleChargeStates ()
 Mutable access to possible charge states. More...
 
const std::vector< Int > & getPossibleChargeStates () const
 Non-mutable access to possible charge states. More...
 
void setPossibleChargeStates (const std::vector< Int > &possible_charge_states)
 Sets the possible charge states. More...
 
double getUnchargedMass () const
 Returns the uncharged mass of the precursor, if charge is unknown, i.e. 0, our best guess is doubly charged. More...
 
- Public Member Functions inherited from CVTermList
 CVTermList ()=default
 Defaults constructor. More...
 
 CVTermList (const CVTermList &)=default
 Copy constructor. More...
 
 CVTermList (CVTermList &&) noexcept
 Move constructor. More...
 
virtual ~CVTermList ()
 Destructor. More...
 
CVTermListoperator= (const CVTermList &rhs) &=default
 Assignment operator. More...
 
CVTermListoperator= (CVTermList &&) &=default
 Move assignment operator. More...
 
void setCVTerms (const std::vector< CVTerm > &terms)
 sets the CV terms More...
 
void replaceCVTerm (const CVTerm &cv_term)
 replaces the specified CV term More...
 
void replaceCVTerms (const std::vector< CVTerm > &cv_terms, const String &accession)
 replaces the specified CV terms using the given accession number More...
 
void replaceCVTerms (const std::map< String, std::vector< CVTerm > > &cv_term_map)
 replaces all cv terms with a map (can be obtained via getCVTerms) More...
 
void consumeCVTerms (const std::map< String, std::vector< CVTerm > > &cv_term_map)
 merges the given map into the member map, no duplicate checking More...
 
const std::map< String, std::vector< CVTerm > > & getCVTerms () const
 returns the accession string of the term More...
 
void addCVTerm (const CVTerm &term)
 adds a CV term More...
 
bool operator== (const CVTermList &cv_term_list) const
 equality operator More...
 
bool operator!= (const CVTermList &cv_term_list) const
 inequality operator More...
 
bool hasCVTerm (const String &accession) const
 checks whether the term has a value More...
 
bool empty () const
 return true if no terms are available More...
 
- Public Member Functions inherited from MetaInfoInterface
 MetaInfoInterface ()
 Constructor. More...
 
 MetaInfoInterface (const MetaInfoInterface &rhs)
 Copy constructor. More...
 
 MetaInfoInterface (MetaInfoInterface &&) noexcept
 Move constructor. More...
 
 ~MetaInfoInterface ()
 Destructor. More...
 
MetaInfoInterfaceoperator= (const MetaInfoInterface &rhs)
 Assignment operator. More...
 
MetaInfoInterfaceoperator= (MetaInfoInterface &&) noexcept
 Move assignment operator. More...
 
void swap (MetaInfoInterface &rhs)
 Swap contents. More...
 
bool operator== (const MetaInfoInterface &rhs) const
 Equality operator. More...
 
bool operator!= (const MetaInfoInterface &rhs) const
 Equality operator. More...
 
const DataValuegetMetaValue (const String &name) const
 Returns the value corresponding to a string, or DataValue::EMPTY if not found. More...
 
DataValue getMetaValue (const String &name, const DataValue &default_value) const
 Returns the value corresponding to a string, or a default value (e.g.: DataValue::EMPTY) if not found. More...
 
const DataValuegetMetaValue (UInt index) const
 Returns the value corresponding to the index, or DataValue::EMPTY if not found. More...
 
DataValue getMetaValue (UInt index, const DataValue &default_value) const
 Returns the value corresponding to the index, or a default value (e.g.: DataValue::EMPTY) if not found. More...
 
bool metaValueExists (const String &name) const
 Returns whether an entry with the given name exists. More...
 
bool metaValueExists (UInt index) const
 Returns whether an entry with the given index exists. More...
 
void setMetaValue (const String &name, const DataValue &value)
 Sets the DataValue corresponding to a name. More...
 
void setMetaValue (UInt index, const DataValue &value)
 Sets the DataValue corresponding to an index. More...
 
void removeMetaValue (const String &name)
 Removes the DataValue corresponding to name if it exists. More...
 
void removeMetaValue (UInt index)
 Removes the DataValue corresponding to index if it exists. More...
 
void addMetaValues (const MetaInfoInterface &from)
 function to copy all meta values from one object to this one More...
 
void getKeys (std::vector< String > &keys) const
 Fills the given vector with a list of all keys for which a value is set. More...
 
void getKeys (std::vector< UInt > &keys) const
 Fills the given vector with a list of all keys for which a value is set. More...
 
bool isMetaEmpty () const
 Returns if the MetaInfo is empty. More...
 
void clearMetaInfo ()
 Removes all meta values. More...
 
- Public Member Functions inherited from Peak1D
bool operator== (const Peak1D &rhs) const
 Equality operator. More...
 
bool operator!= (const Peak1D &rhs) const
 Equality operator. More...
 
 Peak1D ()=default
 
 Peak1D (PositionType a, IntensityType b)
 construct with position and intensity More...
 
 Peak1D (const Peak1D &p)=default
 Copy constructor. More...
 
 Peak1D (Peak1D &&) noexcept=default
 
Peak1Doperator= (const Peak1D &rhs)=default
 Assignment operator. More...
 
Peak1Doperator= (Peak1D &&) noexcept=default
 Move assignment operator. More...
 
 ~Peak1D ()=default
 Destructor. More...
 
IntensityType getIntensity () const
 
void setIntensity (IntensityType intensity)
 Mutable access to the data point intensity (height) More...
 
CoordinateType getMZ () const
 Non-mutable access to m/z. More...
 
void setMZ (CoordinateType mz)
 Mutable access to m/z. More...
 
CoordinateType getPos () const
 Alias for getMZ() More...
 
void setPos (CoordinateType pos)
 Alias for setMZ() More...
 
PositionType const & getPosition () const
 Non-mutable access to the position. More...
 
PositionTypegetPosition ()
 Mutable access to the position. More...
 
void setPosition (PositionType const &position)
 Mutable access to the position. More...
 

Static Public Attributes

static const std::string NamesOfActivationMethod [SIZE_OF_ACTIVATIONMETHOD]
 Names of activation methods. More...
 
static const std::string NamesOfActivationMethodShort [SIZE_OF_ACTIVATIONMETHOD]
 

Protected Attributes

std::set< ActivationMethodactivation_methods_
 
double activation_energy_ {}
 
double window_low_ {}
 
double window_up_ {}
 
double drift_time_ {-1}
 
double drift_window_low_ {}
 
double drift_window_up_ {}
 
DriftTimeUnit drift_time_unit_ {DriftTimeUnit::NONE}
 
Int charge_ {}
 
std::vector< Intpossible_charge_states_
 
- Protected Attributes inherited from CVTermList
std::map< String, std::vector< CVTerm > > cv_terms_
 
- Protected Attributes inherited from MetaInfoInterface
MetaInfometa_
 Pointer to the MetaInfo object (0 by default) More...
 
- Protected Attributes inherited from Peak1D
PositionType position_
 The data point position. More...
 
IntensityType intensity_ = 0.0
 The data point intensity. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MetaInfoInterface
static MetaInfoRegistrymetaRegistry ()
 Returns a reference to the MetaInfoRegistry. More...
 
- Protected Member Functions inherited from MetaInfoInterface
void createIfNotExists_ ()
 Creates the MetaInfo object if it does not exist. More...
 

Detailed Description

Precursor meta information.

This class contains precursor information:

  • isolation window
  • activation
  • selected ion (m/z, intensity, charge, possible charge states)
  • ion mobility drift time

Member Enumeration Documentation

◆ ActivationMethod

Method of activation.

Enumerator
CID 

Collision-induced dissociation.

PSD 

Post-source decay.

PD 

Plasma desorption.

SID 

Surface-induced dissociation.

BIRD 

Blackbody infrared radiative dissociation.

ECD 

Electron capture dissociation.

IMD 

Infrared multiphoton dissociation.

SORI 

Sustained off-resonance irradiation.

HCID 

High-energy collision-induced dissociation.

LCID 

Low-energy collision-induced dissociation.

PHD 

Photodissociation.

ETD 

Electron transfer dissociation.

PQD 

Pulsed q dissociation.

TRAP 

trap-type collision-induced dissociation (MS:1002472)

HCD 

beam-type collision-induced dissociation (MS:1000422) "HCD"

INSOURCE 

in-source collision-induced dissociation (MS:1001880)

LIFT 

Bruker proprietary method (MS:1002000)

SIZE_OF_ACTIVATIONMETHOD 

Constructor & Destructor Documentation

◆ Precursor() [1/3]

Precursor ( )
default

Constructor.

◆ Precursor() [2/3]

Precursor ( const Precursor )
default

Copy constructor.

◆ Precursor() [3/3]

Precursor ( Precursor &&  )
noexcept

Move constructor.

◆ ~Precursor()

~Precursor ( )
overridedefault

Destructor.

Member Function Documentation

◆ getActivationEnergy()

double getActivationEnergy ( ) const

returns the activation energy (in electronvolt)

◆ getActivationMethods() [1/2]

std::set<ActivationMethod>& getActivationMethods ( )

returns a mutable reference to the activation methods

◆ getActivationMethods() [2/2]

const std::set<ActivationMethod>& getActivationMethods ( ) const

returns a const reference to the activation methods

◆ getActivationMethodsAsString()

StringList getActivationMethodsAsString ( ) const

convenience function, returning string representation of getActivationMethods()

◆ getCharge()

Int getCharge ( ) const

Non-mutable access to the charge.

Referenced by DTAFile::store().

◆ getDriftTime()

double getDriftTime ( ) const

Returns the ion mobility drift time in milliseconds (-1 means it is not set)

Note
It is possible for the spectrum to not have a Precursor but still have a drift time, please check getDriftTime of MSSpectrum first and only use this function if you need find-grained access to individual precursors.

◆ getDriftTimeUnit()

DriftTimeUnit getDriftTimeUnit ( ) const

Returns the ion mobility drift time unit.

◆ getDriftTimeWindowLowerOffset()

double getDriftTimeWindowLowerOffset ( ) const

Returns the lower offset from the target ion mobility in milliseconds.

Note
This is an offset relative to the target ion mobility. The start of the ion mobility isolation window should thus be computed as:

p.getDriftTime() + p.getDriftTimeWindowLowerOffset()

Returns
the lower offset from the target ion mobility

◆ getDriftTimeWindowUpperOffset()

double getDriftTimeWindowUpperOffset ( ) const

Returns the upper offset from the target ion mobility in milliseconds.

Note
This is an offset relative to the target ion mobility. The end of the ion mobility isolation window should thus be computed as:

p.getDriftTime() + p.getDriftTimeWindowUpperOffset()

Returns
the upper offset from the target ion mobility

◆ getIsolationWindowLowerOffset()

double getIsolationWindowLowerOffset ( ) const

Returns the lower offset from the target m/z.

Note
This is an offset relative to the target m/z. The start of the mass isolation window should thus be computed as:

p.getMZ() - p.getIsolationWindowLowerOffset()

Returns
the lower offset from the target m/z

Referenced by TOPPViewBase::showCurrentPeaksAsDIA().

◆ getIsolationWindowUpperOffset()

double getIsolationWindowUpperOffset ( ) const

Returns the upper offset from the target m/z.

Note
This is an offset relative to the target m/z. The end of the mass isolation window should thus be computed as:

p.getMZ() + p.getIsolationWindowUpperOffset()

Returns
the upper offset from the target m/z

Referenced by TOPPViewBase::showCurrentPeaksAsDIA().

◆ getPossibleChargeStates() [1/2]

std::vector<Int>& getPossibleChargeStates ( )

Mutable access to possible charge states.

◆ getPossibleChargeStates() [2/2]

const std::vector<Int>& getPossibleChargeStates ( ) const

Non-mutable access to possible charge states.

◆ getUnchargedMass()

double getUnchargedMass ( ) const
inline

Returns the uncharged mass of the precursor, if charge is unknown, i.e. 0, our best guess is doubly charged.

References OpenMS::Constants::c, and OpenMS::Constants::PROTON_MASS_U.

◆ operator!=()

bool operator!= ( const Precursor rhs) const

Equality operator.

◆ operator=() [1/2]

Precursor& operator= ( const Precursor )
default

Assignment operator.

◆ operator=() [2/2]

Precursor& operator= ( Precursor &&  ) &
default

Move assignment operator.

◆ operator==()

bool operator== ( const Precursor rhs) const

Equality operator.

◆ setActivationEnergy()

void setActivationEnergy ( double  activation_energy)

sets the activation energy (in electronvolt)

◆ setActivationMethods()

void setActivationMethods ( const std::set< ActivationMethod > &  activation_methods)

sets the activation methods

◆ setCharge()

◆ setDriftTime()

void setDriftTime ( double  drift_time)

sets the ion mobility drift time in milliseconds

Referenced by ChromatogramExtractor::return_chromatogram().

◆ setDriftTimeUnit()

void setDriftTimeUnit ( DriftTimeUnit  dt)

Sets the ion mobility drift time unit.

◆ setDriftTimeWindowLowerOffset()

void setDriftTimeWindowLowerOffset ( double  drift_time)

sets the lower offset from the target ion mobility

Referenced by ChromatogramExtractor::return_chromatogram().

◆ setDriftTimeWindowUpperOffset()

void setDriftTimeWindowUpperOffset ( double  drift_time)

sets the upper offset from the target ion mobility

Referenced by ChromatogramExtractor::return_chromatogram().

◆ setIsolationWindowLowerOffset()

void setIsolationWindowLowerOffset ( double  bound)

sets the lower offset from the target m/z

Referenced by ChromatogramExtractor::prepareSpectra_(), and ChromatogramExtractor::return_chromatogram().

◆ setIsolationWindowUpperOffset()

void setIsolationWindowUpperOffset ( double  bound)

sets the upper offset from the target m/z

Referenced by ChromatogramExtractor::prepareSpectra_(), and ChromatogramExtractor::return_chromatogram().

◆ setPossibleChargeStates()

void setPossibleChargeStates ( const std::vector< Int > &  possible_charge_states)

Sets the possible charge states.

Member Data Documentation

◆ activation_energy_

double activation_energy_ {}
protected

◆ activation_methods_

std::set<ActivationMethod> activation_methods_
protected

◆ charge_

Int charge_ {}
protected

◆ drift_time_

double drift_time_ {-1}
protected

◆ drift_time_unit_

DriftTimeUnit drift_time_unit_ {DriftTimeUnit::NONE}
protected

◆ drift_window_low_

double drift_window_low_ {}
protected

◆ drift_window_up_

double drift_window_up_ {}
protected

◆ NamesOfActivationMethod

const std::string NamesOfActivationMethod[SIZE_OF_ACTIVATIONMETHOD]
static

◆ NamesOfActivationMethodShort

const std::string NamesOfActivationMethodShort[SIZE_OF_ACTIVATIONMETHOD]
static

◆ possible_charge_states_

std::vector<Int> possible_charge_states_
protected

◆ window_low_

double window_low_ {}
protected

◆ window_up_

double window_up_ {}
protected