OpenMS  2.4.0
Public Member Functions | Protected Member Functions | List of all members
MRMTransitionGroupPicker Class Reference

The MRMTransitionGroupPicker finds peaks in chromatograms that belong to the same precursors. More...

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

Inheritance diagram for MRMTransitionGroupPicker:
DefaultParamHandler

Public Member Functions

 MRMTransitionGroupPicker ()
 Constructor. More...
 
 ~MRMTransitionGroupPicker () override
 Destructor. More...
 
template<typename SpectrumT , typename TransitionT >
void pickTransitionGroup (MRMTransitionGroup< SpectrumT, TransitionT > &transition_group)
 Pick a group of chromatograms belonging to the same peptide. More...
 
template<typename SpectrumT , typename TransitionT >
MRMFeature createMRMFeature (const MRMTransitionGroup< SpectrumT, TransitionT > &transition_group, std::vector< SpectrumT > &picked_chroms, const std::vector< SpectrumT > &smoothed_chroms, const int chr_idx, const int peak_idx)
 Create feature from a vector of chromatograms and a specified peak. More...
 
template<typename SpectrumT >
void remove_overlapping_features (std::vector< SpectrumT > &picked_chroms, double best_left, double best_right)
 Remove overlapping features. More...
 
void findLargestPeak (const std::vector< MSChromatogram > &picked_chroms, int &chr_idx, int &peak_idx)
 Find largest peak in a vector of chromatograms. More...
 
void findWidestPeakIndices (const std::vector< MSChromatogram > &picked_chroms, Int &chrom_idx, Int &point_idx) const
 Given a vector of chromatograms, find the indices of the chromatogram containing the widest peak and of the position of highest intensity. 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...
 
virtual 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
 Synchronize members with param class. More...
 
MRMTransitionGroupPickeroperator= (const MRMTransitionGroupPicker &rhs)
 Assignment operator is protected for algorithm. More...
 
template<typename SpectrumT , typename TransitionT >
const SpectrumT & selectChromHelper_ (const MRMTransitionGroup< SpectrumT, TransitionT > &transition_group, const String &native_id)
 Select matching precursor or fragment ion chromatogram. More...
 
template<typename SpectrumT , typename TransitionT >
double computeQuality_ (const MRMTransitionGroup< SpectrumT, TransitionT > &transition_group, const std::vector< SpectrumT > &picked_chroms, const int chr_idx, const double best_left, const double best_right, String &outlier)
 Compute transition group quality (higher score is better) More...
 
template<typename SpectrumT >
void recalculatePeakBorders_ (const std::vector< SpectrumT > &picked_chroms, double &best_left, double &best_right, double max_z)
 Recalculate the borders of the peak. More...
 
- Protected Member Functions inherited from DefaultParamHandler
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 

Resampling methods

String peak_integration_
 
String background_subtraction_
 
bool recalculate_peaks_
 
bool use_precursors_
 
bool use_consensus_
 
bool compute_peak_quality_
 
bool compute_peak_shape_metrics_
 
bool compute_total_mi_
 
double min_qual_
 
int stop_after_feature_
 
double stop_after_intensity_ratio_
 
double min_peak_width_
 
double recalculate_peaks_max_z_
 
double resample_boundary_
 
String boundary_selection_method_
 Which method to use for selecting peaks' boundaries. More...
 
PeakPickerMRM picker_
 
PeakIntegrator pi_
 
template<typename SpectrumT >
void prepareMasterContainer_ (const SpectrumT &ref_chromatogram, SpectrumT &master_peak_container, double left_boundary, double right_boundary)
 Create an empty master peak container that has the correct mz / RT values set. More...
 
template<typename SpectrumT >
SpectrumT resampleChromatogram_ (const SpectrumT &chromatogram, const SpectrumT &master_peak_container, double left_boundary, double right_boundary)
 Resample a container at the positions indicated by the master peak container. More...
 

Additional Inherited Members

- 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

The MRMTransitionGroupPicker finds peaks in chromatograms that belong to the same precursors.

It is called through pickTransitionGroup which will accept an MRMTransitionGroup filled with n chromatograms and perform the following steps:

Step 1 is performed by smoothing the individual chromatogram and applying the PeakPickerHiRes.

Step 2 is performed by finding the largest peak overall and use this to create a feature, propagating this through all chromatograms.

Constructor & Destructor Documentation

◆ MRMTransitionGroupPicker()

Constructor.

◆ ~MRMTransitionGroupPicker()

~MRMTransitionGroupPicker ( )
override

Destructor.

Member Function Documentation

◆ computeQuality_()

double computeQuality_ ( const MRMTransitionGroup< SpectrumT, TransitionT > &  transition_group,
const std::vector< SpectrumT > &  picked_chroms,
const int  chr_idx,
const double  best_left,
const double  best_right,
String outlier 
)
inlineprotected

Compute transition group quality (higher score is better)

This is only based on the co-elution of the chromatograms and internal consistency without any library information.

