OpenStructure
local_dist_diff_test.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-2020 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_MOL_ALG_LOCAL_DIST_TEST_HH
20 #define OST_MOL_ALG_LOCAL_DIST_TEST_HH
21 
23 #include <ost/mol/entity_handle.hh>
27 
28 namespace ost { namespace mol { namespace alg {
29 
31 {
32  bool is_valid;
36 
39  ost::mol::alg::StereoChemicalParams& init_angle_table,
40  ost::mol::alg::ClashingDistances& init_nonbonded_table);
41 };
42 
43 struct lDDTSettings {
46  std::vector<Real> cutoffs;
48 
50  lDDTSettings(Real init_radius,
51  int init_sequence_separation,
52  std::vector<Real>& init_cutoffs,
53  String init_label);
55  std::string ToString();
56 };
57 
61  int rnum;
67 
69 
70  lDDTLocalScore(String init_cname,
71  String init_rname,
72  int init_rnum,
73  String init_is_assessed,
74  String init_quality_problems,
75  Real init_local_lddt,
76  int init_conserved_dist,
77  int init_total_dist);
78 
79  String ToString(bool structural_checks) const;
80  String Repr() const;
81 
82  static String GetHeader(bool structural_checks, int cutoffs_length);
83 };
84 
86 {
87  public:
90  std::vector<EntityView> references_view;
92 
93  lDDTScorer(std::vector<EntityView>& init_references,
94  ost::mol::EntityView& init_model,
95  lDDTSettings& init_settings);
97  std::vector<lDDTLocalScore> GetLocalScores();
98  int GetNumConservedContacts(); // number of conserved distances in the model
99  int GetNumTotalContacts(); // the number of total distances in the reference structure
100  std::vector<EntityView> GetReferences();
102  bool IsValid();
103 
104  private:
105  bool _score_calculated;
106  bool _score_valid;
107  bool _has_local_scores;
108  // number of conserved distances in the model and
109  // the number of total distances in the reference structure
110  int _num_cons_con;
111  int _num_tot_con;
112  Real _global_score;
113  std::vector<lDDTLocalScore> _local_scores;
114  void _ComputelDDT();
115  void _GetLocallDDT();
116  void _PrepareGlobalRDMap();
117 };
118 
119 std::pair<int,int> DLLEXPORT_OST_MOL_ALG ComputeCoverage(const EntityView& v,const GlobalRDMap& glob_dist_list);
120 
121 bool DLLEXPORT_OST_MOL_ALG IsResnumInGlobalRDMap(const ResNum& resnum, const GlobalRDMap& glob_dist_list);
122 
144 std::pair<long int,long int> DLLEXPORT_OST_MOL_ALG
145 LocalDistDiffTest(const EntityView& mdl, const GlobalRDMap& dist_list,
146  std::vector<Real> cutoff_list, int sequence_separation = 0,
147  const String& local_ldt_property_string="");
148 
167  const EntityView& target,
168  Real cutoff,
169  Real max_dist,
170  const String& local_ldt_property_string="");
173  std::vector<EntityView>& ref_list,
174  const GlobalRDMap& glob_dist_list,
175  lDDTSettings& settings);
176 
188  Real cutoff, Real max_dist,
189  int ref_index=0, int mdl_index=1);
190 
198 Real DLLEXPORT_OST_MOL_ALG LDDTHA(EntityView& v, const GlobalRDMap& global_dist_list, int sequence_separation=0);
199 
204 
227 GlobalRDMap DLLEXPORT_OST_MOL_ALG CreateDistanceListFromMultipleReferences(const std::vector<EntityView>& ref_list,std::vector<Real>& cutoff_list, int sequence_separation, Real max_dist);
228 
231 
234 
235 // required by some helper function. Cannot reuse similar functions in other modules without creating
236 // circular dependencies
238 
239 void DLLEXPORT_OST_MOL_ALG CleanlDDTReferences(std::vector<EntityView>& ref_list);
240 
241 // Prepare GlobalRDMap from reference list
243  const std::vector<EntityView>& ref_list,
244  std::vector<Real>& cutoff_list,
245  int sequence_separation,
246  Real max_dist);
247 
249  StereoChemicalParams& bond_table,
250  StereoChemicalParams& angle_table,
251  ClashingDistances& nonbonded_table,
252  Real bond_tolerance,
253  Real angle_tolerance);
254 
255 std::vector<lDDTLocalScore> DLLEXPORT_OST_MOL_ALG GetlDDTPerResidueStats(EntityView& model,
256  GlobalRDMap& glob_dist_list,
257  bool structural_checks,
258  String label);
259 
260 void DLLEXPORT_OST_MOL_ALG PrintlDDTPerResidueStats(std::vector<lDDTLocalScore>& scores,
261  bool structural_checks,
262  int cutoffs_length);
263 
264 }}}
265 
266 #endif
definition of EntityView
Definition: entity_view.hh:86
List of reference atom-atom distances to detect clashes between non-bonded atoms.
List of stereo chemical parameters (Bonds and angles)
std::vector< lDDTLocalScore > GetLocalScores()
std::vector< EntityView > references_view
lDDTScorer(std::vector< EntityView > &init_references, ost::mol::EntityView &init_model, lDDTSettings &init_settings)
std::vector< EntityView > GetReferences()
representation of a multiple sequence alignemnt consisting of two or more sequences
float Real
Definition: base.hh:44
std::string String
Definition: base.hh:54
#define DLLEXPORT_OST_MOL_ALG
void DLLEXPORT_OST_MOL_ALG PrintResidueRDMap(const ResidueRDMap &res_dist_list)
Prints all distances in a residue distance list to standard output.
GlobalRDMap DLLEXPORT_OST_MOL_ALG CreateDistanceList(const EntityView &ref, Real max_dist)
Creates a list of distances to check during a Local Difference Distance Test.
void DLLEXPORT_OST_MOL_ALG CleanlDDTReferences(std::vector< EntityView > &ref_list)
std::map< ost::mol::ResNum, ResidueRDMap > GlobalRDMap
Global distance list.
void DLLEXPORT_OST_MOL_ALG CheckStructure(EntityView &ent, StereoChemicalParams &bond_table, StereoChemicalParams &angle_table, ClashingDistances &nonbonded_table, Real bond_tolerance, Real angle_tolerance)
GlobalRDMap DLLEXPORT_OST_MOL_ALG PreparelDDTGlobalRDMap(const std::vector< EntityView > &ref_list, std::vector< Real > &cutoff_list, int sequence_separation, Real max_dist)
bool DLLEXPORT_OST_MOL_ALG IsStandardResidue(String rn)
std::pair< long int, long int > DLLEXPORT_OST_MOL_ALG LocalDistDiffTest(const EntityView &mdl, const GlobalRDMap &dist_list, std::vector< Real > cutoff_list, int sequence_separation=0, const String &local_ldt_property_string="")
Calculates number of distances conserved in a model, given a list of distances to check and a model.
void DLLEXPORT_OST_MOL_ALG PrintGlobalRDMap(const GlobalRDMap &glob_dist_list)
Prints all distances in a global distance list to standard output.
void DLLEXPORT_OST_MOL_ALG PrintlDDTPerResidueStats(std::vector< lDDTLocalScore > &scores, bool structural_checks, int cutoffs_length)
bool DLLEXPORT_OST_MOL_ALG IsResnumInGlobalRDMap(const ResNum &resnum, const GlobalRDMap &glob_dist_list)
Real DLLEXPORT_OST_MOL_ALG LDDTHA(EntityView &v, const GlobalRDMap &global_dist_list, int sequence_separation=0)
Computes the Local Distance Difference High-Accuracy Test given a list of distances to check.
std::pair< int, int > DLLEXPORT_OST_MOL_ALG ComputeCoverage(const EntityView &v, const GlobalRDMap &glob_dist_list)
std::vector< lDDTLocalScore > DLLEXPORT_OST_MOL_ALG GetlDDTPerResidueStats(EntityView &model, GlobalRDMap &glob_dist_list, bool structural_checks, String label)
GlobalRDMap DLLEXPORT_OST_MOL_ALG CreateDistanceListFromMultipleReferences(const std::vector< EntityView > &ref_list, std::vector< Real > &cutoff_list, int sequence_separation, Real max_dist)
Creates a list of distances to check during a Local Difference Distance Test starting from multiple r...
std::map< std::pair< UniqueAtomIdentifier, UniqueAtomIdentifier >, std::pair< Real, Real > > ResidueRDMap
Residue distance list.
Definition: base.dox:1
ost::mol::alg::ClashingDistances nonbonded_table
StereoChemicalProps(ost::mol::alg::StereoChemicalParams &init_bond_table, ost::mol::alg::StereoChemicalParams &init_angle_table, ost::mol::alg::ClashingDistances &init_nonbonded_table)
ost::mol::alg::StereoChemicalParams bond_table
ost::mol::alg::StereoChemicalParams angle_table
lDDTLocalScore(String init_cname, String init_rname, int init_rnum, String init_is_assessed, String init_quality_problems, Real init_local_lddt, int init_conserved_dist, int init_total_dist)
String ToString(bool structural_checks) const
static String GetHeader(bool structural_checks, int cutoffs_length)
lDDTSettings(Real init_radius, int init_sequence_separation, std::vector< Real > &init_cutoffs, String init_label)