OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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-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_MOL_ALG_LOCAL_DIST_TEST_HH
20 #define OST_MOL_ALG_LOCAL_DIST_TEST_HH
21 
22 #include <ost/mol/entity_view.hh>
25 
26 namespace ost { namespace mol { namespace alg {
27 
32 {
33 
34 public:
36  UniqueAtomIdentifier(const String& chain,const ResNum& residue,const String& residue_name, const String& atom): chain_(chain),residue_(residue),residue_name_(residue_name),atom_(atom) {}
37 
38  // to make the compiler happy (boost python map suite)
39  UniqueAtomIdentifier(): chain_(""),residue_(ResNum(1)),residue_name_(""),atom_("") {}
40 
42  String GetChainName() const { return chain_; }
43 
45  ResNum GetResNum() const { return residue_; }
46 
48  String GetResidueName() const { return residue_name_; }
49 
51  String GetAtomName() const { return atom_; }
52 
53  // required because UniqueAtomIdentifier is used as a key for a std::map
54  bool operator==(const UniqueAtomIdentifier& rhs) const {
55  return chain_==rhs.chain_ && residue_==rhs.residue_ && atom_==rhs.atom_;
56  }
57 
58  // required because UniqueAtomIdentifier is used as a key for a std::map
59  bool operator<(const UniqueAtomIdentifier& rhs) const {
60  int cc=chain_.compare(rhs.chain_);
61  if (cc) {
62  return cc<0;
63  }
64  if (residue_<rhs.residue_) {
65  return true;
66  } else if (residue_>rhs.residue_) {
67  return false;
68  }
69  return atom_.compare(rhs.atom_)<0;
70  }
71 private:
72 
73  String chain_;
74  ResNum residue_;
75  String residue_name_;
76  String atom_;
77 };
78 
79 // typedef used to make the code cleaner
80 typedef std::pair<UniqueAtomIdentifier,UniqueAtomIdentifier> UAtomIdentifiers;
81 
86 typedef std::map<std::pair<UniqueAtomIdentifier,UniqueAtomIdentifier>,std::pair<Real,Real> > ResidueRDMap;
87 
92 typedef std::map<ost::mol::ResNum,ResidueRDMap> GlobalRDMap;
93 
94 // used by the multi-reference distance-list generator function
95 typedef std::map<UniqueAtomIdentifier,int> ExistenceMap;
96 
118 std::pair<long int,long int> DLLEXPORT_OST_MOL_ALG LocalDistDiffTest(const EntityView& mdl,
119  const GlobalRDMap& dist_list,
120  std::vector<Real> cutoff_list,
121  int sequence_separation = 0,
122  const String& local_ldt_property_string="");
123 
142  const EntityView& target,
143  Real cutoff,
144  Real max_dist,
145  const String& local_ldt_property_string="");
157  Real cutoff, Real max_dist,
158  int ref_index=0, int mdl_index=1);
159 
167 Real DLLEXPORT_OST_MOL_ALG LDDTHA(EntityView& v, const GlobalRDMap& global_dist_list, int sequence_separation=0);
168 
172 GlobalRDMap CreateDistanceList(const EntityView& ref,Real max_dist);
173 
196 GlobalRDMap CreateDistanceListFromMultipleReferences(const std::vector<EntityView>& ref_list,std::vector<Real>& cutoff_list, int sequence_separation, Real max_dist);
197 
199 void PrintGlobalRDMap(const GlobalRDMap& glob_dist_list);
200 
202 void PrintResidueRDMap(const ResidueRDMap& res_dist_list);
203 
204 // required by some helper function. Cannot reuse similar functions in other modules without creating
205 // circular dependencies
206 bool IsStandardResidue(String rn);
207 
208 }}}
209 
210 #endif
211 
212