Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
ChromatogramExtractor Class Reference

The ChromatogramExtractor extracts chromatograms from a spectra file. More...

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

Inheritance diagram for ChromatogramExtractor:
ProgressLogger

Public Types

typedef ChromatogramExtractorAlgorithm::ExtractionCoordinates ExtractionCoordinates
 
- Public Types inherited from ProgressLogger
enum  LogType { CMD, GUI, NONE }
 Possible log types. More...
 

Public Member Functions

template<typename ExperimentT >
void extractChromatograms (const ExperimentT &input, ExperimentT &output, OpenMS::TargetedExperiment &transition_exp, double mz_extraction_window, bool ppm, TransformationDescription trafo, double rt_extraction_window, String filter)
 Extract chromatograms defined by the TargetedExperiment from the input map and write them to the output map. More...
 
void extractChromatograms (const OpenSwath::SpectrumAccessPtr input, std::vector< OpenSwath::ChromatogramPtr > &output, std::vector< ExtractionCoordinates > extraction_coordinates, double mz_extraction_window, bool ppm, String filter)
 Extract chromatograms at the m/z and RT defined by the ExtractionCoordinates. More...
 
void prepare_coordinates (std::vector< OpenSwath::ChromatogramPtr > &output_chromatograms, std::vector< ExtractionCoordinates > &coordinates, const OpenMS::TargetedExperiment &transition_exp, const double rt_extraction_window, const bool ms1) const
 Prepare the extraction coordinates from a TargetedExperiment. More...
 
template<typename SpectrumT >
void extract_value_tophat (const SpectrumT &input, const double &mz, Size &peak_idx, double &integrated_intensity, const double &extract_window, const bool ppm)
 
template<typename SpectrumT >
void extract_value_bartlett (const SpectrumT &input, const double &mz, Size &peak_idx, double &integrated_intensity, const double &extract_window, const bool ppm)
 
- 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...
 

Static Public Member Functions

template<typename TransitionExpT >
static void return_chromatogram (std::vector< OpenSwath::ChromatogramPtr > &chromatograms, std::vector< ChromatogramExtractor::ExtractionCoordinates > &coordinates, TransitionExpT &transition_exp_used, SpectrumSettings settings, std::vector< OpenMS::MSChromatogram > &output_chromatograms, bool ms1)
 This converts the ChromatogramPtr to MSChromatogram and adds meta-information. More...
 

Private Member Functions

template<class SpectrumSettingsT , class ChromatogramT >
void prepareSpectra_ (SpectrumSettingsT &settings, std::vector< ChromatogramT > &chromatograms, OpenMS::TargetedExperiment &transition_exp)
 This populates the chromatograms vector with empty chromatograms (but sets their meta-information) More...
 
bool outsideExtractionWindow_ (const ReactionMonitoringTransition &transition, double current_rt, const TransformationDescription &trafo, double rt_extraction_window)
 
int getFilterNr_ (String filter)
 
void populatePeptideRTMap_ (OpenMS::TargetedExperiment &transition_exp, double rt_extraction_window)
 

Static Private Member Functions

template<typename TransitionExpT >
static String extract_id_ (TransitionExpT &transition_exp_used, String id)
 Extracts id (peptide sequence or compound name) for a compound. More...
 

Private Attributes

std::map< OpenMS::String, doublePeptideRTMap_
 

Additional Inherited Members

- 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 ChromatogramExtractor extracts chromatograms from a spectra file.

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. There are two interfaces, the old interface will take a full TargetedExperiment and assume that one wants to extract at the m/z of the transitions present in the TargetedExperiment. The new interface (see also the ChromatogramExtractorAlgorithm class) only expects a set of coordinates which are up to the user to fill but a convenient prepare_coordinates function is provided 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 Typedef Documentation

◆ ExtractionCoordinates

Member Function Documentation

◆ extract_id_()

static String extract_id_ ( TransitionExpT &  transition_exp_used,
String  id 
)
staticprivate

Extracts id (peptide sequence or compound name) for a compound.

Parameters
transition_expThe transition experiment used as input (is constant) and either of type LightTargetedExperiment or TargetedExperiment
idThe identifier of the compound or peptide

◆ extract_value_bartlett()

void extract_value_bartlett ( const SpectrumT &  input,
const double mz,
Size peak_idx,
double integrated_intensity,
const double extract_window,
const bool  ppm 
)
inline
Note
: TODO deprecate this function (use ChromatogramExtractorAlgorithm instead)

