00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef OST_QA_SOLIS_TORSION_STATISTICS_HH
00020 #define OST_QA_SOLIS_TORSION_STATISTICS_HH
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #include <ost/mol/entity_handle.hh>
00034 #include <ost/qa/module_config.hh>
00035 #include <ost/qa/histogram.hh>
00036 #include <ost/qa/amino_acids.hh>
00037 #include <boost/shared_ptr.hpp>
00038
00039 namespace ost { namespace qa {
00040
00041 class TorsionStatisticsSolis;
00042 typedef boost::shared_ptr<TorsionStatisticsSolis> TorsionStatisticsSolisPtr;
00043
00045 class DLLEXPORT_OST_QA TorsionStatisticsSolis {
00046 public:
00053 TorsionStatisticsSolis(int torsion_bucket_size);
00054 TorsionStatisticsSolis();
00056 void Extract(mol::EntityHandle entity);
00057
00059 void Extract(mol::EntityView view);
00060
00062 static TorsionStatisticsSolisPtr LoadFromFile(const String& file_name);
00063
00064 void SaveToFile(const String& file_name) const;
00065
00069 uint32_t GetCount(const AminoAcidSet& prev_aa,
00070 const AminoAcidSet& central_aa,
00071 const AminoAcidSet& next_aa,
00072 Real phi_angle, Real psi_angle) const;
00073
00074 uint32_t GetCount(const AminoAcidSet& prev_aa,
00075 const AminoAcidSet& central_aa,
00076 const AminoAcidSet& next_aa) const;
00077
00079 uint32_t GetCount(Real phi_angle, Real psi_angle) const;
00080
00083 uint32_t GetCount(AminoAcid central_aa,
00084 Real phi_angle, Real psi_angle) const;
00085
00089 Real GetFrequency(AminoAcid aa, Real phi_angle, Real psi_angle) const;
00090
00094 Real GetFrequency(Real phi_angle, Real psi_angle) const;
00095
00098 uint32_t GetTorsionBucketCount() const;
00099 int GetTorsionBucketSize() const;
00100
00101 int GetCount() const;
00103 template <typename DS>
00104 void Serialize(DS& ds)
00105 {
00106 ds & torsion_bucket_size_;
00107 ds & histogram_;
00108 }
00109 public:
00110 typedef MultiClassifier<int, int, int, int, Real, Real> TorsionHistogram;
00111 typedef TorsionHistogram::IndexType IndexType;
00112 private:
00115 uint32_t Accumulate(const IndexType& start, const IndexType& end) const;
00116
00117 uint32_t IndexForAngle(Real angle) const;
00118
00119
00120 TorsionHistogram histogram_;
00121 int torsion_bucket_size_;
00122 };
00123 }}
00124
00125 #endif
00126
00127