00001
00002
00003
00004
00005 #ifndef BALL_STRUCTURE_STRUCTUREMAPPER_H
00006 #define BALL_STRUCTURE_STRUCTUREMAPPER_H
00007
00008 #ifndef BALL_COMMON_H
00009 # include <BALL/common.h>
00010 #endif
00011
00012 #ifndef BALL_CONCEPT_PROCESSOR_H
00013 # include <BALL/CONCEPT/processor.h>
00014 #endif
00015
00016 #ifndef BALL_STRUCTURE_GEOMETRICTRANSFORMATIONS_H
00017 # include <BALL/STRUCTURE/geometricTransformations.h>
00018 #endif
00019
00020 #ifndef BALL_DATATYPE_STRING_H
00021 # include <BALL/DATATYPE/string.h>
00022 #endif
00023
00024 #ifndef BALL_KERNEL_PROTEIN_H
00025 # include <BALL/KERNEL/protein.h>
00026 #endif
00027
00028 #ifndef BALL_KERNEL_ATOM_H
00029 # include <BALL/KERNEL/atom.h>
00030 #endif
00031
00032 #ifndef BALL_MATHS_MATRIX44_H
00033 # include <BALL/MATHS/matrix44.h>
00034 #endif
00035
00036 #ifndef BALL_STRUCTURE_ATOMBIJECTION_H
00037 # include <BALL/STRUCTURE/atomBijection.h>
00038 #endif
00039
00040 #include <vector>
00041 #include <map>
00042
00043 namespace BALL
00044 {
00045
00049 class BALL_EXPORT StructureMapper
00050 : public TransformationProcessor
00051 {
00052 public:
00053
00057
00060 StructureMapper();
00061
00064 StructureMapper(AtomContainer& A, AtomContainer& B);
00065
00068 virtual ~StructureMapper();
00069
00071
00074 void set(AtomContainer& A, AtomContainer& B);
00075
00078 double calculateRMSD();
00079
00083 bool calculateTransformation();
00084
00087 void calculateDefaultBijection();
00088
00091 const AtomBijection& getBijection() const { return bijection_; }
00092
00095 AtomBijection calculateFragmentBijection
00096 (const vector<Fragment*>& A, const vector<Fragment*>& B);
00097
00100 bool mapFragments
00101 (const vector<Fragment*>& A, const vector<Fragment*>& B,
00102 Matrix4x4* transformation, double upper_bound = 8.0, double lower_bound = 2.5);
00103
00112 static Matrix4x4 matchPoints
00113 (const Vector3& w1, const Vector3& w2, const Vector3& w3,
00114 const Vector3& v1, const Vector3& v2, const Vector3& v3);
00115
00118 static Matrix4x4 matchBackboneAtoms(const Residue& r1, const Residue& r2);
00119
00122 Size mapResiduesByBackbone(const list<Residue*>& l1, const list<Residue*>& l2);
00123
00126 vector<vector<Fragment*> >& searchPattern
00127 (vector<Fragment*>& pattern, AtomContainer& composite,
00128 double max_rmsd = 4.0, double max_center_tolerance = 2.0,
00129 double upper_bound = 8.0, double lower_bound = 4.0);
00130
00133 Matrix4x4 mapProteins
00134 (Protein& P1, Protein& P2,
00135 std::map<String, Size>& type_map,
00136 Size& no_matched_ca,
00137 double& rmsd,
00138 double upper_bound = 8.0,
00139 double lower_bound = 4.0,
00140 double tolerance = 0.6);
00141
00142 protected:
00143
00144
00145 Size countFragments_(const AtomContainer& ac) const;
00146
00147
00148
00149 AtomContainer* A_;
00150
00151
00152
00153 AtomContainer* B_;
00154
00155
00156
00157
00158 AtomBijection bijection_;
00159
00160
00161
00162 double rmsd_;
00163 };
00164
00165 }
00166
00167 #endif // BALL_STRUCTURE_STRUCTUREMAPPER_H
00168