OpenMS
PeakPickerIM Class Reference

Peak picking algorithm for ion mobility data. More...

#include <OpenMS/PROCESSING/CENTROIDING/PeakPickerIM.h>

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

Public Member Functions

 PeakPickerIM ()
 Default constructor initializing parameters with default values. More...
 
 ~PeakPickerIM () override=default
 Destructor. More...
 
void pickIMTraces (MSSpectrum &spectrum)
 Centroids ion mobility data by iteratively extracting mobilograms for each m/z peak centroid. More...
 
void pickIMCluster (MSSpectrum &spec) const
 Converts an ion mobility frame to a single spectrum with averaged IM values. More...
 
void pickIMElutionProfiles (MSSpectrum &input) const
 Picks ion mobility elution profiles from the given spectrum using eluting profiles. More...
 
void setParameters (const Param &param)
 Sets the parameters for peak picking. More...
 
const ParamgetParameters () const
 Non-mutable access to the parameters. More...
 
- Public Member Functions inherited from DefaultParamHandler
 DefaultParamHandler (const String &name)
 Constructor with name that is displayed in error messages. More...
 
 DefaultParamHandler (const DefaultParamHandler &rhs)
 Copy constructor. More...
 
virtual ~DefaultParamHandler ()
 Destructor. More...
 
DefaultParamHandleroperator= (const DefaultParamHandler &rhs)
 Assignment operator. More...
 
virtual bool operator== (const DefaultParamHandler &rhs) const
 Equality operator. More...
 
void setParameters (const Param &param)
 Sets the parameters. More...
 
const ParamgetParameters () const
 Non-mutable access to the parameters. More...
 
const ParamgetDefaults () const
 Non-mutable access to the default parameters. More...
 
const StringgetName () const
 Non-mutable access to the name. More...
 
void setName (const String &name)
 Mutable access to the name. More...
 
const std::vector< String > & getSubsections () const
 Non-mutable access to the registered subsections. More...
 

Protected Member Functions

void updateMembers_ () override
 This method is used to update extra member variables at the end of the setParameters() method. More...
 
- Protected Member Functions inherited from DefaultParamHandler
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 

Private Member Functions

double computeOptimalSamplingRate (const std::vector< MSSpectrum > &spectra)
 determine sampling rate for linear resampler More...
 
void sumFrame_ (const MSSpectrum &input_spectrum, MSSpectrum &output_spectrum, double tolerance=0.01, bool use_ppm=true)
 Sum up the intensity of data points with nearly identical float values. More...
 
std::pair< double, double > ppmBounds (double mz, double ppm)
 Compute lower and upper m/z bounds based on ppm. More...
 
std::vector< MSSpectrumextractIonMobilityTraces (const MSSpectrum &picked_spectrum, const MSSpectrum &raw_spectrum)
 
MSSpectrum computeCentroids_ (const std::vector< MSSpectrum > &mobilogram_traces, const std::vector< MSSpectrum > &picked_traces)
 compute m/z and ion mobility centers for picked traces. Returns centroided spectrum. More...
 

Private Attributes

double sum_tolerance_mz_ {1.0}
 
double gauss_ppm_tolerance_ {5.0}
 
double sum_tolerance_im_ {0.0006}
 
int sgolay_frame_length_ {5}
 
int sgolay_polynomial_order_ {3}
 
double ppm_tolerance_cluster_ {50.0}
 
double im_tolerance_cluster_ {0.1}
 
double ppm_tolerance_elution_ {50.0}
 

Additional Inherited Members

- Static Public Member Functions inherited from DefaultParamHandler
static void writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const String &key_prefix="")
 Writes all parameters to meta values. More...
 
- Protected Attributes inherited from DefaultParamHandler
Param param_
 Container for current parameters. More...
 
Param defaults_
 Container for default parameters. This member should be filled in the constructor of derived classes! More...
 
std::vector< Stringsubsections_
 Container for registered subsections. This member should be filled in the constructor of derived classes! More...
 
String error_name_
 Name that is displayed in error messages during the parameter checking. More...
 
bool check_defaults_
 If this member is set to false no checking if parameters in done;. More...
 
bool warn_empty_defaults_
 If this member is set to false no warning is emitted when defaults are empty;. More...
 

Detailed Description

Peak picking algorithm for ion mobility data.

This class provides three specialized methods for peak picking in ion mobility (IM) data:

  1. pickIMTraces: Mobilogram-based peak picking that extracts ion mobility traces from raw IM data and performs centroiding on the extracted mobilograms. This method processes IM data by analyzing intensity profiles along the ion mobility dimension.
  2. pickIMCluster: Clustering-based peak picking that groups peaks close in both m/z and ion mobility space. Peaks within specified m/z (ppm) and IM tolerances are averaged together using intensity-weighted averaging, reducing an IM frame to a single spectrum with representative peak positions.
  3. pickIMElutionProfiles: Elution profile-based peak picking that extracts peaks based on their elution characteristics across the ion mobility dimension. This method uses m/z tolerance (ppm) to identify and pick peaks from IM elution profiles.

Constructor & Destructor Documentation

◆ PeakPickerIM()

Default constructor initializing parameters with default values.

◆ ~PeakPickerIM()

