OpenMS  2.6.0
Classes | Public Member Functions | Private Member Functions | List of all members
ChromatogramExtractorAlgorithm Class Reference

The ChromatogramExtractorAlgorithm extracts chromatograms from a MS data. More...

#include <OpenMS/ANALYSIS/OPENSWATH/ChromatogramExtractorAlgorithm.h>

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

Classes

struct  ExtractionCoordinates
 

Public Member Functions

void extractChromatograms (const OpenSwath::SpectrumAccessPtr input, std::vector< OpenSwath::ChromatogramPtr > &output, const std::vector< ExtractionCoordinates > &extraction_coordinates, double mz_extraction_window, bool ppm, double im_extraction_window, const String &filter)
 Extract chromatograms at the m/z and RT defined by the ExtractionCoordinates. More...
 
void extract_value_tophat (const std::vector< double >::const_iterator &mz_start, std::vector< double >::const_iterator &mz_it, const std::vector< double >::const_iterator &mz_end, std::vector< double >::const_iterator &int_it, const double mz, double &integrated_intensity, const double mz_extraction_window, const bool ppm)
 Extract the next mz value and add the integrated intensity to integrated_intensity. More...
 
void extract_value_tophat (const std::vector< double >::const_iterator &mz_start, std::vector< double >::const_iterator &mz_it, const std::vector< double >::const_iterator &mz_end, std::vector< double >::const_iterator &int_it, std::vector< double >::const_iterator &im_it, const double mz, const double im, double &integrated_intensity, const double mz_extraction_window, const double im_extraction_window, const bool ppm)
 Extract the next m/z value and add the integrated intensity to integrated_intensity. More...
 
- Public Member Functions inherited from ProgressLogger
 ProgressLogger ()
 Constructor. More...
 
 ~ProgressLogger ()
 Destructor. More...
 
 ProgressLogger (const ProgressLogger &other)
 Copy constructor. More...
 
ProgressLoggeroperator= (const ProgressLogger &other)
 Assignment Operator. More...
 
void setLogType (LogType type) const
 Sets the progress log that should be used. The default type is NONE! More...
 
LogType getLogType () const
 Returns the type of progress log being used. More...
 
void startProgress (SignedSize begin, SignedSize end, const String &label) const
 Initializes the progress display. More...
 
void setProgress (SignedSize value) const
 Sets the current progress. More...
 
void endProgress () const
 Ends the progress display. More...
 
void nextProgress () const
 increment progress by 1 (according to range begin-end) More...
 

Private Member Functions

int getFilterNr_ (const String &filter)
 

Additional Inherited Members

- Public Types inherited from ProgressLogger
enum  LogType { CMD, GUI, NONE }
 Possible log types. More...
 
- Static Protected Member Functions inherited from ProgressLogger
static String logTypeToFactoryName_ (LogType type)
 Return the name of the factory product used for this log type. More...
 
- Protected Attributes inherited from ProgressLogger
LogType type_
 
time_t last_invoke_
 
ProgressLoggerImplcurrent_logger_
 
- Static Protected Attributes inherited from ProgressLogger
static int recursion_depth_
 

Detailed Description

The ChromatogramExtractorAlgorithm extracts chromatograms from a MS data.

It will take as input a set of transitions coordinates and will extract the signal of the provided map at the product ion m/z and retention time (rt) values specified by the extraction coordinates. This interface only expects a set of coordinates which are up to the user to fill but a convenient prepare_coordinates function is provided (in the ChromatogramExtractor class) to create the coordinates for the most common case of an MS2 and MS1 extraction.

In the case of MS2 extraction, the map is assumed to originate from a SWATH (data-independent acquisition or DIA) experiment.

Member Function Documentation

◆ extract_value_tophat() [1/2]

