10 #ifndef IMPKINEMATICS_PROTEINKINEMATICS_H
11 #define IMPKINEMATICS_PROTEINKINEMATICS_H
13 #include <IMP/kinematics/kinematics_config.h>
21 #include <boost/unordered_map.hpp>
26 #include <boost/graph/adjacency_list.hpp>
28 IMPKINEMATICS_BEGIN_NAMESPACE
31 enum ProteinAngleType {
69 bool flexible_side_chains =
false);
86 bool flexible_backbone =
true,
87 bool flexible_side_chains =
false);
104 const std::vector<atom::Atoms>& custom_dihedral_atoms,
106 bool flexible_backbone =
true,
107 bool flexible_side_chains =
false);
126 const std::vector<ProteinAngleType>& custom_dihedral_angle_types,
128 bool flexible_backbone =
true,
129 bool flexible_side_chains =
false);
148 const std::vector<atom::Atoms>& custom_dihedral_atoms,
149 const std::vector<ProteinAngleType>& custom_dihedral_angle_types,
151 bool flexible_backbone,
152 bool flexible_side_chains);
154 void add_edges_to_rb_graph(
const std::vector<atom::Atoms>& dihedral_angles);
164 return get_phi_joint(r)->get_angle();
170 return get_psi_joint(r)->get_angle();
185 ret.push_back(dynamic_cast<DihedralAngleRevoluteJoint*>(j));
203 get_phi_joint(r)->set_angle(angle);
204 kf_->update_all_external_coordinates();
208 get_psi_joint(r)->set_angle(angle);
209 kf_->update_all_external_coordinates();
216 void build_topology_graph();
218 void order_rigid_bodies(
const std::vector<atom::Atoms>& dihedral_angles,
219 const std::vector<atom::Atoms>& phi_angles,
220 const std::vector<atom::Atoms>& psi_angles,
221 const std::vector<atom::Atoms>& chi1_angles,
222 const std::vector<atom::Atoms>& chi2_angles,
223 const std::vector<atom::Atoms>& chi3_angles,
224 const std::vector<atom::Atoms>& chi4_angles,
225 const std::vector<atom::Atoms>& chi5_angles,
230 void mark_rotatable_angles(
const std::vector<atom::Atoms>& dihedral_angles);
234 void mark_rotatable_angle(
const std::vector<atom::Atom>& dihedral_angle);
237 void build_rigid_bodies();
242 void add_dihedral_joints(
const std::vector<atom::Residue>& residues,
243 ProteinAngleType angle_type,
244 const std::vector<atom::Atoms>& dihedral_angles);
247 ProteinAngleType angle_type,
262 DihedralAngleRevoluteJoint* get_other_joint(
const atom::Residue r)
const {
263 return (DihedralAngleRevoluteJoint*)joint_map_.get_joint(r, OTHER);
266 DihedralAngleRevoluteJoint* get_chi1_joint(
const atom::Residue r)
const {
267 return (DihedralAngleRevoluteJoint*)joint_map_.get_joint(r, CHI1);
269 DihedralAngleRevoluteJoint* get_chi2_joint(
const atom::Residue r)
const {
270 return (DihedralAngleRevoluteJoint*)joint_map_.get_joint(r, CHI2);
272 DihedralAngleRevoluteJoint* get_chi3_joint(
const atom::Residue r)
const {
273 return (DihedralAngleRevoluteJoint*)joint_map_.get_joint(r, CHI3);
275 DihedralAngleRevoluteJoint* get_chi4_joint(
const atom::Residue r)
const {
276 return (DihedralAngleRevoluteJoint*)joint_map_.get_joint(r, CHI4);
278 DihedralAngleRevoluteJoint* get_chi5_joint(
const atom::Residue r)
const {
279 return (DihedralAngleRevoluteJoint*)joint_map_.get_joint(r, CHI5);
282 DihedralAngleRevoluteJoint* get_joint(
const atom::Residue r, ProteinAngleType angle)
const {
283 return (DihedralAngleRevoluteJoint*)joint_map_.get_joint(r, angle);
291 class AngleToJointMap {
294 Joint* get_joint(
const atom::Residue r,
295 ProteinAngleType angle_type)
const;
298 void add_joint(
const atom::Residue r, ProteinAngleType angle_type,
304 typedef std::vector<Joint*> ResidueJoints;
306 boost::unordered_map<ParticleIndex, ResidueJoints>
309 #endif // IMP_DOXYGEN
314 typedef boost::adjacency_list<
315 boost::vecS, boost::vecS, boost::undirectedS > Graph;
318 atom::Hierarchy mhd_;
322 ParticlesTemp atom_particles_;
331 std::vector<int> rb_order_, parents_;
336 boost::unordered_map<ParticleIndex, int> particle_index_to_node_map_, rb_particle_index_to_node_map_;
338 Vector<ParticleIndex> node_to_particle_index_map_;
341 core::RigidBodies rbs_;
346 PointerMember<kinematics::KinematicForest> kf_;
349 AngleToJointMap joint_map_;
351 boost::unordered_map<int, boost::unordered_map<int, Pointer<DihedralAngleRevoluteJoint> > > rigid_bodies_2_joint_map_;
358 IMPKINEMATICS_END_NAMESPACE
DihedralAngleRevoluteJoints get_ordered_joints()
double get_phi(const atom::Residue r) const
get phi angle associated with residue r
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
A more IMP-like version of the std::vector.
Class for storing model, its restraints, constraints, and particles.
#define IMP_FOREACH(v, r)
The standard decorator for manipulating molecular structures.
Common base class for heavy weight IMP objects.
double get_psi(const atom::Residue r) const
get psi angle associated with residue r
functionality for defining rigid bodies
IMP::Vector< IMP::Pointer< DihedralAngleRevoluteJoint > > DihedralAngleRevoluteJoints
DihedralAngleRevoluteJoints get_joints()
returns a list of all joints associated with the ProteinKinematics structure
A class for storing lists of IMP items.
core::RigidBodies get_rigid_bodies()
Joint that is parameterized as a dihedral angle between two planes.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
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.
KinematicForest * get_kinematic_forest()
Define and manipulate a kinematic structure over a model.
functionality for defining various revolute kinematic joints between rigid bodies as part of a kinema...