◆ extract_value_tophat()

void extract_value_tophat ( const SpectrumT &  input,
const double mz,
Size peak_idx,
double integrated_intensity,
const double extract_window,
const bool  ppm 
)
inline
Note
: TODO deprecate this function (use ChromatogramExtractorAlgorithm instead)

◆ extractChromatograms() [1/2]

void extractChromatograms ( const ExperimentT &  input,
ExperimentT &  output,
OpenMS::TargetedExperiment transition_exp,
double  mz_extraction_window,
bool  ppm,
TransformationDescription  trafo,
double  rt_extraction_window,
String  filter 
)
inline

Extract chromatograms defined by the TargetedExperiment from the input map and write them to the output map.

Parameters
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)
rt_extraction_windowExtracts a window of this size in RT dimension (e.g. a window of 600 seconds means an extraction of 300 seconds on either side)
Note
: it will replace chromatograms in the output map, not append to them!
: TODO deprecate this function (use ChromatogramExtractorAlgorithm instead)

References TargetedExperiment::getTransitions(), TransformationDescription::invert(), OpenMS::Constants::k, and TargetedExperiment::sortTransitionsByProductMZ().

◆ extractChromatograms() [2/2]

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

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

Note
: whenever possible, please use this ChromatogramExtractorAlgorithm implementation

References ChromatogramExtractorAlgorithm::extractChromatograms().

◆ getFilterNr_()

int getFilterNr_ ( String  filter)
private
Note
: TODO deprecate this function (use ChromatogramExtractorAlgorithm instead)

◆ outsideExtractionWindow_()

bool outsideExtractionWindow_ ( const ReactionMonitoringTransition transition,
double  current_rt,
const TransformationDescription trafo,
double  rt_extraction_window 
)
private
Note
: TODO deprecate this function (use ChromatogramExtractorAlgorithm instead)

◆ populatePeptideRTMap_()

void populatePeptideRTMap_ ( OpenMS::TargetedExperiment transition_exp,
double  rt_extraction_window 
)
private
Note
: TODO deprecate this function (use ChromatogramExtractorAlgorithm instead)

◆ prepare_coordinates()

void prepare_coordinates ( std::vector< OpenSwath::ChromatogramPtr > &  output_chromatograms,
std::vector< ExtractionCoordinates > &  coordinates,
const OpenMS::TargetedExperiment transition_exp,
const double  rt_extraction_window,
const bool  ms1 
) const

Prepare the extraction coordinates from a TargetedExperiment.

Will fill the coordinates vector with the appropriate extraction coordinates (transitions for MS2 extraction, peptide m/z for MS1 extraction). The output will be sorted by m/z.

Parameters
output_chromatogramsAn empty vector which will be initialized correctly
coordinatesAn empty vector which will be filled with the appropriate extraction coordinates in m/z and rt and sorted by m/z (to be used as input to extractChromatograms)
transition_expThe transition experiment used as input (is constant)
rt_extraction_windowIf non-negative, full RT extraction window, centered on the first RT value (rt_end - rt_start will equal this window size). If negative, rt_end will be set to -1 and rt_start to 0 (i.e. full RT range). If NaN, exactly two RT entries are expected
  • the first is used as rt_start and the second as rt_end.
ms1Whether to extract for MS1 (peptide level) or MS2 (transition level)
Exceptions
Exception::IllegalArgumentif RT values are expected (depending on rt_extraction_window) but not provided

◆ prepareSpectra_()

void prepareSpectra_ ( SpectrumSettingsT &  settings,
std::vector< ChromatogramT > &  chromatograms,
OpenMS::TargetedExperiment transition_exp 
)
inlineprivate

◆ return_chromatogram()

static void return_chromatogram ( std::vector< OpenSwath::ChromatogramPtr > &  chromatograms,
std::vector< ChromatogramExtractor::ExtractionCoordinates > &  coordinates,
TransitionExpT &  transition_exp_used,
SpectrumSettings  settings,
std::vector< OpenMS::MSChromatogram > &  output_chromatograms,
bool  ms1 
)
inlinestatic

Member Data Documentation

◆ PeptideRTMap_

std::map<OpenMS::String, double> PeptideRTMap_
private

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:07 using doxygen 1.8.13