~PeakPickerIM ( )
overridedefault

Destructor.

Member Function Documentation

◆ computeCentroids_()

MSSpectrum computeCentroids_ ( const std::vector< MSSpectrum > &  mobilogram_traces,
const std::vector< MSSpectrum > &  picked_traces 
)
private

compute m/z and ion mobility centers for picked traces. Returns centroided spectrum.

◆ computeOptimalSamplingRate()

double computeOptimalSamplingRate ( const std::vector< MSSpectrum > &  spectra)
private

determine sampling rate for linear resampler

◆ extractIonMobilityTraces()

std::vector<MSSpectrum> extractIonMobilityTraces ( const MSSpectrum picked_spectrum,
const MSSpectrum raw_spectrum 
)
private

Extract ion mobility traces as MSSpectra from the raw TimsTOF frame Ion mobility is temporarily written in place of m/z inside Peak1D object. raw m/z values are allocated to float data arrays with the label 'raw_mz'

◆ getParameters()

const Param& getParameters

Non-mutable access to the parameters.

◆ pickIMCluster()

void pickIMCluster ( MSSpectrum spec) const

Converts an ion mobility frame to a single spectrum with averaged IM values.

This function takes an MS spectrum containing ion mobility data and reduces it to a single spectrum where peaks that are close in both m/z and ion mobility space are averaged together. The averaging is intensity-weighted for both m/z and ion mobility values.

The algorithm processes peaks sequentially and groups them based on two criteria:

  1. m/z tolerance: peaks must be within the configured ppm tolerance of each other
  2. ion mobility tolerance: the range of IM values must not exceed the configured tolerance

Uses parameters pickIMCluster:ppm_tolerance_cluster and pickIMCluster:im_tolerance_cluster.

Parameters
specSpectrum containing ion mobility data in its FloatDataArrays
Exceptions
Exception::MissingInformationif input spectrum lacks ion mobility data
Note
The input spectrum should contain ion mobility data in its FloatDataArrays. The output spectrum will contain averaged peaks with their corresponding intensity-weighted average ion mobility values.

Example:

MSSpectrum spectrum; // spectrum with IM FloatDataArrays
PeakPickerIM picker;
picker.pickIMCluster(spectrum);
PeakPickerIM()
Default constructor initializing parameters with default values.

◆ pickIMElutionProfiles()

void pickIMElutionProfiles ( MSSpectrum input) const

Picks ion mobility elution profiles from the given spectrum using eluting profiles.

This function processes an MS spectrum containing ion mobility data and extracts IM elution profiles based on the configured ppm tolerance.

Parameters
inputSpectrum containing ion mobility data in its FloatDataArrays

◆ pickIMTraces()

void pickIMTraces ( MSSpectrum spectrum)

Centroids ion mobility data by iteratively extracting mobilograms for each m/z peak centroid.

This function processes an MS spectrum containing ion mobility data (geared towards TimsTOF data) Peaks in a given MS spectrum are projected to the m/z axis and centroided. Then, the mobilogram of each m/z peak centroid is retrieved using the m/z peak FWHM. Peak picking algorithm is applied to the mobilogram to resolve isobaric species with different ion mobility measurement.

Parameters
spectrumSpectrum containing ion mobility data in its FloatDataArrays

◆ ppmBounds()

std::pair<double, double> ppmBounds ( double  mz,
double  ppm 
)
private

Compute lower and upper m/z bounds based on ppm.

◆ setParameters()

void setParameters

Sets the parameters for peak picking.

◆ sumFrame_()

void sumFrame_ ( const MSSpectrum input_spectrum,
MSSpectrum output_spectrum,
double  tolerance = 0.01,
bool  use_ppm = true 
)
private

Sum up the intensity of data points with nearly identical float values.

By default, this function assumes the tolerance provided is in parts per million. But it can be adjusted to use absolute value tolerance.

Parameters
input_spectrumSorted raw spectrum with duplicate peaks due to scan merging or presence of ion mobility data.
output_spectrumOutput spectrum containing the summed peaks.
toleranceMass tolerance between peaks
use_ppmWhether to use parts per million tolerance. If set to False, absolute tolerance will be used.

◆ updateMembers_()

void updateMembers_ ( )
overrideprotectedvirtual

This method is used to update extra member variables at the end of the setParameters() method.

Also call it at the end of the derived classes' copy constructor and assignment operator.

The default implementation is empty.

Reimplemented from DefaultParamHandler.

Member Data Documentation

◆ gauss_ppm_tolerance_

double gauss_ppm_tolerance_ {5.0}
private

◆ im_tolerance_cluster_

double im_tolerance_cluster_ {0.1}
private

◆ ppm_tolerance_cluster_

double ppm_tolerance_cluster_ {50.0}
private

◆ ppm_tolerance_elution_

double ppm_tolerance_elution_ {50.0}
private

◆ sgolay_frame_length_

int sgolay_frame_length_ {5}
private

◆ sgolay_polynomial_order_

int sgolay_polynomial_order_ {3}
private

◆ sum_tolerance_im_

double sum_tolerance_im_ {0.0006}
private

◆ sum_tolerance_mz_

double sum_tolerance_mz_ {1.0}
private