OpenMS  2.7.0
Classes | Static Public Member Functions | Public Attributes | Static Protected Member Functions | Static Protected Attributes | List of all members
MetaboTargetedAssay Class Reference

This class provides methods for the extraction of targeted assays for metabolomics. More...

#include <OpenMS/ANALYSIS/TARGETED/MetaboTargetedAssay.h>

Collaboration diagram for MetaboTargetedAssay:
[legend]

Classes

class  CompoundTargetDecoyPair
 CompoundTargetDecoyPair stores a pair of CompoundInfo and MSSpectrum (target, decoy) More...
 
class  TargetDecoyGroup
 TargetDecoyGroup stores the mz, rt and file number in correspondence to the index of a MetaboTargetedAssay vector. More...
 

Static Public Member Functions

static std::vector< MetaboTargetedAssayextractMetaboTargetedAssay (const MSExperiment &spectra, const FeatureMapping::FeatureToMs2Indices &feature_ms2_index, const double &precursor_rt_tol, const double &precursor_mz_distance, const double &cosine_sim_threshold, const double &transition_threshold, const double &min_fragment_mz, const double &max_fragment_mz, const bool &method_consensus_spectrum, const bool &exclude_ms2_precursor, const unsigned int &file_counter)
 Extract a vector of MetaboTargetedAssays without using fragment annotation. More...
 
static std::vector< MetaboTargetedAssayextractMetaboTargetedAssayFragmentAnnotation (const std::vector< CompoundTargetDecoyPair > &v_cmp_spec, const double &transition_threshold, const double &min_fragment_mz, const double &max_fragment_mz, const bool &use_exact_mass, const bool &exclude_ms2_precursor, const unsigned int &file_counter)
 Extract a vector of MetaboTargetedAssays using fragment annotation. More...
 
static std::vector< MetaboTargetedAssay::CompoundTargetDecoyPairpairCompoundWithAnnotatedSpectra (const std::vector< SiriusMSFile::CompoundInfo > &v_cmpinfo, const std::vector< SiriusFragmentAnnotation::SiriusTargetDecoySpectra > &annotated_spectra)
 Pair compound information (SiriusMSFile) with the annotated target and decoy spectrum from SIRIUS/Passatutto based on the m_id (unique identifier composed of description_filepath_native_id_k introduced in the SiriusMSConverter) More...
 
static std::unordered_map< UInt64, std::vector< MetaboTargetedAssay > > buildAmbiguityGroup (const std::vector< MetaboTargetedAssay > &v_mta, const double &ar_mz_tol, const double &ar_rt_tol, const String &ar_mz_tol_unit_res, size_t in_files_size)
 Perform feature linking to build ambiguity groups based on the target and decoy position in the vector of MetaboTargetedAssays. More...
 
static void resolveAmbiguityGroup (std::unordered_map< UInt64, std::vector< MetaboTargetedAssay > > &map_mta_filter, const double &total_occurrence_filter, size_t in_files_size)
 Resolve ambiguity groups based on occurrence in samples (e.g. at least in 20% of the samples) and if multiple possible identifications are reported within one ambiguity group use the one with the highest occurrence. More...
 

Public Attributes

double precursor_int
 MetaboTargetedAssay is able to store a precursor, metadata as well as compound information. More...
 
double transition_quality_score
 transitions quality score (not yet used) More...
 
double precursor_mz
 precursor mass-to-charge More...
 
double compound_rt
 compound retention time More...
 
String molecular_formula
 < (putative) molecular formula More...
 
int compound_file
 integer of file it belongs to in a list of files More...
 
String compound_name
 compound name More...
 
String compound_adduct
 compound adduct More...
 
TargetedExperiment::Compound potential_cmp
 compound information stored in a TargetedExperiment More...
 
std::vector< ReactionMonitoringTransitionpotential_rmts
 vector of transitions belonging to the compound More...
 

Static Protected Member Functions

static bool intensityLess_ (Peak1D a, Peak1D b)
 Compare two peaks based on their intensity. More...
 
static int getChargeFromAdduct_ (const String &adduct)
 Gets charge from a singly charged adduct ([M+H]+/[M-H]-) More...
 
static void filterBasedOnTotalOccurrence_ (std::vector< MetaboTargetedAssay > &mta, double total_occurrence_filter, size_t in_files_size)
 Filter one ambiguity group based on occurrence in samples (e.g. at least in 20% of the samples) More...
 
static void filterBasedOnMolFormAdductOccurrence_ (std::vector< MetaboTargetedAssay > &mta)
 Filter one ambiguity group with multiple possible identifications to use the one with the highest occurrence. More...
 
