10 #ifndef IMPKINEMATICS_PROTEIN_KINEMATICS_H
11 #define IMPKINEMATICS_PROTEIN_KINEMATICS_H
13 #include "kinematics_config.h"
21 #include <boost/unordered_map.hpp>
26 #include <boost/graph/adjacency_list.hpp>
27 #include <boost/graph/undirected_dfs.hpp>
29 IMPKINEMATICS_BEGIN_NAMESPACE
31 typedef boost::adjacency_list<
32 boost::vecS, boost::vecS, boost::undirectedS > Graph;
34 class MyDFSVisitor :
public boost::default_dfs_visitor {
36 MyDFSVisitor(std::vector<int>& dfs_order, std::vector<int>& parents) :
37 dfs_order_(dfs_order), parents_(parents), counter_(0) {}
39 template <
typename Vertex,
typename Graph >
40 void discover_vertex(Vertex v,
const Graph& ) {
41 dfs_order_[v] = counter_;
45 template <
typename Edge,
typename Graph >
46 void tree_edge(Edge e,
const Graph& g) {
47 std::cerr <<
"tree_edge " << source(e, g) <<
" -- " << target(e, g)
48 <<
" dfs_order " << dfs_order_[source(e, g)] <<
" -- " << dfs_order_[target(e, g)] << std::endl;
49 parents_[target(e,g)] = source(e, g);
52 std::vector<int>& dfs_order_;
53 std::vector<int>& parents_;
67 bool flexible_side_chains =
false);
72 const std::vector<atom::Atoms>& dihedral_angles,
74 bool flexible_backbone =
true,
75 bool flexible_side_chains =
false);
81 const std::vector<atom::Atoms>& dihedral_angles,
83 bool flexible_backbone,
84 bool flexible_side_chains);
86 void add_edges_to_rb_graph(
const std::vector<atom::Atoms>& dihedral_angles);
92 return get_phi_joint(r)->get_angle();
96 return get_psi_joint(r)->get_angle();
105 IMP_FOREACH(
Joint *j, kf_->get_ordered_joints() ){
106 ret.push_back(dynamic_cast<DihedralAngleRevoluteJoint*>(j));
121 get_phi_joint(r)->set_angle(angle);
122 kf_->update_all_external_coordinates();
126 get_psi_joint(r)->set_angle(angle);
127 kf_->update_all_external_coordinates();
133 enum ProteinAngleType {
144 void build_topology_graph();
146 void order_rigid_bodies(
const std::vector<atom::Atoms>& dihedral_angles,
147 const std::vector<atom::Atoms>& phi_angles,
148 const std::vector<atom::Atoms>& psi_angles,
151 void mark_rotatable_angles(
const std::vector<atom::Atoms>& dihedral_angles);
153 void build_rigid_bodies();
155 void add_dihedral_joints(
const std::vector<atom::Atoms>& dihedral_angles);
157 void add_dihedral_joints(
const std::vector<atom::Residue>& residues,
158 ProteinAngleType angle_type,
159 const std::vector<atom::Atoms>& dihedral_angles);
162 ProteinAngleType angle_type,
184 class AngleToJointMap {
188 ProteinAngleType angle_type)
const;
191 void add_joint(
const atom::Residue r, ProteinAngleType angle_type,
197 typedef std::vector<Joint*> ResidueJoints;
199 boost::unordered_map<ParticleIndex, ResidueJoints>
202 #endif // IMP_DOXYGEN
218 std::vector<int> rb_order_, parents_;
223 boost::unordered_map<ParticleIndex, int> particle_index_to_node_map_, rb_particle_index_to_node_map_;
236 AngleToJointMap joint_map_;
238 boost::unordered_map<int, boost::unordered_map<int, Pointer<DihedralAngleRevoluteJoint> > > rigid_bodies_2_joint_map_;
243 IMPKINEMATICS_END_NAMESPACE
A smart pointer to a reference counted object.
The standard decorator for manipulating molecular structures.
functionality for defining rigid bodies
A class for storing lists of IMP items.
A decorator for a residue.
Wrapper class for a kinematic forest (collection of trees) made of KinematicNode objects, interconnected by joints. This data structure allows for kinematic control of the tree and interconversion between internal and external coordinates.
functionality for defining various revolute kinematic joints between rigid bodies as part of a kinema...