OpenMS
FIAMSDataProcessor Class Reference

Data processing for FIA-MS data. More...

#include <OpenMS/ANALYSIS/ID/FIAMSDataProcessor.h>

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

Public Member Functions

 FIAMSDataProcessor ()
 Constructor. More...
 
 ~FIAMSDataProcessor () override=default
 Default destructor. More...
 
 FIAMSDataProcessor (const FIAMSDataProcessor &cp)=default
 Copy constructor. More...
 
FIAMSDataProcessoroperator= (const FIAMSDataProcessor &fdp)=default
 Assignment. More...
 
bool run (const MSExperiment &experiment, const float n_seconds, OpenMS::MzTab &output, const bool load_cached_spectrum=true)
 Run the full analysis for the experiment for the given time interval. More...
 
void cutForTime (const MSExperiment &experiment, const float n_seconds, std::vector< MSSpectrum > &output)
 Cut the time axis of the experiment from 0 to n_seconds. More...
 
MSSpectrum mergeAlongTime (const std::vector< OpenMS::MSSpectrum > &input)
 Sum the spectra with different retention times into one. More...
 
MSSpectrum extractPeaks (const MSSpectrum &input)
 Pick peaks from the summed spectrum. More...
 
FeatureMap convertToFeatureMap (const MSSpectrum &input)
 Convert a spectrum to a feature map with the corresponding polarity. More...
 
MSSpectrum trackNoise (const MSSpectrum &input)
 Estimate noise for each peak. More...
 
void runAccurateMassSearch (FeatureMap &input, OpenMS::MzTab &output)
 Perform accurate mass search. More...
 
const std::vector< float > & getMZs ()
 Get mass-to-charge ratios to base the summing the spectra along the time axis upon. More...
 
const std::vector< float > & getBinSizes ()
 Get the sliding bin sizes for summing the spectra along the time axis. 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

void storeSpectrum_ (const MSSpectrum &input, const String &filename)
 Store the spectrum to the given filepath. More...
 

Private Attributes

std::vector< float > mzs_
 
std::vector< float > bin_sizes_
 
SavitzkyGolayFilter sgfilter_
 
PeakPickerHiRes picker_
 

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

Data processing for FIA-MS data.

Flow injection analysis (FIA) omits the separation step by removal of the column. It allows for much faster processing time with the cost of ambiguities in the data interpretation. The compounds are identified through the accurate mass search.

Flow injection analysis class implements the basic FIA-MS data processing steps such as: acquiring the data for the certain time interval, summing along the time axis, smoothing the peaks, peak picking and accurate mass search. The batch runs are to be managed with the FIAMSSchedule class that takes a simple csv file as an input.

The workflow is inspired by the data processing from Fuhrer et al https://pubs.acs.org/doi/10.1021/ac201267k though it is not the exact implementation.

Constructor & Destructor Documentation

◆ FIAMSDataProcessor() [1/2]

Constructor.

◆ ~FIAMSDataProcessor()

~FIAMSDataProcessor ( )
overridedefault

Default destructor.

◆ FIAMSDataProcessor() [2/2]

FIAMSDataProcessor ( const FIAMSDataProcessor cp)
default

Copy constructor.

Member Function Documentation

◆ convertToFeatureMap()

FeatureMap convertToFeatureMap ( const MSSpectrum input)

Convert a spectrum to a feature map with the corresponding polarity.

Applies `SavitzkyGolayFilter` and `PeakPickerHiRes`

Parameters
inputInput a picked spectrum
Returns
a feature map with the peaks converted to features and polarity from the parameters

◆ cutForTime()

void cutForTime ( const MSExperiment experiment,
const float  n_seconds,
std::vector< MSSpectrum > &  output 
)

Cut the time axis of the experiment from 0 to n_seconds.

Parameters
experimentInput MSExperiment
n_secondsInput number of seconds
output[out] Spectra with retention time less than n_seconds

◆ extractPeaks()

MSSpectrum extractPeaks ( const MSSpectrum input)

Pick peaks from the summed spectrum.

Parameters
inputInput vector of spectra
Returns
a spectrum with picked peaks

◆ getBinSizes()

const std::vector<float>& getBinSizes ( )

Get the sliding bin sizes for summing the spectra along the time axis.

◆ getMZs()

const std::vector<float>& getMZs ( )

Get mass-to-charge ratios to base the summing the spectra along the time axis upon.

◆ mergeAlongTime()

MSSpectrum mergeAlongTime ( const std::vector< OpenMS::MSSpectrum > &  input)

Sum the spectra with different retention times into one.

The bin size for summing the intensities is defined as mz / (resolution*4) for all the mzs taken with the bin_step defined in the parameters. Uses `SpectrumAddition::addUpSpectra` function with the sliding bin size parameter.

Parameters
inputInput vector of spectra
Returns
a spectrum

◆ operator=()

FIAMSDataProcessor& operator= ( const FIAMSDataProcessor fdp)
default

Assignment.

◆ run()

bool run ( const MSExperiment experiment,
const float  n_seconds,
OpenMS::MzTab output,
const bool  load_cached_spectrum = true 
)

Run the full analysis for the experiment for the given time interval.

The workflow steps are:

  • the time axis of the experiment is cut to the interval from 0 to n_seconds
  • the spectra are summed into one along the time axis with the bin size determined by mz and instrument resolution
  • data is smoothed by applying the Savitzky-Golay filter
  • peaks are picked
  • the accurate mass search for all the picked peaks is performed

The intermediate summed spectra and picked peaks can be saved to the filesystem. Also, the results of the accurate mass search and the signal-to-noise information of the resulting spectrum is saved.

Parameters
experimentInput MSExperiment
n_secondsInput number of seconds
load_cached_spectrumLoad the cached picked spectrum if exists
[out]outputOutput of the accurate mass search results
Returns
a boolean indicating if the picked spectrum was loaded from the cached file

◆ runAccurateMassSearch()

void runAccurateMassSearch ( FeatureMap input,
OpenMS::MzTab output 
)

Perform accurate mass search.

Uses `AccurateMassSearchEngine`

Parameters
inputInput a feature map
output[out] mzTab file with the accurate mass search results

◆ storeSpectrum_()

void storeSpectrum_ ( const MSSpectrum input,
const String filename 
)
private

Store the spectrum to the given filepath.

◆ trackNoise()

MSSpectrum trackNoise ( const MSSpectrum input)

Estimate noise for each peak.

Uses `SignalToNoiseEstimatorMedianRapid`

Parameters
inputInput a picked spectrum
Returns
a spectrum object storing logSN information

◆ 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

◆ bin_sizes_

std::vector<float> bin_sizes_
private

◆ mzs_

std::vector<float> mzs_
private

◆ picker_

PeakPickerHiRes picker_
private

◆ sgfilter_

SavitzkyGolayFilter sgfilter_
private