static void sortByPrecursorInt (std::vector< MetaboTargetedAssay > &vec_mta)
 Sort vector of MetaboTargetedAssay by precursor ion intensity. More...
 

Static Protected Attributes

static constexpr float noise_threshold_constant_ = 1.1
 Used to calculate the hard noise intensity threshold hard minimal threshold of min_int * noise_threshold_constant_. More...
 

Detailed Description

This class provides methods for the extraction of targeted assays for metabolomics.


Class Documentation

◆ OpenMS::MetaboTargetedAssay::TargetDecoyGroup

class OpenMS::MetaboTargetedAssay::TargetDecoyGroup

TargetDecoyGroup stores the mz, rt and file number in correspondence to the index of a MetaboTargetedAssay vector.

Collaboration diagram for MetaboTargetedAssay::TargetDecoyGroup:
[legend]
Class Members
int decoy_file_number
int decoy_index
double decoy_mz
double decoy_rt
int target_file_number
int target_index
double target_mz
double target_rt

Member Function Documentation

◆ buildAmbiguityGroup()

static std::unordered_map< UInt64, std::vector<MetaboTargetedAssay> > buildAmbiguityGroup ( const std::vector< MetaboTargetedAssay > &  v_mta,
const double &  ar_mz_tol,
const double &  ar_rt_tol,
const String ar_mz_tol_unit_res,
size_t  in_files_size 
)
static

Perform feature linking to build ambiguity groups based on the target and decoy position in the vector of MetaboTargetedAssays.

Returns
Map of pair (mz, rt) and vector of ambiguities for this mz,rt combination (MetaboTargetedAssay)
Parameters
v_mtaVector of MetaboTargetedAssay
ar_mz_tolFeatureGroupingAlgorithmQT parameter distance_MZ:max_difference
ar_rt_tolFeatureGroupingAlgorithmQT parameter distance_RT:max_difference
ar_mz_tol_unit_resFeatureGroupingAlgorithmQT parameter distance_MZ_unit (ppm, Da)
in_files_sizeNumber of files which were processed in the vector of MetaboTargetedAssay (e.g. initially 5 different files in the vector<MetaboTargetedAssay>)

◆ extractMetaboTargetedAssay()

static std::vector<MetaboTargetedAssay> extractMetaboTargetedAssay ( const MSExperiment spectra,
const FeatureMapping::FeatureToMs2Indices feature_ms2_index,
const double &  precursor_rt_tol,
const double &  precursor_mz_distance,
const double &  cosine_sim_threshold,
const double &  transition_threshold,
const double &  min_fragment_mz,
const double &  max_fragment_mz,
const bool &  method_consensus_spectrum,
const bool &  exclude_ms2_precursor,
const unsigned int &  file_counter 
)
static

Extract a vector of MetaboTargetedAssays without using fragment annotation.

Returns
Vector of MetaboTargetedAssay
Parameters
spectraInput of MSExperiment with spectra information
feature_ms2_spectra_mapFeatureMapping class with associated MS2 spectra
precursor_rt_tolRetention time tolerance of the precursor
precursor_mz_distanceMax m/z distance of the precursor entries of two spectra to be merged
cosine_sim_thresholdCosine similarity threshold for the usage of SpectraMerger
transition_thresholdIntensity threshold for MS2 peak used in MetaboTargetedAssay
min_fragment_mzMinimum m/z a fragment ion has to have to be considered as a transition
max_fragment_mzMaximum m/z a fragment ion has to have to be considered as a transition
method_consensus_spectrumBoolean to use consensus spectrum method
exclude_ms2_precursorBoolean to exclude MS2 precursor from MetaboTargetedAssay
file_counterCount if multiple files are used.

◆ extractMetaboTargetedAssayFragmentAnnotation()

static std::vector<MetaboTargetedAssay> extractMetaboTargetedAssayFragmentAnnotation ( const std::vector< CompoundTargetDecoyPair > &  v_cmp_spec,
const double &  transition_threshold,
const double &  min_fragment_mz,
const double &  max_fragment_mz,
const bool &  use_exact_mass,
const bool &  exclude_ms2_precursor,
const unsigned int &  file_counter 
)
static

Extract a vector of MetaboTargetedAssays using fragment annotation.

Returns
Vector of MetaboTargetedAssay
Parameters
v_cmp_specVector of CompoundInfo with associated fragment annotated MSspectrum
transition_thresholdIntensity threshold for MS2 peak used in MetaboTargetedAssay
min_fragment_mzMinimum m/z a fragment ion has to have to be considered as a transition
max_fragment_mzMaximum m/z a fragment ion has to have to be considered as a transition
use_exact_massBoolean if exact mass should be used as peak mass for annotated fragments
exclude_ms2_precursorBoolean to exclude MS2 precursor from MetaboTargetedAssay
file_counterCount if multiple files are used.

◆ filterBasedOnMolFormAdductOccurrence_()

static void filterBasedOnMolFormAdductOccurrence_ ( std::vector< MetaboTargetedAssay > &  mta)
staticprotected

Filter one ambiguity group with multiple possible identifications to use the one with the highest occurrence.

Returns
Vector of MetaboTargetedAssay

◆ filterBasedOnTotalOccurrence_()

static void filterBasedOnTotalOccurrence_ ( std::vector< MetaboTargetedAssay > &  mta,
double  total_occurrence_filter,
size_t  in_files_size 
)
staticprotected

Filter one ambiguity group based on occurrence in samples (e.g. at least in 20% of the samples)

Returns
Vector of MetaboTargetedAssay
Parameters
total_occurrence_filterValue which has to be reached for the ambiguity group to be reported (e.g. in 20 % of the samples)
in_files_sizeNumber of files which were processed in the vector of MetaboTargetedAssay (e.g. initially 5 different files in the vector<MetaboTargetedAssay>)

◆ getChargeFromAdduct_()

static int getChargeFromAdduct_ ( const String adduct)
staticprotected

Gets charge from a singly charged adduct ([M+H]+/[M-H]-)

◆ intensityLess_()

static bool intensityLess_ ( Peak1D  a,
Peak1D  b 
)
staticprotected

Compare two peaks based on their intensity.

◆ pairCompoundWithAnnotatedSpectra()

static std::vector< MetaboTargetedAssay::CompoundTargetDecoyPair > pairCompoundWithAnnotatedSpectra ( const std::vector< SiriusMSFile::CompoundInfo > &  v_cmpinfo,
const std::vector< SiriusFragmentAnnotation::SiriusTargetDecoySpectra > &  annotated_spectra 
)
static

Pair compound information (SiriusMSFile) with the annotated target and decoy spectrum from SIRIUS/Passatutto based on the m_id (unique identifier composed of description_filepath_native_id_k introduced in the SiriusMSConverter)

Returns
Vector of MetaboTargetedAssay::CompoundTargetDecoyPair
Parameters
v_cmpinfoVector of SiriusMSFile::CompoundInfo
annotated_spectraVector of SiriusTargetDecoySpectra

◆ resolveAmbiguityGroup()

static void resolveAmbiguityGroup ( std::unordered_map< UInt64, std::vector< MetaboTargetedAssay > > &  map_mta_filter,
const double &  total_occurrence_filter,
size_t  in_files_size 
)
static

Resolve ambiguity groups based on occurrence in samples (e.g. at least in 20% of the samples) and if multiple possible identifications are reported within one ambiguity group use the one with the highest occurrence.

Returns
Map of pair (mz, rt) and vector of ambiguities for this mz,rt combination (MetaboTargetedAssay)
Parameters
total_occurrence_filterValue which has to be reached for the ambiguity group to be reported (e.g. in 20 % of the samples)
in_files_sizeNumber of files which were processed in the vector of MetaboTargetedAssay (e.g. initially 5 different files in the vector<MetaboTargetedAssay>)

◆ sortByPrecursorInt()

static void sortByPrecursorInt ( std::vector< MetaboTargetedAssay > &  vec_mta)
staticprotected

Sort vector of MetaboTargetedAssay by precursor ion intensity.

Member Data Documentation

◆ compound_adduct

String compound_adduct

compound adduct

◆ compound_file

int compound_file

integer of file it belongs to in a list of files

◆ compound_name

String compound_name

compound name

◆ compound_rt

double compound_rt

compound retention time

◆ molecular_formula

String molecular_formula

< (putative) molecular formula

◆ noise_threshold_constant_

constexpr float noise_threshold_constant_ = 1.1
staticconstexprprotected

Used to calculate the hard noise intensity threshold hard minimal threshold of min_int * noise_threshold_constant_.

◆ potential_cmp

compound information stored in a TargetedExperiment

◆ potential_rmts

std::vector<ReactionMonitoringTransition> potential_rmts

vector of transitions belonging to the compound

◆ precursor_int

double precursor_int

MetaboTargetedAssay is able to store a precursor, metadata as well as compound information.

precursor intensity

◆ precursor_mz

double precursor_mz

precursor mass-to-charge

◆ transition_quality_score

double transition_quality_score

transitions quality score (not yet used)