OpenMS
2.7.0
|
The MRMTransitionGroupPicker finds peaks in chromatograms that belong to the same precursors. More...
#include <OpenMS/ANALYSIS/OPENSWATH/MRMTransitionGroupPicker.h>
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 | pickApex (std::vector< SpectrumT > &picked_chroms, const double best_left, const double best_right, const double peak_apex, double &min_left, double &max_right, std::vector< double > &left_edges, std::vector< double > &right_edges) |
Apex-based peak picking. More... | |
template<typename SpectrumT , typename TransitionT > | |
void | pickFragmentChromatograms (const MRMTransitionGroup< SpectrumT, TransitionT > &transition_group, const std::vector< SpectrumT > &picked_chroms, MRMFeature &mrmFeature, const std::vector< SpectrumT > &smoothed_chroms, const double best_left, const double best_right, const bool use_consensus_, double &total_intensity, double &total_xic, double &total_mi, double &total_peak_apices, const SpectrumT &master_peak_container, const std::vector< double > &left_edges, const std::vector< double > &right_edges, const int chr_idx, const int peak_idx) |
template<typename SpectrumT , typename TransitionT > | |
void | pickPrecursorChromatograms (const MRMTransitionGroup< SpectrumT, TransitionT > &transition_group, const std::vector< SpectrumT > &picked_chroms, MRMFeature &mrmFeature, const std::vector< SpectrumT > &smoothed_chroms, const double best_left, const double best_right, const bool use_consensus_, double &total_intensity, const SpectrumT &master_peak_container, const std::vector< double > &left_edges, const std::vector< double > &right_edges, const int chr_idx, const int peak_idx) |
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 DefaultParamHandler & | operator= (const DefaultParamHandler &rhs) |
Assignment operator. More... | |
virtual bool | operator== (const DefaultParamHandler &rhs) const |
Equality operator. More... | |
void | setParameters (const Param ¶m) |
Sets the parameters. More... | |
const Param & | getParameters () const |
Non-mutable access to the parameters. More... | |
const Param & | getDefaults () const |
Non-mutable access to the default parameters. More... | |
const String & | getName () 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... | |
MRMTransitionGroupPicker & | operator= (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 | |
Static Public Member Functions inherited from DefaultParamHandler | |
static void | writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const String &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< String > | subsections_ |
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... | |
The MRMTransitionGroupPicker finds peaks in chromatograms that belong to the same precursors.
Parameters of this class are:Name | Type | Default | Restrictions | Description |
---|---|---|---|---|
stop_after_feature | int | -1 | Stop finding after feature (ordered by intensity; -1 means do not stop). | |
stop_after_intensity_ratio | float | 1.0e-04 | Stop after reaching intensity ratio | |
min_peak_width | float | -1.0 | Minimal peak width (s), discard all peaks below this value (-1 means no action). | |
peak_integration | string | original | original, smoothed | Calculate the peak area and height either the smoothed or the raw chromatogram data. |
background_subtraction | string | none | none, original, exact | Remove background from peak signal using estimated noise levels. The 'original' method is only provided for historical purposes, please use the 'exact' method and set parameters using the PeakIntegrator: settings. The same original or smoothed chromatogram specified by peak_integration will be used for background estimation. |
recalculate_peaks | string | false | true, false | Tries to get better peak picking by looking at peak consistency of all picked peaks. Tries to use the consensus (median) peak border if the variation within the picked peaks is too large. |
use_precursors | string | false | true, false | Use precursor chromatogram for peak picking (note that this may lead to precursor signal driving the peak picking) |
use_consensus | string | true | true, false | Use consensus peak boundaries when computing transition group picking (if false, compute independent peak boundaries for each transition) |
recalculate_peaks_max_z | float | 1.0 | Determines the maximal Z-Score (difference measured in standard deviations) that is considered too large for peak boundaries. If the Z-Score is above this value, the median is used for peak boundaries (default value 1.0). | |
minimal_quality | float | -1.0e04 | Only if compute_peak_quality is set, this parameter will not consider peaks below this quality threshold | |
resample_boundary | float | 15.0 | For computing peak quality, how many extra seconds should be sample left and right of the actual peak | |
compute_peak_quality | string | false | true, false | Tries to compute a quality value for each peakgroup and detect outlier transitions. The resulting score is centered around zero and values above 0 are generally good and below -1 or -2 are usually bad. |
compute_peak_shape_metrics | string | false | true, false | Calculates various peak shape metrics (e.g., tailing) that can be used for downstream QC/QA. |
compute_total_mi | string | false | true, false | Compute mutual information metrics for individual transitions that can be used for OpenSWATH/IPF scoring. |
boundary_selection_method | string | largest | largest, widest | Method to use when selecting the best boundaries for peaks. |
PeakPickerMRM:sgolay_frame_length | int | 15 | The number of subsequent data points used for smoothing. This number has to be uneven. If it is not, 1 will be added. |
|
PeakPickerMRM:sgolay_polynomial_order | int | 3 | Order of the polynomial that is fitted. | |
PeakPickerMRM:gauss_width | float | 50.0 | Gaussian width in seconds, estimated peak size. | |
PeakPickerMRM:use_gauss | string | true | false, true | Use Gaussian filter for smoothing (alternative is Savitzky-Golay filter) |
PeakPickerMRM:peak_width | float | -1.0 | Force a certain minimal peak_width on the data (e.g. extend the peak at least by this amount on both sides) in seconds. -1 turns this feature off. | |
PeakPickerMRM:signal_to_noise | float | 1.0 | min: 0.0 | Signal-to-noise threshold at which a peak will not be extended any more. Note that setting this too high (e.g. 1.0) can lead to peaks whose flanks are not fully captured. |
PeakPickerMRM:sn_win_len | float | 1000.0 | Signal to noise window length. | |
PeakPickerMRM:sn_bin_count | int | 30 | Signal to noise bin count. | |
PeakPickerMRM:write_sn_log_messages | string | false | true, false | Write out log messages of the signal-to-noise estimator in case of sparse windows or median in rightmost histogram bin |
PeakPickerMRM:remove_overlapping_peaks | string | false | false, true | Try to remove overlapping peaks during peak picking |
PeakPickerMRM:method | string | corrected | legacy, corrected, crawdad | Which method to choose for chromatographic peak-picking (OpenSWATH legacy on raw data, corrected picking on smoothed chromatogram or Crawdad on smoothed chromatogram). |
PeakIntegrator:integration_type | string | intensity_sum | intensity_sum, simpson, trapezoid | The integration technique to use in integratePeak() and estimateBackground() which uses either the summed intensity, integration by Simpson's rule or trapezoidal integration. |
PeakIntegrator:baseline_type | string | base_to_base | base_to_base, vertical_division, vertical_division_min, vertical_division_max | The baseline type to use in estimateBackground() based on the peak boundaries. A rectangular baseline shape is computed based either on the minimal intensity of the peak boundaries, the maximum intensity or the average intensity (base_to_base). |
PeakIntegrator:fit_EMG | string | false | false, true | Fit the chromatogram/spectrum to the EMG peak model. |
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.
|
override |
Destructor.
|
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:
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 PeakPickerMRM::IDX_LEFTBORDER, PeakPickerMRM::IDX_RIGHTBORDER, OpenMS::Constants::k, mean_and_stddev::mean(), OpenSwath::Scoring::normalizedCrossCorrelation(), OPENMS_LOG_DEBUG, and OpenSwath::Scoring::xcorrArrayGetMaxPeak().
|
inline |
Create feature from a vector of chromatograms and a specified peak.
References MRMTransitionGroup< ChromatogramType, TransitionType >::chromatogramIdsMatch(), UniqueIdInterface::ensureUniqueId(), MRMTransitionGroup< ChromatogramType, TransitionType >::getTransitionGroupID(), PeakPickerMRM::IDX_LEFTBORDER, PeakPickerMRM::IDX_RIGHTBORDER, MRMTransitionGroup< ChromatogramType, TransitionType >::isInternallyConsistent(), OPENMS_LOG_DEBUG, OPENMS_PRECONDITION, Peak2D::setIntensity(), MetaInfoInterface::setMetaValue(), Feature::setOverallQuality(), and Peak2D::setRT().
void findLargestPeak | ( | const std::vector< MSChromatogram > & | picked_chroms, |
int & | chr_idx, | ||
int & | peak_idx | ||
) |
Find largest peak in a vector of chromatograms.
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.
[in] | picked_chroms | The vector of chromatograms |
[out] | chrom_idx | The index of the chromatogram containing the widest peak |
[out] | point_idx | The index of the point with highest intensity |
|
protected |
Assignment operator is protected for algorithm.
|
inline |
Apex-based peak picking.
Pick the peak with the closest apex to the consensus apex for each chromatogram. Use the closest peak for the current peak.
Note that we will only set the closest peak per chromatogram to zero, so if there are two peaks for some transitions, we will have to get to them later. If there is no peak, then we transfer transition boundaries from "master" peak.
References PeakIntegrator::PeakArea::apex_pos, PeakPickerMRM::IDX_LEFTBORDER, PeakPickerMRM::IDX_RIGHTBORDER, and OpenMS::Constants::k.
|
inline |
References MRMFeature::addFeature(), PeakIntegrator::PeakArea::apex_pos, PeakIntegrator::PeakArea::area, PeakIntegrator::PeakBackground::area, PeakIntegrator::PeakShapeMetrics::asymmetry_factor, PeakIntegrator::PeakShapeMetrics::baseline_delta_2_height, PeakIntegrator::PeakShapeMetrics::end_position_at_10, PeakIntegrator::PeakShapeMetrics::end_position_at_5, PeakIntegrator::PeakShapeMetrics::end_position_at_50, Feature::getConvexHulls(), MRMTransitionGroup< ChromatogramType, TransitionType >::getTransitions(), PeakIntegrator::PeakArea::height, PeakIntegrator::PeakBackground::height, PeakIntegrator::PeakArea::hull_points, OpenMS::Constants::k, 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.
|
inline |
References MRMFeature::addPrecursorFeature(), PeakIntegrator::PeakArea::apex_pos, PeakIntegrator::PeakArea::area, PeakIntegrator::PeakBackground::area, MRMTransitionGroup< ChromatogramType, TransitionType >::getChromatograms(), Feature::getConvexHulls(), MRMTransitionGroup< ChromatogramType, TransitionType >::getPrecursorChromatograms(), MRMTransitionGroup< ChromatogramType, TransitionType >::getTransitions(), PeakIntegrator::PeakArea::height, PeakIntegrator::PeakBackground::height, PeakIntegrator::PeakArea::hull_points, OpenMS::Constants::k, ConvexHull2D::setHullPoints(), Peak2D::setIntensity(), MetaInfoInterface::setMetaValue(), Peak2D::setMZ(), Feature::setOverallQuality(), Feature::setQuality(), and Peak2D::setRT().
|
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:
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_LOG_DEBUG, OPENMS_PRECONDITION, ChromatogramSettings::setNativeID(), and MSChromatogram::sortByIntensity().
|
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.
ref_chromatogram | Reference chromatogram containing mz / RT values (possibly beyond the desired range) |
master_peak_container | Output container to be populated |
left_boundary | Left boundary of values the container should be populated with |
right_boundary | Right boundary of values the container should be populated with |
References OPENMS_PRECONDITION.
|
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 PeakPickerMRM::IDX_ABUNDANCE, PeakPickerMRM::IDX_LEFTBORDER, PeakPickerMRM::IDX_RIGHTBORDER, OpenMS::Constants::k, OpenMS::Math::mean(), and OPENMS_LOG_DEBUG.
|
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 PeakPickerMRM::IDX_LEFTBORDER, PeakPickerMRM::IDX_RIGHTBORDER, OpenMS::Constants::k, and OPENMS_LOG_DEBUG.
|
inlineprotected |
Resample a container at the positions indicated by the master peak container.
chromatogram | Container with the input data |
master_peak_container | Container with the mz / RT values at which to resample |
left_boundary | Left boundary of values the container should be resampled |
right_boundary | Right boundary of values the container should be resampled |
References LinearResamplerAlign::raster().
|
inlineprotected |
Select matching precursor or fragment ion chromatogram.
References MRMTransitionGroup< ChromatogramType, TransitionType >::getChromatogram(), MRMTransitionGroup< ChromatogramType, TransitionType >::getPrecursorChromatogram(), MRMTransitionGroup< ChromatogramType, TransitionType >::hasChromatogram(), and MRMTransitionGroup< ChromatogramType, TransitionType >::hasPrecursorChromatogram().
|
overrideprotectedvirtual |
Synchronize members with param class.
Reimplemented from DefaultParamHandler.
|
protected |
|
protected |
Which method to use for selecting peaks' boundaries.
Valid values are: "largest", "widest"
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |