OpenMS
DecoyGenerator.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Timo Sachsenberg $
6 // $Authors: Timo Sachsenberg $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 #include <OpenMS/CONCEPT/Types.h>
13 
14 namespace OpenMS
15 {
16  class AASequence;
17  class DigestionEnzymeProtein;
18 
22  class OPENMS_DLLAPI DecoyGenerator
23  {
24  public:
25  // initializes random generator
27 
28  // destructor
29  ~DecoyGenerator() = default;
30 
31  // random seed for shuffling
32  void setSeed(UInt64 seed);
33 
34  /*
35  @brief reverses the protein sequence.
36  note: modifications are discarded
37  */
38  AASequence reverseProtein(const AASequence& protein) const;
39 
40  /*
41  @brief reverses the protein's peptide sequences between enzymatic cutting positions.
42  note: modifications are discarded
43  */
44  AASequence reversePeptides(const AASequence& protein, const String& protease) const;
45 
46  /*
47  @brief shuffle the protein's peptide sequences between enzymatic cutting positions.
48  each peptide is shuffled @param max_attempts times to minimize sequence identity.
49  note: modifications are discarded
50  */
52  const AASequence& aas,
53  const String& protease,
54  const int max_attempts = 100
55  );
56 
57  private:
58  // sequence identity by matching AAs
59  static double SequenceIdentity_(const String& decoy, const String& target);
60 
61  // portable shuffle
63  };
64 }
65 
Representation of a peptide/protein sequence.
Definition: AASequence.h:86
Methods to generate isobaric decoy sequences for DDA target-decoy searches.
Definition: DecoyGenerator.h:23
void setSeed(UInt64 seed)
static double SequenceIdentity_(const String &decoy, const String &target)
AASequence shufflePeptides(const AASequence &aas, const String &protease, const int max_attempts=100)
Math::RandomShuffler shuffler_
Definition: DecoyGenerator.h:62
AASequence reverseProtein(const AASequence &protein) const
AASequence reversePeptides(const AASequence &protein, const String &protease) const
Definition: MathFunctions.h:382
A more convenient string class.
Definition: String.h:34
OPENMS_UINT64_TYPE UInt64
Unsigned integer type (64bit)
Definition: Types.h:51
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22