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_;
63 bool flexible_side_chains =
false);
68 const std::vector<atom::Atoms>& dihedral_angles,
70 bool flexible_backbone =
true,
71 bool flexible_side_chains =
false);
77 const std::vector<atom::Atoms>& dihedral_angles,
79 bool flexible_backbone,
80 bool flexible_side_chains);
82 void add_edges_to_rb_graph(
const std::vector<atom::Atoms>& dihedral_angles);
88 return get_phi_joint(r)->get_angle();
92 return get_psi_joint(r)->get_angle();
101 IMP_FOREACH(
Joint *j, kf_->get_ordered_joints() ){
102 ret.push_back(dynamic_cast<DihedralAngleRevoluteJoint*>(j));
116 get_phi_joint(r)->set_angle(angle);
117 kf_->update_all_external_coordinates();
121 get_psi_joint(r)->set_angle(angle);
122 kf_->update_all_external_coordinates();
128 enum ProteinAngleType {
139 void build_topology_graph();
141 void order_rigid_bodies(
const std::vector<atom::Atoms>& dihedral_angles,
142 const std::vector<atom::Atoms>& phi_angles,
143 const std::vector<atom::Atoms>& psi_angles,
146 void mark_rotatable_angles(
const std::vector<atom::Atoms>& dihedral_angles);
148 void build_rigid_bodies();
150 void add_dihedral_joints(
const std::vector<atom::Atoms>& dihedral_angles);
152 void add_dihedral_joints(
const std::vector<atom::Residue>& residues,
153 ProteinAngleType angle_type,
154 const std::vector<atom::Atoms>& dihedral_angles);
157 ProteinAngleType angle_type,
179 class AngleToJointMap {
183 ProteinAngleType angle_type)
const;
186 void add_joint(
const atom::Residue r, ProteinAngleType angle_type,
192 typedef std::vector<Joint*> ResidueJoints;
194 boost::unordered_map<ParticleIndex, ResidueJoints>
197 #endif // IMP_DOXYGEN
213 std::vector<int> rb_order_, parents_;
218 boost::unordered_map<ParticleIndex, int> particle_index_to_node_map_, rb_particle_index_to_node_map_;
231 AngleToJointMap joint_map_;
233 boost::unordered_map<int, boost::unordered_map<int, Pointer<DihedralAngleRevoluteJoint> > > rigid_bodies_2_joint_map_;
238 IMPKINEMATICS_END_NAMESPACE
Kinematic structure over a protein, with backbone and side chain dihedrals.
A more IMP-like version of the std::vector.
The standard decorator for manipulating molecular structures.
functionality for defining rigid bodies
A smart pointer to a ref-counted Object that is a class member.
A class for storing lists of IMP items.
Joint that is parameterized as a dihedral angle between two planes.
A decorator for a residue.
Base class for joints between rigid bodies in a kinematic tree.
Define and manipulate a kinematic structure over a model.
Define and manipulate a kinematic structure over a model.
functionality for defining various revolute kinematic joints between rigid bodies as part of a kinema...