For the final score (larger is better), consider these scores:

  • missing_peaks (the more peaks are missing, the worse)
  • multiple_peaks
  • mean of the shapes (1 is very good, 0 is bad)
  • mean of the coelutions (0 is good, 1 is ok, above 1 is pretty bad)

These scores are similar to the ones computed by MRMFeatureFinderScoring and a simple sum of these scores is returned.

left_borders / right_borders might not have the same length since we might have peaks missing!!

References OpenMS::Constants::k, LOG_DEBUG, mean_and_stddev::mean(), OpenSwath::Scoring::normalizedCrossCorrelation(), and OpenSwath::Scoring::xcorrArrayGetMaxPeak().

◆ createMRMFeature()

MRMFeature createMRMFeature ( const MRMTransitionGroup< SpectrumT, TransitionT > &  transition_group,
std::vector< SpectrumT > &  picked_chroms,
const std::vector< SpectrumT > &  smoothed_chroms,
const int  chr_idx,
const int  peak_idx 
)
inline

Create feature from a vector of chromatograms and a specified peak.

References PeakIntegrator::PeakArea::apex_pos, PeakIntegrator::PeakArea::area, PeakIntegrator::PeakBackground::area, PeakIntegrator::PeakShapeMetrics::asymmetry_factor, PeakIntegrator::PeakShapeMetrics::baseline_delta_2_height, MRMTransitionGroup< ChromatogramType, TransitionType >::chromatogramIdsMatch(), PeakIntegrator::PeakShapeMetrics::end_position_at_10, PeakIntegrator::PeakShapeMetrics::end_position_at_5, PeakIntegrator::PeakShapeMetrics::end_position_at_50, MRMTransitionGroup< ChromatogramType, TransitionType >::getChromatograms(), Feature::getConvexHulls(), MRMTransitionGroup< ChromatogramType, TransitionType >::getPrecursorChromatograms(), MRMTransitionGroup< ChromatogramType, TransitionType >::getTransitionGroupID(), MRMTransitionGroup< ChromatogramType, TransitionType >::getTransitions(), PeakIntegrator::PeakArea::height, PeakIntegrator::PeakBackground::height, PeakIntegrator::PeakArea::hull_points, MRMTransitionGroup< ChromatogramType, TransitionType >::isInternallyConsistent(), OpenMS::Constants::k, LOG_DEBUG, LOG_WARN, OPENMS_PRECONDITION, PeakIntegrator::PeakShapeMetrics::points_across_baseline, PeakIntegrator::PeakShapeMetrics::points_across_half_height, OpenSwath::Scoring::rankedMutualInformation(), ConvexHull2D::setHullPoints(), Peak2D::setIntensity(), MetaInfoInterface::setMetaValue(), Peak2D::setMZ(), Feature::setOverallQuality(), Feature::setQuality(), Peak2D::setRT(), PeakIntegrator::PeakShapeMetrics::slope_of_baseline, PeakIntegrator::PeakShapeMetrics::start_position_at_10, PeakIntegrator::PeakShapeMetrics::start_position_at_5, PeakIntegrator::PeakShapeMetrics::start_position_at_50, PeakIntegrator::PeakShapeMetrics::tailing_factor, PeakIntegrator::PeakShapeMetrics::total_width, PeakIntegrator::PeakShapeMetrics::width_at_10, PeakIntegrator::PeakShapeMetrics::width_at_5, and PeakIntegrator::PeakShapeMetrics::width_at_50.

◆ findLargestPeak()

void findLargestPeak ( const std::vector< MSChromatogram > &  picked_chroms,
int &  chr_idx,
int &  peak_idx 
)

Find largest peak in a vector of chromatograms.

◆ findWidestPeakIndices()

void findWidestPeakIndices ( const std::vector< MSChromatogram > &  picked_chroms,
Int chrom_idx,
Int point_idx 
) const

Given a vector of chromatograms, find the indices of the chromatogram containing the widest peak and of the position of highest intensity.

Parameters
[in]picked_chromsThe vector of chromatograms
[out]chrom_idxThe index of the chromatogram containing the widest peak
[out]point_idxThe index of the point with highest intensity

◆ operator=()

MRMTransitionGroupPicker& operator= ( const MRMTransitionGroupPicker rhs)
protected

Assignment operator is protected for algorithm.

◆ pickTransitionGroup()

void pickTransitionGroup ( MRMTransitionGroup< SpectrumT, TransitionT > &  transition_group)
inline

Pick a group of chromatograms belonging to the same peptide.

Will identify peaks in a set of chromatograms that belong to the same peptide. The chromatograms are given in the MRMTransitionGroup container which also contains the mapping of the chromatograms to their metadata. Only chromatograms from detecting transitions are used for peak picking. Identifying transitions will be processed alongside but do not contribute to the meta-data, e.g. total_xic or peak_apices_sum.

The resulting features are added to the MRMTransitionGroup. Each feature contains the following meta-data:

  • PeptideRef
  • leftWidth
  • rightWidth
  • total_xic (fragment trace XIC sum)
  • peak_apices_sum

