OpenMS
Loading...
Searching...
No Matches
IMTypes Class Reference

#include <OpenMS/IONMOBILITY/IMTypes.h>

Collaboration diagram for IMTypes:
[legend]

Static Public Member Functions

static IMFormat determineIMFormat (const MSExperiment &exp, int ms_level)
 
static IMFormat determineIMFormat (const MSSpectrum &spec)
 Checks for existence of a single driftTime (using spec.getDriftTime()) or an ion-mobility float data array (using spec.hasIMData())
 
static DIM_UNIT fromIMUnit (const DriftTimeUnit from)
 Convert a DriftTimeUnit to the more general DIM_UNIT.
 
static double oneOverK0ToCCS (double one_over_k0, double mz, int charge, double buffer_gas_mass=N2_BUFFER_GAS_MASS)
 Convert a reduced inverse ion mobility (1/K0) to a collision cross section (CCS) via the Mason-Schamp relation.
 
static double ccsToOneOverK0 (double ccs, double mz, int charge, double buffer_gas_mass=N2_BUFFER_GAS_MASS)
 Inverse of oneOverK0ToCCS - convert a collision cross section (CCS) back to reduced inverse ion mobility (1/K0).
 

Static Public Attributes

static constexpr double DRIFTTIME_NOT_SET = -1.0
 If drift time for a spectrum is unavailable (i.e. not an IM spectrum), it will have this value.
 
static constexpr double N2_BUFFER_GAS_MASS = 28.0
 

Member Function Documentation

◆ ccsToOneOverK0()

static double ccsToOneOverK0 ( double  ccs,
double  mz,
int  charge,
double  buffer_gas_mass = N2_BUFFER_GAS_MASS 
)
static

Inverse of oneOverK0ToCCS - convert a collision cross section (CCS) back to reduced inverse ion mobility (1/K0).

Parameters
[in]ccsCollision cross section in square Angstrom (Angstrom^2); must be > 0.
[in]mzPrecursor m/z of the ion; must be > 0.
[in]chargePrecursor charge; the sign is ignored (|charge| is used) and it must be non-zero.
[in]buffer_gas_massDrift-gas mass in Da; defaults to N2 (N2_BUFFER_GAS_MASS).
Returns
Reduced inverse ion mobility 1/K0 in V*s/cm^2.
Exceptions
Exception::InvalidValueif ccs <= 0, mz <= 0, or charge == 0.

◆ determineIMFormat() [1/2]

static IMFormat determineIMFormat ( const MSExperiment exp,
int  ms_level 
)
static

Checks only spectra of the given MS level for their IM format and returns the common type. If no spectra of ms_level exist or none have IM data, IMFormat::NONE is returned.

Exceptions
Exception::InvalidValueif spectra of the given MS level have different IM formats

◆ determineIMFormat() [2/2]

static IMFormat determineIMFormat ( const MSSpectrum spec)
static

Checks for existence of a single driftTime (using spec.getDriftTime()) or an ion-mobility float data array (using spec.hasIMData())

If neither is found, IMFormat::NONE is returned. If a single drift time (== IMFormat::IM_SPECTRUM) is found, but no unit, a warning is issued.

Exceptions
Exception::InvalidValueif IM values are annotated as single drift time and float array in the given spectrum

◆ fromIMUnit()

static DIM_UNIT fromIMUnit ( const DriftTimeUnit  from)
static

Convert a DriftTimeUnit to the more general DIM_UNIT.

Parameters
[in]fromDrift unit to convert from
Returns
A more general DIM_UNIT
Exceptions
Exception::ConversionErrorif from has an invalid value (e.g. 'NONE')

Referenced by TOPPViewBase::showCurrentPeaksAsIonMobility().

◆ oneOverK0ToCCS()

static double oneOverK0ToCCS ( double  one_over_k0,
double  mz,
int  charge,
double  buffer_gas_mass = N2_BUFFER_GAS_MASS 
)
static

Convert a reduced inverse ion mobility (1/K0) to a collision cross section (CCS) via the Mason-Schamp relation.

Uses the conventional single-temperature form CCS = (C * |charge| / sqrt(mu)) * (1/K0) with the Bruker calibration constant C = 1059.62245 (validated against alphatims and MaxQuant CCS values for an N2 drift gas at the usual calibration temperature). mu is the ion-gas reduced mass mu = (m_ion * m_gas) / (m_ion + m_gas), with the ion mass approximated as m_ion = mz * |charge|.

Parameters
[in]one_over_k0Reduced inverse ion mobility 1/K0 in V*s/cm^2; must be > 0.
[in]mzPrecursor m/z of the ion; must be > 0.
[in]chargePrecursor charge; the sign is ignored (|charge| is used) and it must be non-zero.
[in]buffer_gas_massDrift-gas mass in Da; defaults to N2 (N2_BUFFER_GAS_MASS).
Returns
Collision cross section in square Angstrom (Angstrom^2).
Exceptions
Exception::InvalidValueif one_over_k0 <= 0, mz <= 0, or charge == 0.

Member Data Documentation

◆ DRIFTTIME_NOT_SET

constexpr double DRIFTTIME_NOT_SET = -1.0
inlinestaticconstexpr

If drift time for a spectrum is unavailable (i.e. not an IM spectrum), it will have this value.

◆ N2_BUFFER_GAS_MASS

constexpr double N2_BUFFER_GAS_MASS = 28.0
inlinestaticconstexpr

Mass of N2 (the most common drift/buffer gas) in Da; default buffer gas for the CCS conversions below. The rounded value 28.0 is used (rather than 28.006148) to match the calibration constant below, which was validated against the Bruker/alphatims and MaxQuant CCS values.