OpenMS
MRMDecoy Class Reference

This class generates a TargetedExperiment object with decoys based on a TargetedExperiment object. More...

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

Inheritance diagram for MRMDecoy:
[legend]
Collaboration diagram for MRMDecoy:
[legend]

Public Types

typedef std::vector< size_t > IndexType
 
typedef std::vector< OpenMS::TargetedExperiment::ProteinProteinVectorType
 
typedef std::vector< OpenMS::TargetedExperiment::PeptidePeptideVectorType
 
typedef std::vector< OpenMS::ReactionMonitoringTransitionTransitionVectorType
 
typedef std::map< String, std::vector< const ReactionMonitoringTransition * > > PeptideTransitionMapType
 
- Public Types inherited from ProgressLogger
enum  LogType { CMD , GUI , NONE }
 Possible log types. More...
 

Public Member Functions

 MRMDecoy ()
 
void generateDecoys (const OpenMS::TargetedExperiment &exp, OpenMS::TargetedExperiment &dec, const String &method, const double aim_decoy_fraction, const bool switchKR, const String &decoy_tag, const int max_attempts, const double identity_threshold, const double precursor_mz_shift, const double product_mz_shift, const double product_mz_threshold, const std::vector< String > &fragment_types, const std::vector< size_t > &fragment_charges, const bool enable_specific_losses, const bool enable_unspecific_losses, const int round_decPow=-4) const
 Generate decoys from a TargetedExperiment. More...
 
void switchKR (OpenMS::TargetedExperiment::Peptide &peptide) const
 Switch the final Amino Acid of a tryptic peptide. E.g. If the last Amino Acid is "K" switch to "R" (and vice versa). More...
 
float AASequenceIdentity (const String &sequence, const String &decoy) const
 Compute relative identity (relative number of matches of amino acids at the same position) between two sequences. More...
 
OpenMS::TargetedExperiment::Peptide shufflePeptide (OpenMS::TargetedExperiment::Peptide peptide, const double identity_threshold, int seed=-1, const int max_attempts=100) const
 Shuffle a peptide (with its modifications) sequence. 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...
 
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...
 
virtual ~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 setLogger (ProgressLoggerImpl *logger)
 Sets the logger to be used for progress logging. 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 (UInt64 bytes_processed=0) const
 
void nextProgress () const
 increment progress by 1 (according to range begin-end) More...
 

Static Public Member Functions

static OpenMS::TargetedExperiment::Peptide reversePeptide (const OpenMS::TargetedExperiment::Peptide &peptide, const bool keepN, const bool keepC, const String &const_pattern=String())
 Reverse a peptide sequence (with its modifications) More...
 
static IndexType findFixedResidues (const std::string &sequence, bool keepN, bool keepC, const OpenMS::String &keep_const_pattern)
 Find all residues in a sequence that should not be reversed / shuffled. More...
 
- 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

bool hasCNterminalMods_ (const OpenMS::TargetedExperiment::Peptide &peptide, bool checkCterminalAA) const
 Check if a peptide has C or N terminal modifications. More...
 
IndexType findFixedResidues_ (const std::string &sequence) const
 Find all K, R, P sites in a sequence to be set as fixed. More...
 
IndexType findFixedAndTermResidues_ (const std::string &sequence) const
 Find all K, R, P and C-/N-terminal sites in a sequence to be set as fixed. More...
 
OpenMS::TargetedExperiment::Peptide pseudoreversePeptide_ (const OpenMS::TargetedExperiment::Peptide &peptide) const
 Pseudo-reverse a peptide sequence (with its modifications) More...
 
OpenMS::TargetedExperiment::Peptide reversePeptide_ (const OpenMS::TargetedExperiment::Peptide &peptide) const
 Reverse a peptide sequence (with its modifications) More...
 
String getModifiedPeptideSequence_ (const OpenMS::TargetedExperiment::Peptide &pep) const
 Convert a peptide to a string which contains the peptide sequence and modifications. More...
 
void updateMembers_ () override
 Synchronize members with param class. More...
 
- Protected Member Functions inherited from DefaultParamHandler
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 

Protected Attributes

String keep_const_pattern_
 
bool keepN_
 
bool keepC_
 
- 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_
 

Additional Inherited Members

- Static Protected Attributes inherited from ProgressLogger
static int recursion_depth_
 

Detailed Description

This class generates a TargetedExperiment object with decoys based on a TargetedExperiment object.

There are multiple methods to create the decoy transitions, the simplest ones are reverse and pseudo-reverse which reverse the sequence either completely or leaving the last (tryptic) AA untouched respectively.

Another decoy generation method is "shuffle" which uses an algorithm similar to the one described in Lam, Henry, et al. (2010). "Artificial decoy spectral libraries for false discovery rate estimation in spectral library searching in proteomics". Journal of Proteome Research 9, 605-610. It shuffles the amino acid sequence and shuffles the fragment ion intensities accordingly, however for this to work the fragment ions need to be matched to annotated before.

First, the algorithm goes through all peptides and applies the decoy method to the target peptide sequence (pseudo-reverse, reverse or shuffle) in order to produce the decoy sequence. Then, for each peptide, the fragment ions in the target library are matched to their most likely origin (e.g. the ions are annotated with their ion series (a,b,y) and the fragment number and optionally a neutral loss (10 different neutral losses are currently implemented)). For each fragment ion from the target peptide, an equivalent ion is created for the decoy peptide with the same intensity (e.g. if the target peptide sequence has a b5 ion with a normalized intensity of 200, an equivalent b5 ion for the decoy sequence is created and assigned the intensity 200). Optionally, the m/z values are corrected to reflect the theoretical value rather than the experimental value in the library.

Member Typedef Documentation

◆ IndexType

typedef std::vector<size_t> IndexType

◆ PeptideTransitionMapType

typedef std::map<String, std::vector<const ReactionMonitoringTransition*> > PeptideTransitionMapType

◆ PeptideVectorType

◆ ProteinVectorType

◆ TransitionVectorType

Constructor & Destructor Documentation

◆ MRMDecoy()

MRMDecoy ( )

Member Function Documentation

◆ AASequenceIdentity()

float AASequenceIdentity ( const String sequence,
const String decoy 
) const

Compute relative identity (relative number of matches of amino acids at the same position) between two sequences.

◆ findFixedAndTermResidues_()

IndexType findFixedAndTermResidues_ ( const std::string &  sequence) const
protected

Find all K, R, P and C-/N-terminal sites in a sequence to be set as fixed.

This method was adapted from the SpectraST decoy generator

◆ findFixedResidues()

static IndexType findFixedResidues ( const std::string &  sequence,
bool  keepN,
bool  keepC,
const OpenMS::String keep_const_pattern 
)
static

Find all residues in a sequence that should not be reversed / shuffled.

Parameters
sequenceThe amino acid sequence
keepNWhether to keep N terminus constant
keepCWhether to keep C terminus constant
keep_const_patternA string containing the AA to not change (e.g. 'KRP')

◆ findFixedResidues_()

IndexType findFixedResidues_ ( const std::string &  sequence) const
protected

Find all K, R, P sites in a sequence to be set as fixed.

This method was adapted from the SpectraST decoy generator

◆ generateDecoys()

void generateDecoys ( const OpenMS::TargetedExperiment exp,
OpenMS::TargetedExperiment dec,
const String method,
const double  aim_decoy_fraction,
const bool  switchKR,
const String decoy_tag,
const int  max_attempts,
const double  identity_threshold,
const double  precursor_mz_shift,
const double  product_mz_shift,
const double  product_mz_threshold,
const std::vector< String > &  fragment_types,
const std::vector< size_t > &  fragment_charges,
const bool  enable_specific_losses,
const bool  enable_unspecific_losses,
const int  round_decPow = -4 
) const

Generate decoys from a TargetedExperiment.

Will generate decoy peptides for each target peptide provided in exp and write them into the decoy experiment.

Valid methods: shuffle, reverse, pseudo-reverse

If theoretical is true, the target transitions will be returned but their masses will be adjusted to match the theoretical value of the fragment ion that is the most likely explanation for the product.

mz_threshold is used for the matching of theoretical ion series to the observed one

To generate decoys with different precursor mass, use the "switchKR" flag which switches terminal K/R (switches K to R and R to K). This generates different precursor m/z and ensures that the y ion series has a different mass. For a description of the procedure, see (supplemental material)

Bruderer et al. Mol Cell Proteomics. 2017. 10.1074/mcp.RA117.000314.

◆ getModifiedPeptideSequence_()

String getModifiedPeptideSequence_ ( const OpenMS::TargetedExperiment::Peptide pep) const
protected

Convert a peptide to a string which contains the peptide sequence and modifications.

◆ hasCNterminalMods_()

bool hasCNterminalMods_ ( const OpenMS::TargetedExperiment::Peptide peptide,
bool  checkCterminalAA 
) const
protected

Check if a peptide has C or N terminal modifications.

◆ pseudoreversePeptide_()

OpenMS::TargetedExperiment::Peptide pseudoreversePeptide_ ( const OpenMS::TargetedExperiment::Peptide peptide) const
protected

Pseudo-reverse a peptide sequence (with its modifications)

Note
Pseudo reverses a peptide sequence, leaving the C terminus (the last AA constant)

◆ reversePeptide()

static OpenMS::TargetedExperiment::Peptide reversePeptide ( const OpenMS::TargetedExperiment::Peptide peptide,
const bool  keepN,
const bool  keepC,
const String const_pattern = String() 
)
static

Reverse a peptide sequence (with its modifications)

Parameters
peptideThe peptide sequence and modifications
keepNWhether to keep N terminus in place
keepCWhether to keep C terminus in place
const_patternA list of AA to leave in place

◆ reversePeptide_()

OpenMS::TargetedExperiment::Peptide reversePeptide_ ( const OpenMS::TargetedExperiment::Peptide peptide) const
protected

Reverse a peptide sequence (with its modifications)

Note
Does not keep N / C terminus in place.

◆ shufflePeptide()

OpenMS::TargetedExperiment::Peptide shufflePeptide ( OpenMS::TargetedExperiment::Peptide  peptide,
const double  identity_threshold,
int  seed = -1,
const int  max_attempts = 100 
) const

Shuffle a peptide (with its modifications) sequence.

This function will shuffle the given peptide sequences and its modifications such that the resulting relative sequence identity is below identity_threshold.

◆ switchKR()

void switchKR ( OpenMS::TargetedExperiment::Peptide peptide) const

Switch the final Amino Acid of a tryptic peptide. E.g. If the last Amino Acid is "K" switch to "R" (and vice versa).

Note
If the last Amino Acid is neither "K" or "R", the last Amino Acid is changed to a random Amino Acid .

◆ updateMembers_()

void updateMembers_ ( )
overrideprotectedvirtual

Synchronize members with param class.

Reimplemented from DefaultParamHandler.

Member Data Documentation

◆ keep_const_pattern_

String keep_const_pattern_
protected

◆ keepC_

bool keepC_
protected

◆ keepN_

bool keepN_
protected