References MRMTransitionGroup< ChromatogramType, TransitionType >::addFeature(), MRMTransitionGroup< ChromatogramType, TransitionType >::chromatogramIdsMatch(), MRMTransitionGroup< ChromatogramType, TransitionType >::getChromatograms(), Peak2D::getIntensity(), MetaInfoInterface::getMetaValue(), ChromatogramSettings::getNativeID(), MRMTransitionGroup< ChromatogramType, TransitionType >::getPrecursorChromatograms(), MRMTransitionGroup< ChromatogramType, TransitionType >::getTransition(), MRMTransitionGroup< ChromatogramType, TransitionType >::getTransitions(), MRMTransitionGroup< ChromatogramType, TransitionType >::hasTransition(), MRMTransitionGroup< ChromatogramType, TransitionType >::isInternallyConsistent(), OpenMS::Constants::k, OPENMS_PRECONDITION, and MSChromatogram::sortByIntensity().

◆ prepareMasterContainer_()

void prepareMasterContainer_ ( const SpectrumT &  ref_chromatogram,
SpectrumT &  master_peak_container,
double  left_boundary,
double  right_boundary 
)
inlineprotected

Create an empty master peak container that has the correct mz / RT values set.

The empty master peak container fill be filled with mz / RT values at the positions where the reference chromatogram has values. The container will only be populated between the boundaries given. The output container will contain peaks with mz / RT values but all intensity values will be zero.

Parameters
ref_chromatogramReference chromatogram containing mz / RT values (possibly beyond the desired range)
master_peak_containerOutput container to be populated
left_boundaryLeft boundary of values the container should be populated with
right_boundaryRight boundary of values the container should be populated with

References OPENMS_PRECONDITION.

◆ recalculatePeakBorders_()

void recalculatePeakBorders_ ( const std::vector< SpectrumT > &  picked_chroms,
double best_left,
double best_right,
double  max_z 
)
inlineprotected

Recalculate the borders of the peak.

By collecting all left and right borders of contained peaks, a consensus peak is computed. By looking at the means and standard deviations of all the peak borders it is estimated whether the proposed peak border deviates too much from the consensus one. If the deviation is too high (in this case), then we fall back to the "consensus" (a median here).

References OpenMS::Constants::k, LOG_DEBUG, and OpenMS::Math::mean().

◆ remove_overlapping_features()

void remove_overlapping_features ( std::vector< SpectrumT > &  picked_chroms,
double  best_left,
double  best_right 
)
inline

Remove overlapping features.

Remove features that are within the current seed (between best_left and best_right) or overlap with it. An overlapping feature is defined as a feature that has either of its borders within the border of the current peak

Directly adjacent features are allowed, e.g. they can share one border.

References OpenMS::Constants::k.

◆ resampleChromatogram_()

SpectrumT resampleChromatogram_ ( const SpectrumT &  chromatogram,
const SpectrumT &  master_peak_container,
double  left_boundary,
double  right_boundary 
)
inlineprotected

Resample a container at the positions indicated by the master peak container.

Parameters
chromatogramContainer with the input data
master_peak_containerContainer with the mz / RT values at which to resample
left_boundaryLeft boundary of values the container should be resampled
right_boundaryRight boundary of values the container should be resampled
Returns
A container which contains the data from the input chromatogram resampled at the positions of the master container

References LinearResamplerAlign::raster().

◆ selectChromHelper_()

const SpectrumT& selectChromHelper_ ( const MRMTransitionGroup< SpectrumT, TransitionT > &  transition_group,
const String native_id 
)
inlineprotected

◆ updateMembers_()

void updateMembers_ ( )
overrideprotectedvirtual

Synchronize members with param class.

Reimplemented from DefaultParamHandler.

Member Data Documentation

◆ background_subtraction_

String background_subtraction_
protected

◆ boundary_selection_method_

String boundary_selection_method_
protected

Which method to use for selecting peaks' boundaries.

Valid values are: "largest", "widest"

◆ compute_peak_quality_

bool compute_peak_quality_
protected

◆ compute_peak_shape_metrics_

bool compute_peak_shape_metrics_
protected

◆ compute_total_mi_

bool compute_total_mi_
protected

◆ min_peak_width_

double min_peak_width_
protected

◆ min_qual_

double min_qual_
protected

◆ peak_integration_

String peak_integration_
protected

◆ pi_

PeakIntegrator pi_
protected

◆ picker_

PeakPickerMRM picker_
protected

◆ recalculate_peaks_

bool recalculate_peaks_
protected

◆ recalculate_peaks_max_z_

double recalculate_peaks_max_z_
protected

◆ resample_boundary_

double resample_boundary_
protected

◆ stop_after_feature_

int stop_after_feature_
protected

◆ stop_after_intensity_ratio_

double stop_after_intensity_ratio_
protected

◆ use_consensus_

bool use_consensus_
protected

◆ use_precursors_

bool use_precursors_
protected