All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
DecoyGenerator Class Reference

Methods to generate isobaric decoy sequences for DDA target-decoy searches. More...

#include <OpenMS/CHEMISTRY/DecoyGenerator.h>

Collaboration diagram for DecoyGenerator:
[legend]

Public Member Functions

 DecoyGenerator ()
 
 ~DecoyGenerator ()=default
 
void setSeed (UInt64 seed)
 
AASequence reverseProtein (const AASequence &protein) const
 
AASequence reversePeptides (const AASequence &protein, const String &protease) const
 
std::vector< AASequenceshuffle (const AASequence &protein, const String &protease, int decoy_factor=1)
 Generate decoy protein sequences using shuffle algorithm. More...
 
AASequence shufflePeptides (const AASequence &aas, const String &protease, const int max_attempts=100)
 

Static Private Member Functions

static double SequenceIdentity_ (const String &decoy, const String &target)
 

Private Attributes

Math::RandomShuffler shuffler_
 
std::unordered_map< std::string, std::string > td_cache_
 

Detailed Description

Methods to generate isobaric decoy sequences for DDA target-decoy searches.

Constructor & Destructor Documentation

◆ DecoyGenerator()

◆ ~DecoyGenerator()

~DecoyGenerator ( )
default

Member Function Documentation

◆ reversePeptides()

AASequence reversePeptides ( const AASequence protein,
const String protease 
) const

◆ reverseProtein()

AASequence reverseProtein ( const AASequence protein) const

◆ SequenceIdentity_()

static double SequenceIdentity_ ( const String decoy,
const String target 
)
staticprivate

◆ setSeed()

void setSeed ( UInt64  seed)

◆ shuffle()

std::vector<AASequence> shuffle ( const AASequence protein,
const String protease,
int  decoy_factor = 1 
)

Generate decoy protein sequences using shuffle algorithm.

Digests the protein using the specified protease and shuffles each resulting peptide to minimize sequence identity with the target. For top-down proteomics, use "no cleavage" as the protease to shuffle the entire protein as a single sequence.

Parameters
proteinThe protein sequence to generate decoys from
proteaseThe enzyme name (e.g., "Trypsin", "Trypsin/P", "no cleavage")
decoy_factorNumber of decoy variants to generate per target peptide (default: 1)
Returns
Vector of shuffled decoy sequences (one entry per decoy variant)
Note
  • Peptides <= 2 amino acids are kept unchanged
  • Each peptide uses a fresh DecoyGenerator with fixed seed to ensure identical peptides produce identical decoys across different proteins
  • Modifications are discarded
  • Returns decoy_factor number of complete protein sequences

◆ shufflePeptides()

AASequence shufflePeptides ( const AASequence aas,
const String protease,
const int  max_attempts = 100 
)

Member Data Documentation

◆ shuffler_

Math::RandomShuffler shuffler_
private

◆ td_cache_

std::unordered_map<std::string, std::string> td_cache_
private