OpenMS
|
The MRMFeatureFinder finds and scores peaks of transitions that co-elute. More...
#include <OpenMS/ANALYSIS/OPENSWATH/MRMFeatureFinderScoring.h>
Public Types | |
typedef OpenSwath::LightTransition | TransitionType |
Type definitions. More... | |
typedef OpenSwath::LightTargetedExperiment | TargetedExpType |
typedef OpenSwath::LightCompound | PeptideType |
typedef OpenSwath::LightProtein | ProteinType |
typedef OpenSwath::LightModification | ModificationType |
typedef MRMTransitionGroup< MSChromatogram, TransitionType > | MRMTransitionGroupType |
typedef std::map< String, MRMTransitionGroupType > | TransitionGroupMapType |
Public Types inherited from ProgressLogger | |
enum | LogType { CMD , GUI , NONE } |
Possible log types. More... | |
Public Member Functions | |
MRMFeatureFinderScoring () | |
Constructor. More... | |
~MRMFeatureFinderScoring () override | |
Destructor. More... | |
void | pickExperiment (const PeakMap &chromatograms, FeatureMap &output, const TargetedExperiment &transition_exp, const TransformationDescription &trafo, const PeakMap &swath_map) |
Picker and prepare functions. More... | |
void | pickExperiment (const OpenSwath::SpectrumAccessPtr &input, FeatureMap &output, const OpenSwath::LightTargetedExperiment &transition_exp, const TransformationDescription &trafo, const std::vector< OpenSwath::SwathMap > &swath_maps, TransitionGroupMapType &transition_group_map) |
Pick and score features in a single experiment from chromatograms. More... | |
void | prepareProteinPeptideMaps_ (const OpenSwath::LightTargetedExperiment &transition_exp) |
Prepares the internal mappings of peptides and proteins. More... | |
void | scorePeakgroups (MRMTransitionGroupType &transition_group, const TransformationDescription &trafo, const std::vector< OpenSwath::SwathMap > &swath_maps, FeatureMap &output, bool ms1only=false) const |
Score all peak groups of a transition group. More... | |
void | setStrictFlag (bool f) |
Set the flag for strict mapping. More... | |
void | setMS1Map (OpenSwath::SpectrumAccessPtr ms1_map) |
Add an MS1 map containing spectra. More... | |
void | mapExperimentToTransitionList (const OpenSwath::SpectrumAccessPtr &input, const OpenSwath::LightTargetedExperiment &transition_exp, TransitionGroupMapType &transition_group_map, TransformationDescription trafo, double rt_extraction_window) |
Map the chromatograms to the transitions. 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... | |
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... | |
Public Member Functions inherited from ProgressLogger | |
ProgressLogger () | |
Constructor. More... | |
virtual | ~ProgressLogger () |
Destructor. More... | |
ProgressLogger (const ProgressLogger &other) | |
Copy constructor. More... | |
ProgressLogger & | operator= (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 | |
void | splitTransitionGroupsDetection_ (const MRMTransitionGroupType &transition_group, MRMTransitionGroupType &transition_group_detection) const |
Splits combined transition groups into detection transition groups. More... | |
void | splitTransitionGroupsIdentification_ (const MRMTransitionGroupType &transition_group, MRMTransitionGroupType &transition_group_identification, MRMTransitionGroupType &transition_group_identification_decoy) const |
Splits combined transition groups into identification transition groups. More... | |
OpenSwath_Ind_Scores | scoreIdentification_ (MRMTransitionGroupType &transition_group_identification, OpenSwathScoring &scorer, const size_t feature_idx, const std::vector< std::string > &native_ids_detection, const double det_intensity_ratio_score, const double det_mi_ratio_score, const std::vector< OpenSwath::SwathMap > &swath_maps) const |
Provides scoring for target and decoy identification against detecting transitions. More... | |
void | prepareFeatureOutput_ (OpenMS::MRMFeature &mrmfeature, bool ms1only, int charge) const |
void | updateMembers_ () override |
Synchronize members with param class. More... | |
Private Attributes | |
double | rt_extraction_window_ |
double | quantification_cutoff_ |
int | stop_report_after_feature_ |
bool | write_convex_hull_ |
bool | strict_ |
String | scoring_model_ |
double | rt_normalization_factor_ |
int | add_up_spectra_ |
String | spectrum_addition_method_ |
double | spacing_for_spectra_resampling_ |
double | uis_threshold_sn_ |
double | uis_threshold_peak_area_ |
double | sn_win_len_ |
unsigned int | sn_bin_count_ |
bool | write_log_messages_ |
double | im_extra_drift_ |
std::map< OpenMS::String, const PeptideType * > | PeptideRefMap_ |
OpenSwath_Scores_Usage | su_ |
OpenMS::DIAScoring | diascoring_ |
OpenMS::SONARScoring | sonarscoring_ |
OpenMS::EmgScoring | emgscoring_ |
OpenSwath::SpectrumAccessPtr | ms1_map_ |
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 Member Functions inherited from DefaultParamHandler | |
void | defaultsToParam_ () |
Updates the parameters after the defaults have been set in the constructor. 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 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... | |
Protected Attributes inherited from ProgressLogger | |
LogType | type_ |
time_t | last_invoke_ |
ProgressLoggerImpl * | current_logger_ |
Static Protected Attributes inherited from ProgressLogger | |
static int | recursion_depth_ |
The MRMFeatureFinder finds and scores peaks of transitions that co-elute.
It does so using an internal peakpicker for each chromatogram and then creating consensus / meta-peaks (MRMFeatures) that contain the information of all corresponding chromatograms at the peak-position. It then goes on to score those MRMFeatures using different criteria described in the MRMScoring class.
Internally, all peak group detection is performed in MRMTransitionGroupPicker which segments the data and determines consensus peaks across traces (MRMFeatures). All scoring is delegated to the OpenSwathScoring class which implements i) chromatographic scores, ii) library based scores and iii) full spectrum (DIA) scores. These scores are retrieved from the OpenSwathScoring class and added to the MRMFeatures found in this algorithm. Note that the OpenSwathScoring is a facade that can be used to communicate with the underlying actual scoring engines and assembles the scores inside a scoring object called OpenSwath_Scores where they are easy to retrieve.
Parameters of this class are:Name | Type | Default | Restrictions | Description |
---|---|---|---|---|
stop_report_after_feature | int | -1 | Stop reporting after feature (ordered by quality; -1 means do not stop). | |
rt_extraction_window | float | -1.0 | Only extract RT around this value (-1 means extract over the whole range, a value of 500 means to extract around +/- 500 s of the expected elution). For this to work, the TraML input file needs to contain normalized RT values. | |
rt_normalization_factor | float | 1.0 | The normalized RT is expected to be between 0 and 1. If your normalized RT has a different range, pass this here (e.g. it goes from 0 to 100, set this value to 100) | |
quantification_cutoff | float | 0.0 | min: 0.0 | Cutoff in m/z below which peaks should not be used for quantification any more |
write_convex_hull | string | false | true, false | Whether to write out all points of all features into the featureXML |
spectrum_addition_method | string | simple | simple, resample | For spectrum addition, either use simple concatenation or use peak resampling |
add_up_spectra | int | 1 | min: 1 | Add up spectra around the peak apex (needs to be a non-even integer) |
spacing_for_spectra_resampling | float | 5.0e-03 | min: 0.0 | If spectra are to be added, use this spacing to add them up |
uis_threshold_sn | int | -1 | S/N threshold to consider identification transition (set to -1 to consider all) | |
uis_threshold_peak_area | int | 0 | Peak area threshold to consider identification transition (set to -1 to consider all) | |
scoring_model | string | default | default, single_transition | Scoring model to use |
im_extra_drift | float | 0.0 | min: 0.0 | Extra drift time to extract for IM scoring (as a fraction, e.g. 0.25 means 25% extra on each side) |
strict | string | true | true, false | Whether to error (true) or skip (false) if a transition in a transition group does not have a corresponding chromatogram. |
TransitionGroupPicker:stop_after_feature | int | -1 | Stop finding after feature (ordered by intensity; -1 means do not stop). | |
TransitionGroupPicker:stop_after_intensity_ratio | float | 1.0e-04 | Stop after reaching intensity ratio | |
TransitionGroupPicker:min_peak_width | float | 1.0e-03 | Minimal peak width (s), discard all peaks below this value (-1 means no action). | |
TransitionGroupPicker:peak_integration | string | original | original, smoothed | Calculate the peak area and height either the smoothed or the raw chromatogram data. |
TransitionGroupPicker: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. |
TransitionGroupPicker: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. |
TransitionGroupPicker:use_precursors | string | false | true, false | Use precursor chromatogram for peak picking (note that this may lead to precursor signal driving the peak picking) |
TransitionGroupPicker:use_consensus | string | true | true, false | Use consensus peak boundaries when computing transition group picking (if false, compute independent peak boundaries for each transition) |
TransitionGroupPicker: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). | |
TransitionGroupPicker:minimal_quality | float | -1.0e04 | Only if compute_peak_quality is set, this parameter will not consider peaks below this quality threshold | |
TransitionGroupPicker:resample_boundary | float | 15.0 | For computing peak quality, how many extra seconds should be sample left and right of the actual peak | |
TransitionGroupPicker: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. |
TransitionGroupPicker:compute_peak_shape_metrics | string | false | true, false | Calculates various peak shape metrics (e.g., tailing) that can be used for downstream QC/QA. |
TransitionGroupPicker:compute_total_mi | string | false | true, false | Compute mutual information metrics for individual transitions that can be used for OpenSWATH/IPF scoring. |
TransitionGroupPicker:boundary_selection_method | string | largest | largest, widest | Method to use when selecting the best boundaries for peaks. |
TransitionGroupPicker: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. |
|
TransitionGroupPicker:PeakPickerMRM:sgolay_polynomial_order | int | 3 | Order of the polynomial that is fitted. | |
TransitionGroupPicker:PeakPickerMRM:gauss_width | float | 50.0 | Gaussian width in seconds, estimated peak size. | |
TransitionGroupPicker:PeakPickerMRM:use_gauss | string | true | false, true | Use Gaussian filter for smoothing (alternative is Savitzky-Golay filter) |
TransitionGroupPicker: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. | |
TransitionGroupPicker: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. |
TransitionGroupPicker:PeakPickerMRM:sn_win_len | float | 1000.0 | Signal to noise window length. | |
TransitionGroupPicker:PeakPickerMRM:sn_bin_count | int | 30 | Signal to noise bin count. | |
TransitionGroupPicker: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 |
TransitionGroupPicker:PeakPickerMRM:remove_overlapping_peaks | string | false | false, true | Try to remove overlapping peaks during peak picking |
TransitionGroupPicker: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). |
TransitionGroupPicker: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. |
TransitionGroupPicker: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). |
TransitionGroupPicker:PeakIntegrator:fit_EMG | string | false | false, true | Fit the chromatogram/spectrum to the EMG peak model. |
DIAScoring:dia_extraction_window | float | 0.05 | min: 0.0 | DIA extraction window in Th or ppm. |
DIAScoring:dia_extraction_unit | string | Th | Th, ppm | DIA extraction window unit |
DIAScoring:dia_centroided | string | false | true, false | Use centroided DIA data. |
DIAScoring:dia_byseries_intensity_min | float | 300.0 | min: 0.0 | DIA b/y series minimum intensity to consider. |
DIAScoring:dia_byseries_ppm_diff | float | 10.0 | min: 0.0 | DIA b/y series minimal difference in ppm to consider. |
DIAScoring:dia_nr_isotopes | int | 4 | min: 0 | DIA number of isotopes to consider. |
DIAScoring:dia_nr_charges | int | 4 | min: 0 | DIA number of charges to consider. |
DIAScoring:peak_before_mono_max_ppm_diff | float | 20.0 | min: 0.0 | DIA maximal difference in ppm to count a peak at lower m/z when searching for evidence that a peak might not be monoisotopic. |
EMGScoring:interpolation_step | float | 0.2 | Sampling rate for the interpolation of the model function. | |
EMGScoring:tolerance_stdev_bounding_box | float | 3.0 | Bounding box has range [minimim of data, maximum of data] enlarged by tolerance_stdev_bounding_box times the standard deviation of the data. | |
EMGScoring:max_iteration | int | 500 | Maximum number of iterations using by Levenberg-Marquardt algorithm. | |
EMGScoring:init_mom | string | false | true, false | Initialize parameters using method of moments estimators. |
EMGScoring:statistics:mean | float | 1.0 | Centroid position of the model. | |
EMGScoring:statistics:variance | float | 1.0 | Variance of the model. | |
Scores:use_shape_score | string | true | true, false | Use the shape score (this score measures the similarity in shape of the transitions using a cross-correlation) |
Scores:use_coelution_score | string | true | true, false | Use the coelution score (this score measures the similarity in coelution of the transitions using a cross-correlation) |
Scores:use_rt_score | string | true | true, false | Use the retention time score (this score measure the difference in retention time) |
Scores:use_library_score | string | true | true, false | Use the library score |
Scores:use_elution_model_score | string | true | true, false | Use the elution model (EMG) score (this score fits a gaussian model to the peak and checks the fit) |
Scores:use_intensity_score | string | true | true, false | Use the intensity score |
Scores:use_nr_peaks_score | string | true | true, false | Use the number of peaks score |
Scores:use_total_xic_score | string | true | true, false | Use the total XIC score |
Scores:use_total_mi_score | string | false | true, false | Use the total MI score |
Scores:use_sn_score | string | true | true, false | Use the SN (signal to noise) score |
Scores:use_mi_score | string | false | true, false | Use the MI (mutual information) score |
Scores:use_dia_scores | string | true | true, false | Use the DIA (SWATH) scores. If turned off, will not use fragment ion spectra for scoring. |
Scores:use_ms1_correlation | string | false | true, false | Use the correlation scores with the MS1 elution profiles |
Scores:use_sonar_scores | string | false | true, false | Use the scores for SONAR scans (scanning swath) |
Scores:use_ion_mobility_scores | string | false | true, false | Use the scores for Ion Mobility scans |
Scores:use_ms1_fullscan | string | false | true, false | Use the full MS1 scan at the peak apex for scoring (ppm accuracy of precursor and isotopic pattern) |
Scores:use_ms1_mi | string | false | true, false | Use the MS1 MI score |
Scores:use_uis_scores | string | false | true, false | Use UIS scores for peptidoform identification |
Scores:use_ionseries_scores | string | true | true, false | Use MS2-level b/y ion-series scores for peptidoform identification |
Scores:use_ms2_isotope_scores | string | true | true, false | Use MS2-level isotope scores (pearson & manhattan) across product transitions (based on ID if annotated or averagine) |
typedef OpenSwath::LightCompound PeptideType |
typedef OpenSwath::LightProtein ProteinType |
typedef std::map<String, MRMTransitionGroupType> TransitionGroupMapType |
Type definitions.
Constructor.
|
override |
Destructor.
void mapExperimentToTransitionList | ( | const OpenSwath::SpectrumAccessPtr & | input, |
const OpenSwath::LightTargetedExperiment & | transition_exp, | ||
TransitionGroupMapType & | transition_group_map, | ||
TransformationDescription | trafo, | ||
double | rt_extraction_window | ||
) |
Map the chromatograms to the transitions.
Map an input chromatogram experiment (mzML) and transition list (TraML) onto each other when they share identifiers, e.g. if the transition id is the same as the chromatogram native id.
input | The input chromatograms |
transition_exp | The transition list describing the experiment |
transition_group_map | Mapping of transition groups |
trafo | Optional transformation of the experimental retention time to the normalized retention time space used in the transition list. |
rt_extraction_window | The used retention time extraction window |
void pickExperiment | ( | const OpenSwath::SpectrumAccessPtr & | input, |
FeatureMap & | output, | ||
const OpenSwath::LightTargetedExperiment & | transition_exp, | ||
const TransformationDescription & | trafo, | ||
const std::vector< OpenSwath::SwathMap > & | swath_maps, | ||
TransitionGroupMapType & | transition_group_map | ||
) |
Pick and score features in a single experiment from chromatograms.
input | The input chromatograms |
output | The output features with corresponding scores |
transition_exp | The transition list describing the experiment |
trafo | Optional transformation of the experimental retention time to the normalized retention time space used in the transition list. |
swath_maps | Optional SWATH-MS (DIA) map corresponding from which the chromatograms were extracted. Use empty map if no data is available. |
transition_group_map | Output mapping of transition groups |
void pickExperiment | ( | const PeakMap & | chromatograms, |
FeatureMap & | output, | ||
const TargetedExperiment & | transition_exp, | ||
const TransformationDescription & | trafo, | ||
const PeakMap & | swath_map | ||
) |
Picker and prepare functions.
Pick and score features in a single experiment from chromatograms
Function for for wrapping in Python, only uses OpenMS datastructures and does not return the map.
chromatograms | The input chromatograms |
output | The output features with corresponding scores |
transition_exp | The transition list describing the experiment |
trafo | Optional transformation of the experimental retention time to the normalized retention time space used in the transition list |
swath_map | Optional SWATH-MS (DIA) map corresponding from which the chromatograms were extracted |
|
private |
void prepareProteinPeptideMaps_ | ( | const OpenSwath::LightTargetedExperiment & | transition_exp | ) |
Prepares the internal mappings of peptides and proteins.
Calling this method _is_ required before calling scorePeakgroups.
transition_exp | The transition list describing the experiment |
|
private |
Provides scoring for target and decoy identification against detecting transitions.
The function is used twice, for target and decoy identification transitions. The results are reported analogously to the ones for detecting transitions but must be stored separately.
transition_group_identification | Containing all detecting and identifying transitions |
scorer | An instance of OpenSwathScoring |
feature_idx | The index of the current feature |
native_ids_detection | The native IDs of the detecting transitions |
det_intensity_ratio_score | The intensity score of the detection transitions for normalization |
det_mi_ratio_score | The MI score of the detection transitions for normalization |
swath_maps | Optional SWATH-MS (DIA) map corresponding from which the chromatograms were extracted. Use empty map if no data is available. |
void scorePeakgroups | ( | MRMTransitionGroupType & | transition_group, |
const TransformationDescription & | trafo, | ||
const std::vector< OpenSwath::SwathMap > & | swath_maps, | ||
FeatureMap & | output, | ||
bool | ms1only = false |
||
) | const |
Score all peak groups of a transition group.
Iterate through all features found along the chromatograms of the transition group and score each one individually.
transition_group | The MRMTransitionGroup to be scored (input) |
trafo | Optional transformation of the experimental retention time to the normalized retention time space used in the transition list. |
swath_maps | Optional SWATH-MS (DIA) map corresponding from which the chromatograms were extracted. Use empty map if no data is available. |
output | The output features with corresponding scores (the found features will be added to this FeatureMap). |
ms1only | Whether to only do MS1 scoring and skip all MS2 scoring |
|
inline |
Add an MS1 map containing spectra.
For DIA (SWATH-MS), an optional MS1 map can be supplied which can be used to extract precursor ion signal and provides additional scores. If no MS1 map is provided, the respective scores are not calculated.
ms1_map | The raw mass spectrometric MS1 data |
|
inline |
Set the flag for strict mapping.
|
private |
Splits combined transition groups into detection transition groups.
For standard assays, transition_group_detection is identical to transition_group and the others are empty.
transition_group | Containing all detecting, identifying transitions |
transition_group_detection | To be filled with detecting transitions |
|
private |
Splits combined transition groups into identification transition groups.
For standard assays, transition_group_identification is empty. When UIS scoring is enabled, it contains the corresponding identification transitions.
transition_group | Containing all detecting, identifying transitions |
transition_group_identification | To be filled with identifying transitions |
transition_group_identification_decoy | To be filled with identifying decoy transitions |
|
overrideprivatevirtual |
Synchronize members with param class.
Reimplemented from DefaultParamHandler.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |