OpenMS  2.4.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MRMFeatureFinderScoring Class Reference

The MRMFeatureFinder finds and scores peaks of transitions that co-elute. More...

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

Inheritance diagram for MRMFeatureFinderScoring:
DefaultParamHandler ProgressLogger

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, TransitionTypeMRMTransitionGroupType
 
typedef std::map< String, MRMTransitionGroupTypeTransitionGroupMapType
 
- 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 scorePeakgroups (MRMTransitionGroupType &transition_group, const TransformationDescription &trafo, const std::vector< OpenSwath::SwathMap > &swath_maps, FeatureMap &output, bool ms1only=false)
 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 (OpenSwath::SpectrumAccessPtr input, OpenSwath::LightTargetedExperiment &transition_exp, TransitionGroupMapType &transition_group_map, TransformationDescription trafo, double rt_extraction_window)
 Map the chromatograms to the transitions. More...
 
void pickExperiment (PeakMap &chromatograms, FeatureMap &output, TargetedExperiment &transition_exp, TransformationDescription trafo, PeakMap &swath_map)
 Picker and prepare functions. More...
 
void pickExperiment (OpenSwath::SpectrumAccessPtr input, FeatureMap &output, OpenSwath::LightTargetedExperiment &transition_exp, TransformationDescription trafo, std::vector< OpenSwath::SwathMap > swath_maps, TransitionGroupMapType &transition_group_map)
 Pick features in one experiment containing chromatogram. More...
 
void prepareProteinPeptideMaps_ (const OpenSwath::LightTargetedExperiment &transition_exp)
 Prepares the internal mappings of peptides and proteins. 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...
 
- 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

void splitTransitionGroupsDetection_ (const MRMTransitionGroupType &transition_group, MRMTransitionGroupType &transition_group_detection)
 Splits combined transition groups into detection transition groups. More...
 
void splitTransitionGroupsIdentification_ (const MRMTransitionGroupType &transition_group, MRMTransitionGroupType &transition_group_identification, MRMTransitionGroupType &transition_group_identification_decoy)
 Splits combined transition groups into identification transition groups. More...
 
OpenSwath_Scores scoreIdentification_ (MRMTransitionGroupType &transition_group_identification, OpenSwathScoring &scorer, const size_t feature_idx, const std::vector< std::string > &native_ids_detection, const double sn_win_len_, const unsigned int sn_bin_count_, const double det_intensity_ratio_score, const double det_mi_ratio_score, bool write_log_messages, const std::vector< OpenSwath::SwathMap > &swath_maps)
 Provides scoring for target and decoy identification against detecting transitions. More...
 
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_
 
double spacing_for_spectra_resampling_
 
double uis_threshold_sn_
 
double uis_threshold_peak_area_
 
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

- 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< 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...
 
- 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 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.

Member Typedef Documentation

◆ ModificationType

◆ MRMTransitionGroupType

◆ PeptideType

◆ ProteinType

◆ TargetedExpType

◆ TransitionGroupMapType

◆ TransitionType

Type definitions.

Constructor & Destructor Documentation

◆ MRMFeatureFinderScoring()

Constructor.

◆ ~MRMFeatureFinderScoring()

~MRMFeatureFinderScoring ( )
override

Destructor.

Member Function Documentation

◆ mapExperimentToTransitionList()

void mapExperimentToTransitionList ( OpenSwath::SpectrumAccessPtr  input,
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.

Parameters
inputThe input chromatograms
transition_expThe transition list describing the experiment
transition_group_mapMapping of transition groups
trafoOptional transformation of the experimental retention time to the normalized retention time space used in the transition list.
rt_extraction_windowThe used retention time extraction window

◆ pickExperiment() [1/2]

void pickExperiment ( PeakMap chromatograms,
FeatureMap output,
TargetedExperiment transition_exp,
TransformationDescription  trafo,
PeakMap swath_map 
)

Picker and prepare functions.

Pick features in one experiment containing chromatogram

Function for for wrapping in Python, only uses OpenMS datastructures and does not return the map.

Parameters
chromatogramsThe input chromatograms
outputThe output features with corresponding scores
transition_expThe transition list describing the experiment
trafoOptional transformation of the experimental retention time to the normalized retention time space used in the transition list
swath_mapOptional SWATH-MS (DIA) map corresponding from which the chromatograms were extracted

◆ pickExperiment() [2/2]

void pickExperiment ( OpenSwath::SpectrumAccessPtr  input,
FeatureMap output,
OpenSwath::LightTargetedExperiment transition_exp,
TransformationDescription  trafo,
std::vector< OpenSwath::SwathMap swath_maps,
TransitionGroupMapType transition_group_map 
)

Pick features in one experiment containing chromatogram.

Parameters
inputThe input chromatograms
outputThe output features with corresponding scores
transition_expThe transition list describing the experiment
trafoOptional transformation of the experimental retention time to the normalized retention time space used in the transition list.
swath_mapOptional SWATH-MS (DIA) map corresponding from which the chromatograms were extracted. Use empty map if no data is available.
transition_group_mapOutput mapping of transition groups

◆ prepareProteinPeptideMaps_()

void prepareProteinPeptideMaps_ ( const OpenSwath::LightTargetedExperiment transition_exp)

Prepares the internal mappings of peptides and proteins.

Calling this method _is_ required before calling scorePeakgroups.

Parameters
transition_expThe transition list describing the experiment

◆ scoreIdentification_()

OpenSwath_Scores scoreIdentification_ ( MRMTransitionGroupType transition_group_identification,
OpenSwathScoring scorer,
const size_t  feature_idx,
const std::vector< std::string > &  native_ids_detection,
const double  sn_win_len_,
const unsigned int  sn_bin_count_,
const double  det_intensity_ratio_score,
const double  det_mi_ratio_score,
bool  write_log_messages,
const std::vector< OpenSwath::SwathMap > &  swath_maps 
)
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.

Parameters
transition_groupContaining all detecting, identifying transitions
transition_group_identificationContaining all detecting and identifying transitions
scorerAn instance of OpenSwathScoring
feature_idxThe index of the current feature
native_ids_detectionThe native IDs of the detecting transitions
sn_win_len_The signal to noise window length
sn_bin_count_The signal to noise bin count
det_intensity_ratio_scoreThe intensity score of the detection transitions for normalization
det_mi_ratio_scoreThe MI score of the detection transitions for normalization
write_log_messagesWhether to write signal to noise log messages a struct of type OpenSwath_Scores containing either target or decoy values

◆ scorePeakgroups()

void scorePeakgroups ( MRMTransitionGroupType transition_group,
const TransformationDescription trafo,
const std::vector< OpenSwath::SwathMap > &  swath_maps,
FeatureMap output,
bool  ms1only = false 
)

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.

Parameters
transition_groupThe MRMTransitionGroup to be scored (input)
trafoOptional transformation of the experimental retention time to the normalized retention time space used in the transition list.
swath_mapOptional SWATH-MS (DIA) map corresponding from which the chromatograms were extracted. Use empty map if no data is available.
outputThe output features with corresponding scores (the found features will be added to this FeatureMap).
ms1onlyWhether to only do MS1 scoring and skip all MS2 scoring

◆ setMS1Map()

void setMS1Map ( OpenSwath::SpectrumAccessPtr  ms1_map)
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.

Parameters
ms1_mapThe raw mass spectrometric MS1 data

◆ setStrictFlag()

void setStrictFlag ( bool  f)
inline

Set the flag for strict mapping.

◆ splitTransitionGroupsDetection_()

void splitTransitionGroupsDetection_ ( const MRMTransitionGroupType transition_group,
MRMTransitionGroupType transition_group_detection 
)
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.

Parameters
transition_groupContaining all detecting, identifying transitions
transition_group_detectionTo be filled with detecting transitions

◆ splitTransitionGroupsIdentification_()

void splitTransitionGroupsIdentification_ ( const MRMTransitionGroupType transition_group,
MRMTransitionGroupType transition_group_identification,
MRMTransitionGroupType transition_group_identification_decoy 
)
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.

Parameters
transition_groupContaining all detecting, identifying transitions
transition_group_identificationTo be filled with identifying transitions
transition_group_identification_decoyTo be filled with identifying decoy transitions

◆ updateMembers_()

void updateMembers_ ( )
overrideprivatevirtual

Synchronize members with param class.

Reimplemented from DefaultParamHandler.

Member Data Documentation

◆ add_up_spectra_

int add_up_spectra_
private

◆ diascoring_

OpenMS::DIAScoring diascoring_
private

◆ emgscoring_

OpenMS::EmgScoring emgscoring_
private

◆ ms1_map_

OpenSwath::SpectrumAccessPtr ms1_map_
private

◆ PeptideRefMap_

std::map<OpenMS::String, const PeptideType*> PeptideRefMap_
private

◆ quantification_cutoff_

double quantification_cutoff_
private

◆ rt_extraction_window_

double rt_extraction_window_
private

◆ rt_normalization_factor_

double rt_normalization_factor_
private

◆ scoring_model_

String scoring_model_
private

◆ sonarscoring_

OpenMS::SONARScoring sonarscoring_
private

◆ spacing_for_spectra_resampling_

double spacing_for_spectra_resampling_
private

◆ stop_report_after_feature_

int stop_report_after_feature_
private

◆ strict_

bool strict_
private

◆ su_

◆ uis_threshold_peak_area_

double uis_threshold_peak_area_
private

◆ uis_threshold_sn_

double uis_threshold_sn_
private

◆ write_convex_hull_

bool write_convex_hull_
private