void extract_value_tophat ( const std::vector< double >::const_iterator &  mz_start,
std::vector< double >::const_iterator &  mz_it,
const std::vector< double >::const_iterator &  mz_end,
std::vector< double >::const_iterator &  int_it,
const double  mz,
double integrated_intensity,
const double  mz_extraction_window,
const bool  ppm 
)

Extract the next mz value and add the integrated intensity to integrated_intensity.

This function will sum up all intensities within a window of mass-to-charge. It will extract around mz +/- mz_extract_window / 2.0 and add the result to integrated_intensity.

Parameters
mz_startStart of the spectrum (m/z coordinates)
mz_itCurrent m/z position (will be modified)
mz_endEnd of the spectrum (m/z coordinates)
int_intCurrent intensity position (will be modified)
mzTarget m/z for the current ion
integrated_intensityResulting intensity (will be overwritten)
mz_extraction_windowExtracts a window of this size in m/z dimension (e.g. a window of 50 ppm means an extraction of 25 ppm on either side)
ppmWhether the parameter mz_extraction_window is given in ppm or Th
Note
This function will change the position of the iterators mz_it and int_it and it can *not* extract any data if the mz-iterator is already passed the mz value given. It is thus critically important to provide all mz values to be extracted in ascending order!

◆ extract_value_tophat() [2/2]

void extract_value_tophat ( const std::vector< double >::const_iterator &  mz_start,
std::vector< double >::const_iterator &  mz_it,
const std::vector< double >::const_iterator &  mz_end,
std::vector< double >::const_iterator &  int_it,
std::vector< double >::const_iterator &  im_it,
const double  mz,
const double  im,
double integrated_intensity,
const double  mz_extraction_window,
const double  im_extraction_window,
const bool  ppm 
)

Extract the next m/z value and add the integrated intensity to integrated_intensity.

This function will sum up all intensities within a two-dimensional window of mass-to-charge and ion mobility. It will extract around mz +/- mz_extract_window / 2.0 and im +/- im_extraction_window / 2.0 and add the result to integrated_intensity.

Parameters
mz_startStart of the spectrum (m/z coordinates)
mz_itCurrent m/z position (will be modified)
mz_endEnd of the spectrum (m/z coordinates)
int_intCurrent intensity position (will be modified)
im_intCurrent ion mobility position (will be modified)
mzTarget m/z for the current ion
imTarget ion mobility for the current ion
integrated_intensityResulting intensity (will be overwritten)
mz_extraction_windowExtracts a window of this size in m/z dimension (e.g. a window of 50 ppm means an extraction of 25 ppm on either side)
im_extraction_windowExtracts a window of this size in ion mobility dimension.
ppmWhether the parameter mz_extraction_window is given in ppm or Th
Note
This function will change the position of the iterators mz_it, int_it and im_it and it can *not* extract any data if the mz-iterator is already passed the mz value given. It is thus critically important to provide all mz values to be extracted in ascending order!

◆ extractChromatograms()

void extractChromatograms ( const OpenSwath::SpectrumAccessPtr  input,
std::vector< OpenSwath::ChromatogramPtr > &  output,
const std::vector< ExtractionCoordinates > &  extraction_coordinates,
double  mz_extraction_window,
bool  ppm,
double  im_extraction_window,
const String filter 
)

Extract chromatograms at the m/z and RT defined by the ExtractionCoordinates.

Parameters
inputInput spectral map
outputOutput chromatograms (XICs)
extraction_coordinatesExtracts around these coordinates (from rt_start to rt_end in seconds - extracts the whole chromatogram if rt_end - rt_start < 0).
mz_extraction_windowExtracts a window of this size in m/z dimension in Th or ppm (e.g. a window of 50 ppm means an extraction of 25 ppm on either side)
ppmWhether mz_extraction_window is in ppm or in Th
filterWhich function to apply in m/z space (currently "tophat" only)

Referenced by ChromatogramExtractor::extractChromatograms().

◆ getFilterNr_()

int getFilterNr_ ( const String filter)
private