OpenStructure
solis_torsion_statistics.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2011 by the OpenStructure authors
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 3.0 of the License, or (at your option)
9 // any later version.
10 // This library is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //------------------------------------------------------------------------------
19 #ifndef OST_QA_SOLIS_TORSION_STATISTICS_HH
20 #define OST_QA_SOLIS_TORSION_STATISTICS_HH
21 /*
22  This implementation of the torsion angle potential combines 1
23  torsion angle pair with up to 3 residues in analogy to the
24  potential described by:
25  Armando D. Solis, S. Rackovsky
26  Optimally informative backbone structural propensities in proteins
27  Protei
28  The ordinary trosion angle potential (1 angle-pair, 1 residue) is covered
29  as well.
30 
31  Author: Marco Biasini, Pascal Benkert
32  */
33 #include <ost/mol/entity_handle.hh>
34 #include <ost/qa/module_config.hh>
35 #include <ost/qa/histogram.hh>
36 #include <ost/qa/amino_acids.hh>
37 #include <boost/shared_ptr.hpp>
38 
39 namespace ost { namespace qa {
40 
42 typedef boost::shared_ptr<TorsionStatisticsSolis> TorsionStatisticsSolisPtr;
43 
46 public:
53  TorsionStatisticsSolis(int torsion_bucket_size);
56  void Extract(mol::EntityHandle entity);
57 
59  void Extract(mol::EntityView view);
60 
62  static TorsionStatisticsSolisPtr LoadFromFile(const String& file_name);
63 
64  void SaveToFile(const String& file_name) const;
65 
69  uint32_t GetCount(const AminoAcidSet& prev_aa,
70  const AminoAcidSet& central_aa,
71  const AminoAcidSet& next_aa,
72  Real phi_angle, Real psi_angle) const;
73 
74  uint32_t GetCount(const AminoAcidSet& prev_aa,
75  const AminoAcidSet& central_aa,
76  const AminoAcidSet& next_aa) const;
77 
79  uint32_t GetCount(Real phi_angle, Real psi_angle) const;
80 
83  uint32_t GetCount(AminoAcid central_aa,
84  Real phi_angle, Real psi_angle) const;
85 
89  Real GetFrequency(AminoAcid aa, Real phi_angle, Real psi_angle) const;
90 
94  Real GetFrequency(Real phi_angle, Real psi_angle) const;
95 
98  uint32_t GetTorsionBucketCount() const;
99  int GetTorsionBucketSize() const;
100 
101  int GetCount() const;
103  template <typename DS>
104  void Serialize(DS& ds)
105  {
106  ds & torsion_bucket_size_;
107  ds & histogram_;
108  }
109 public:
112 private:
115  uint32_t Accumulate(const IndexType& start, const IndexType& end) const;
116 
117  uint32_t IndexForAngle(Real angle) const;
118 
119 
120  TorsionHistogram histogram_;
121  int torsion_bucket_size_;
122 };
123 }}
124 
125 #endif
126 
127