BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
structureMapper.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 
5 #ifndef BALL_STRUCTURE_STRUCTUREMAPPER_H
6 #define BALL_STRUCTURE_STRUCTUREMAPPER_H
7 
8 #ifndef BALL_COMMON_H
9 # include <BALL/common.h>
10 #endif
11 
12 #ifndef BALL_CONCEPT_PROCESSOR_H
13 # include <BALL/CONCEPT/processor.h>
14 #endif
15 
16 #ifndef BALL_STRUCTURE_GEOMETRICTRANSFORMATIONS_H
18 #endif
19 
20 #ifndef BALL_DATATYPE_STRING_H
21 # include <BALL/DATATYPE/string.h>
22 #endif
23 
24 #ifndef BALL_KERNEL_PROTEIN_H
25 # include <BALL/KERNEL/protein.h>
26 #endif
27 
28 #ifndef BALL_KERNEL_ATOM_H
29 # include <BALL/KERNEL/atom.h>
30 #endif
31 
32 #ifndef BALL_MATHS_MATRIX44_H
33 # include <BALL/MATHS/matrix44.h>
34 #endif
35 
36 #ifndef BALL_STRUCTURE_ATOMBIJECTION_H
38 #endif
39 
40 #include <vector>
41 #include <map>
42 
43 namespace BALL
44 {
45 
51  {
52  public:
53 
57 
61 
65 
68  virtual ~StructureMapper();
69 
71 
74  void set(AtomContainer& A, AtomContainer& B);
75 
78  double calculateRMSD();
79 
83  bool calculateTransformation();
84 
87  void calculateDefaultBijection();
88 
91  const AtomBijection& getBijection() const { return bijection_; }
92 
95  AtomBijection calculateFragmentBijection
96  (const vector<Fragment*>& A, const vector<Fragment*>& B);
97 
100  bool mapFragments
101  (const vector<Fragment*>& A, const vector<Fragment*>& B,
102  Matrix4x4* transformation, double upper_bound = 8.0, double lower_bound = 2.5);
103 
112  static Matrix4x4 matchPoints
113  (const Vector3& w1, const Vector3& w2, const Vector3& w3,
114  const Vector3& v1, const Vector3& v2, const Vector3& v3);
115 
118  static Matrix4x4 matchBackboneAtoms(const Residue& r1, const Residue& r2);
119 
122  Size mapResiduesByBackbone(const list<Residue*>& l1, const list<Residue*>& l2);
123 
126  vector<vector<Fragment*> >& searchPattern
127  (vector<Fragment*>& pattern, AtomContainer& composite,
128  double max_rmsd = 4.0, double max_center_tolerance = 2.0,
129  double upper_bound = 8.0, double lower_bound = 4.0);
130 
133  Matrix4x4 mapProteins
134  (Protein& P1, Protein& P2,
135  std::map<String, Size>& type_map,
136  Size& no_matched_ca,
137  double& rmsd,
138  double upper_bound = 8.0,
139  double lower_bound = 4.0,
140  double tolerance = 0.6);
141 
142  protected:
143  // Count the fragments in an AtomContainer -- this is not implemented
144  // in AtomContainer!
145  Size countFragments_(const AtomContainer& ac) const;
146 
147  /*_ The first of two composites - the "original"
148  */
150 
151  /*_ The second composites - the "copy" to be mapped
152  */
154 
155  /*_ The current atom bijection.
156  Required for the caclulation of the RMSD.
157  */
159 
160  /*_ The rmsd of the last mapping executed
161  */
162  double rmsd_;
163  };
164 
165 } // namespace BALL
166 
167 #endif // BALL_STRUCTURE_STRUCTUREMAPPER_H
168