Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
ConsensusIDAlgorithmPEPMatrix.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2017.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Hendrik Weisser $
32 // $Authors: Andreas Bertsch, Marc Sturm, Sven Nahnsen, Hendrik Weisser $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_ANALYSIS_ID_CONSENSUSIDALGORITHMPEPMATRIX_H
36 #define OPENMS_ANALYSIS_ID_CONSENSUSIDALGORITHMPEPMATRIX_H
37 
40 
41 // Extend SeqAn by a user-define scoring matrix.
42 namespace seqan
43 {
44 
45  // We have to create a new specialization of the _ScoringMatrix class
46  // for amino acids. For this, we first create a new tag.
47  struct PAM30MS {}; // PAM30MS matrix
48  struct AdaptedIdentity {}; // identity matrix adapted for I/L, Q/K ambiguity
49 
50  // Then, we specialize the class _ScoringMatrix.
51  template <>
52  struct ScoringMatrixData_<int, AminoAcid, PAM30MS>
53  {
54  enum
55  {
56  VALUE_SIZE = ValueSize<AminoAcid>::VALUE,
57  TAB_SIZE = VALUE_SIZE * VALUE_SIZE
58  };
59  static inline const int* getData()
60  {
61  // Rant: I cannot find a primary source for the PAM30MS scoring matrix!
62  // It seems to have been first published in Huang et al., JBC 2001
63  // (http://www.jbc.org/content/276/30/28327), but the paper does not show
64  // the actual matrix (gah!).
65  // The matrix here comes from old OpenMS code and also matches this one:
66  // http://proteomics.fiocruz.br/supplementaryfiles/pepexplorer/BeforeRevision/PFUGridResults/PFUGridSearch/pam30ms.txt
67 
68  static const int _data[TAB_SIZE] =
69  {
70  // A R N D C Q E G H I L K M F P S T W Y V B Z X *
71  /* A */ 6, -7, -4, -3, -6, -4, -2, -2, -7, -5, -6, -7, -5, -8, -2, 0, -1,-13, -8, -2, -7, -6, 0,-17,
72  /* R */ -7, 8, -6,-10, -8, -2, -9, -9, -2, -5, -7, 0, -4, -9, -4, -3, -6, -2,-10, -8, 5, -1, 0,-17,
73  /* N */ -4, -6, 8, 2,-11, -3, -2, -3, 0, -5, -6, -1, -9, -9, -6, 0, -2, -8, -4, -8, -4, -2, 0,-17,
74  /* D */ -3,-10, 2, 8,-14, -2, 2, -3, -4, -7,-10, -4,-11,-15, -8, -4, -5,-15,-11, -8, -7, -3, 0,-17,
75  /* C */ -6, -8,-11,-14, 10,-14,-14, -9, -7, -6,-11,-14,-13,-13, -8, -3, -8,-15, -4, -6,-11,-14, 0,-17,
76  /* Q */ -4, -2, -3, -2,-14, 8, 1, -7, 1, -8, -7, -3, -4,-13, -3, -5, -5,-13,-12, -7, -3, 4, 0,-17,
77  /* E */ -2, -9, -2, 2,-14, 1, 8, -4, -5, -5, -7, -4, -7,-14, -5, -4, -6,-17, -8, -6, -7, -2, 0,-17,
78  /* G */ -2, -9, -3, -3, -9, -7, -4, 6, -9,-11,-11, -7, -8, -9, -6, -2, -6,-15,-14, -5, -8, -7, 0,-17,
79  /* H */ -7, -2, 0, -4, -7, 1, -5, -9, 9, -9, -8, -6,-10, -6, -4, -6, -7, -7, -3, -6, -4, -3, 0,-17,
80  /* I */ -5, -5, -5, -7, -6, -8, -5,-11, -9, 8, 5, -6, -1, -2, -8, -7, -2,-14, -6, 2, -6, -7, 0,-17,
81  /* L */ -6, -7, -6,-10,-11, -7, -7,-11, -8, 5, 5, -7, 0, -3, -8, -8, -5,-10, -7, 0, -7, -7, 0,-17,
82  /* K */ -7, 0, -1, -4,-14, -3, -4, -7, -6, -6, -7, 7, -2,-14, -6, -4, -3,-12, -9, -9, 5, 4, 0,-17,
83  /* M */ -5, -4, -9,-11,-13, -4, -7, -8,-10, -1, 0, -2, 11, -4, -8, -5, -4,-13,-11, -1, -3, -3, 0,-17,
84  /* F */ -8, -9, -9,-15,-13,-13,-14, -9, -6, -2, -3,-14, -4, 9,-10, -6, -9, -4, 2, -8,-12,-14, 0,-17,
85  /* P */ -2, -4, -6, -8, -8, -3, -5, -6, -4, -8, -8, -6, -8,-10, 8, -2, -4,-14,-13, -6, -5, -5, 0,-17,
86  /* S */ 0, -3, 0, -4, -3, -5, -4, -2, -6, -7, -8, -4, -5, -6, -2, 6, 0, -5, -7, -6, -4, -5, 0,-17,
87  /* T */ -1, -6, -2, -5, -8, -5, -6, -6, -7, -2, -5, -3, -4, -9, -4, 0, 7,-13, -6, -3, -5, -4, 0,-17,
88  /* W */ -13, -2, -8,-15,-15,-13,-17,-15, -7,-14,-10,-12,-13, -4,-14, -5,-13, 13, -5,-15, -7,-13, 0,-17,
89  /* Y */ -8,-10, -4,-11, -4,-12, -8,-14, -3, -6, -7, -9,-11, 2,-13, -7, -6, -5, 10, -7,-10,-11, 0,-17,
90  /* V */ -2, -8, -8, -8, -6, -7, -6, -5, -6, 2, 0, -9, -1, -8, -6, -6, -3,-15, -7, 7, -9, -8, 0,-17,
91  /* B */ -7, 5, -4, -7,-11, -3, -7, -8, -4, -6, -7, 5, -3,-12, -5, -4, -5, -7,-10, -9, 5, 1, 0,-17,
92  /* Z */ -6, -1, -2, -3,-14, 4, -2, -7, -3, -7, -7, 4, -3,-14, -5, -5, -4,-13,-11, -8, 1, 4, 0,-17,
93  /* X */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-17,
94  /* * */ -17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17, 1
95  };
96 
97  return _data;
98  }
99  };
100 
101  template <>
102  struct ScoringMatrixData_<int, AminoAcid, AdaptedIdentity>
103  {
104  enum
105  {
106  VALUE_SIZE = ValueSize<AminoAcid>::VALUE,
107  TAB_SIZE = VALUE_SIZE * VALUE_SIZE
108  };
109  static inline const int* getData()
110  {
111  static const int _data[TAB_SIZE] =
112  {
113  // A R N D C Q E G H I L K M F P S T W Y V B Z X *
114  /* A */ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -17,
115  /* R */ 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -17,
116  /* N */ 0, 0, 1, 0, 0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S */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -17,
130  /* T */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, -17,
131  /* W */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, -17,
132  /* Y */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, -17,
133  /* V */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -17,
134  /* B */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -17,
135  /* Z */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -17,
136  /* X */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -17,
137  /* * */ -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, 1
138  };
139 
140  return _data;
141  }
142  };
143 
144 } // namespace seqan
145 
146 
147 namespace OpenMS
148 {
158  class OPENMS_DLLAPI ConsensusIDAlgorithmPEPMatrix :
160  {
161  public:
164 
165  private:
167  typedef ::seqan::Score<int, ::seqan::ScoreMatrix< ::seqan::AminoAcid, ::seqan::Default> > SeqAnScore;
168 
170  typedef ::seqan::String< ::seqan::AminoAcid> SeqAnSequence;
171 
173  SeqAnScore scoring_method_;
174 
176  ::seqan::Align<SeqAnSequence, ::seqan::ArrayGaps> alignment_;
177 
180 
183 
185  virtual void updateMembers_();
186 
188  virtual double getSimilarity_(AASequence seq1, AASequence seq2);
189 
190  };
191 
192 } // namespace OpenMS
193 
194 #endif // OPENMS_ANALYSIS_ID_CONSENSUSIDALGORITHMPEPMATRIX_H
static const int * getData()
Definition: ConsensusIDAlgorithmPEPMatrix.h:109
Definition: ConsensusIDAlgorithmPEPMatrix.h:42
static const int * getData()
Definition: ConsensusIDAlgorithmPEPMatrix.h:59
::seqan::String< ::seqan::AminoAcid > SeqAnSequence
SeqAn amino acid sequence.
Definition: ConsensusIDAlgorithmPEPMatrix.h:170
Definition: ConsensusIDAlgorithmPEPMatrix.h:47
Representation of a peptide/protein sequence.
Definition: AASequence.h:108
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
::seqan::Align< SeqAnSequence, ::seqan::ArrayGaps > alignment_
Alignment data structure.
Definition: ConsensusIDAlgorithmPEPMatrix.h:176
Definition: ConsensusIDAlgorithmPEPMatrix.h:48
::seqan::Score< int, ::seqan::ScoreMatrix< ::seqan::AminoAcid, ::seqan::Default > > SeqAnScore
SeqAn similarity scoring.
Definition: ConsensusIDAlgorithmPEPMatrix.h:167
Calculates a consensus from multiple ID runs based on PEPs and sequence similarities.
Definition: ConsensusIDAlgorithmPEPMatrix.h:158
Abstract base class for ConsensusID algorithms that take peptide similarity into account.
Definition: ConsensusIDAlgorithmSimilarity.h:55
SeqAnScore scoring_method_
Similarity scoring method.
Definition: ConsensusIDAlgorithmPEPMatrix.h:173

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:21:59 using doxygen 1.8.13