Rosetta 3.4
Public Types | Public Member Functions
core::kinematics::AtomTree Class Reference

The AtomTree class is a wrapper for a tree of kinematic Atoms. More...

#include <AtomTree.hh>

Inheritance diagram for core::kinematics::AtomTree:
Inheritance graph
[legend]
Collaboration diagram for core::kinematics::AtomTree:
Collaboration graph
[legend]

List of all members.

Public Types

typedef id::AtomID AtomID
typedef id::AtomID_Mask AtomID_Mask
typedef id::DOF_Type DOF_Type
typedef id::DOF_ID DOF_ID
typedef id::DOF_ID_Mask DOF_ID_Mask
typedef id::StubID StubID
typedef std::vector< AtomIDAtomIDs
typedef std::map< AtomID, VectorFragXYZ
typedef std::map< StubID, RTFragRT
typedef tree::Atom Atom

Public Member Functions

 AtomTree (AtomPointer2D const &new_atom_pointer, bool const from_xyz=true)
 construction: from a tree of atoms;
 AtomTree ()
 default constructor
virtual ~AtomTree ()
 Destructor.
 AtomTree (AtomTree const &src)
 copy ctor
AtomTreeoperator= (AtomTree const &src)
 Copy assignment, makes complete copy of another AtomTree.
Size size () const
 number of residues
bool has (AtomID const &id) const
 true only if AtomID is in the range of the map and its Atom pointer has value
void replace_residue_subtree (id::BondID const &incoming, utility::vector1< id::BondID > const &outgoing, AtomPointer1D const &new_atoms)
 add an atom id1 to the AtomTree whose parent is id2 void add_atom( AtomID const & id1, AtomID const & id2, bool const add_bonded_atom, bool const from_xyz );
void promote_sameresidue_nonjump_child (AtomID const &parent_atom_id)
 Useful for guaranteeing that a stub remains within a single residue.
void delete_seqpos (Size const seqpos)
 Deletes atoms for seqpos. Does not renumber other atoms -- need to call update_sequence_numbering for that designed for the simple case of 1 incoming connecting and 0 or 1 outgoing connection, where the desired behavior is to rewire the outgoing connection in place of seqpos' tree.
void update_sequence_numbering (Size const new_size, utility::vector1< int > const &old2new)
 updates the Atom's AtomID's and the atom_pointer array
void replace_tree (AtomPointer2D const &new_atom_pointer, bool const from_xyz=true)
 replaces the entire tree
void copy_coords (AtomTree const &src)
 copy the internal and xyz coords from src tree, which should have the same topology as me
void set_dof (DOF_ID const &id, Real const setting)
 setters
void set_xyz (AtomID const &id, PointPosition const &xyz)
 set a specific atom xyz position
void batch_set_xyz (utility::vector1< AtomID > const &id, utility::vector1< PointPosition > const &xyz)
 simultaniously set several atom xyz positions
void set_jump (AtomID const &id, Jump const &jump)
 set a specific jump transform
void set_jump_now (AtomID const &id, Jump const &jump)
 set a specific jump transform and immediately refold downstream atoms
AtomID set_stub_transform (StubID const &stub_id1, StubID const &stub_id2, RT const &target_rt)
 Set the transform between two stubs, returns the atomid of the jump atom which moved (for book-keeping)
RT get_stub_transform (StubID const &stub_id1, StubID const &stub_id2) const
 get the transform between two stubs
DOF_ID set_torsion_angle (AtomID const &atom1, AtomID const &atom2, AtomID const &atom3, AtomID const &atom4, Real const setting)
 set a torsion angle "setting" to a specifc DOF derived by the four atoms
DOF_ID set_bond_angle (AtomID const &atom1, AtomID const &atom2, AtomID const &atom3, Real const setting)
DOF_ID set_bond_length (AtomID const &atom1, AtomID const &atom2, Real const setting)
void update_domain_map (DomainMap &domain_map, AtomID_Mask const &dof_moved, AtomID_Mask const &xyz_moved) const
 generates a "domain_map" defining the rigid body regions whose internal coords have not changed, according to the informaiton in the two bool Mask's update domain map from dof_moved and xyz_moved
void clear ()
 clear the content of an AtomTree object, delete root atom and all pointers
void insert_fragment (StubID const &instub_id, FragRT const &outstub_transforms, FragXYZ const &frag_xyz, utility::vector1< AtomID > &moving_atoms)
ResidueListIterator residue_xyz_change_list_begin () const
 The AtomTree provides to the Conformation object a list of residues whose xyz coordinates have changed. When the Conformation has finished reading off residues that have changed from the AtomTree, and has copied the coordinates of those residues into its conformation::Residue objects, it informs the AtomTree to reset this list by a call to mark_changed_residues_registered.
ResidueListIterator residue_xyz_change_list_end () const
void note_coordinate_change_registered () const
 The AtomTree provides a list of residues who's xyz coordinates have changed to the Conformation object. When the Conformation has finished reading off residues that have changed from the AtomTree, and has copied the coordinates of those residues into its conformation::Residue objects, it informs the AtomTree to reset this list by a call to mark_changed_residues_registered.
bool empty () const
 is there any atom in the tree yet?
Atom const * root () const
 const-access to the root of the tree
Real dof (DOF_ID const &id) const
 get value of DOF( PHI, THETA, D, RB1, ....) given its DOF_ID
PointPosition const & xyz (AtomID const &id) const
 get xyz position of an atom given its AtomID
Atom const & atom (AtomID const &id) const
 retreive a kinematic Atom in the tree by its AtomID
Atom const & atom_dont_do_update (AtomID const &id) const
 retreive a kinematic Atom in the tree by its AtomID -- no update!
Jump const & jump (AtomID const &id) const
 retrieve a Jump in the tree by that JumpAtom's AtomID.
DOF_ID torsion_angle_dof_id (AtomID const &atom1, AtomID const &atom2, AtomID const &atom3, AtomID const &atom4) const
 a wrapper function to get the DOF_ID of a torsion angle given those four atoms which define this torsion
DOF_ID torsion_angle_dof_id (AtomID const &atom1_in_id, AtomID const &atom2_in_id, AtomID const &atom3_in_id, AtomID const &atom4_in_id, Real &offset) const
 get the DOF_ID of a torsion angle given those four atoms which define this torsion
DOF_ID bond_angle_dof_id (AtomID const &atom1_in_id, AtomID const &atom2_in_id, AtomID const &atom3_in_id, Real &offset) const
 get the DOF_ID of a bond angle given those 3 atoms which define this torsion
DOF_ID bond_length_dof_id (AtomID const &atom1_in_id, AtomID const &atom2_in_id) const
 get the DOF_ID of a bond length given those 2 atoms which define this torsion
Real torsion_angle (AtomID const &atom1, AtomID const &atom2, AtomID const &atom3, AtomID const &atom4) const
 calculate torsion angle defined by four atoms in the atom tree
Real bond_angle (AtomID const &atom1, AtomID const &atom2, AtomID const &atom3) const
Real bond_length (AtomID const &atom1, AtomID const &atom2) const
void set_jump_atom_stub_id (StubID const &id)
Stub stub_from_id (StubID const &id) const
AtomTree const * topological_match_to () const
 Functions only necessary for unit tests.
utility::vector1< AtomTree
const * > const & 
topological_observers () const
 For testing purposes only: report the list of observer AtomTrees that are topological copies of this tree. The fact that AtomTrees keep track of other atom trees is "private" in the sense that no other class needs to worry about it. However, to *test* that the topological match algorithm is working properly, this private data needs to be readable. Do not use this function outside of the unit tests.

Detailed Description

The AtomTree class is a wrapper for a tree of kinematic Atoms.

the responsibilities of the class are:

See AtomTree overview and concepts for details.


Member Typedef Documentation


Constructor & Destructor Documentation

core::kinematics::AtomTree::AtomTree ( AtomPointer2D const &  new_atom_pointer,
bool const  from_xyz = true 
)

construction: from a tree of atoms;

this will claim the tree as our own. new_root has information about its children, and they have information about their children. From those atom positions, internal coordinates can be updated and atom pointers will be added into the AtomTree map.

Note:
that we steal the atoms, ie it's incorporated into the AtomTree (by recording their pointers),not cloned

References replace_tree(), and core::id::AtomID_Map< T >::size().

core::kinematics::AtomTree::AtomTree ( )

default constructor

core::kinematics::AtomTree::~AtomTree ( ) [virtual]

Destructor.

References clear().

core::kinematics::AtomTree::AtomTree ( AtomTree const &  src)

copy ctor

copy ctor, uses operator= without this initialization, the destruction of this


Member Function Documentation

tree::Atom const & core::kinematics::AtomTree::atom ( AtomID const &  id) const
tree::Atom const & core::kinematics::AtomTree::atom_dont_do_update ( AtomID const &  id) const

retreive a kinematic Atom in the tree by its AtomID -- no update!

Referenced by core::pose::copy_dofs(), core::io::pdb::dump_connect_info(), and core::scoring::rna::fix_sugar_coords().

void core::kinematics::AtomTree::batch_set_xyz ( utility::vector1< AtomID > const &  id,
utility::vector1< PointPosition > const &  xyz 
)

simultaniously set several atom xyz positions

Real core::kinematics::AtomTree::bond_angle ( AtomID const &  atom1,
AtomID const &  atom2,
AtomID const &  atom3 
) const
id::DOF_ID core::kinematics::AtomTree::bond_angle_dof_id ( AtomID const &  atom1_in_id,
AtomID const &  atom2_in_id,
AtomID const &  atom3_in_id,
Real offset 
) const
Real core::kinematics::AtomTree::bond_length ( AtomID const &  atom1,
AtomID const &  atom2 
) const
id::DOF_ID core::kinematics::AtomTree::bond_length_dof_id ( AtomID const &  atom1_in_id,
AtomID const &  atom2_in_id 
) const

get the DOF_ID of a bond length given those 2 atoms which define this torsion

References core::id::BOGUS_DOF_ID, core::id::D, core::kinematics::tree::Atom::id(), core::kinematics::tree::Atom::input_stub_atom1(), and core::kinematics::tree::Atom::is_jump().

Referenced by bond_length(), and set_bond_length().

void core::kinematics::AtomTree::clear ( )

clear the content of an AtomTree object, delete root atom and all pointers

This is done by releasing memories of all atoms including the root atom , and clearing atom_pointer map

References core::id::AtomID_Map< T >::clear().

Referenced by operator=(), replace_tree(), and ~AtomTree().

void core::kinematics::AtomTree::copy_coords ( AtomTree const &  src)

copy the internal and xyz coords from src tree, which should have the same topology as me

Note:
this may trigger a coordinate update of src (access to root atom)

References core::kinematics::tree::Atom::copy_coords(), and root().

Referenced by operator=().

void core::kinematics::AtomTree::delete_seqpos ( Size const  seqpos)

Deletes atoms for seqpos. Does not renumber other atoms -- need to call update_sequence_numbering for that designed for the simple case of 1 incoming connecting and 0 or 1 outgoing connection, where the desired behavior is to rewire the outgoing connection in place of seqpos' tree.

assumes one incoming and at most one outgoing Need fancier fxn for general case

References atom(), core::kinematics::tree::Atom::atoms_begin(), core::kinematics::tree::Atom::atoms_end(), core::kinematics::tree::Atom::id(), core::kinematics::tree::Atom::parent(), core::id::AtomID_Map< T >::resize(), root(), core::id::AtomID::rsd(), size(), and update_sequence_numbering().

Real core::kinematics::AtomTree::dof ( DOF_ID const &  id) const
bool core::kinematics::AtomTree::empty ( ) const [inline]

is there any atom in the tree yet?

RT core::kinematics::AtomTree::get_stub_transform ( StubID const &  stub_id1,
StubID const &  stub_id2 
) const

get the transform between two stubs

References stub_from_id().

bool core::kinematics::AtomTree::has ( AtomID const &  id) const [inline]

true only if AtomID is in the range of the map and its Atom pointer has value

the atom with this AtomID in the current AtomID_Map?

References core::id::AtomID_Map< T >::has().

Referenced by protocols::topology_broker::fix_internal_coords_of_siblings().

void core::kinematics::AtomTree::insert_fragment ( StubID const &  instub_id,
FragRT const &  outstub_transforms,
FragXYZ const &  frag_xyz,
utility::vector1< AtomID > &  moving_atoms 
)
Jump const & core::kinematics::AtomTree::jump ( AtomID const &  id) const

retrieve a Jump in the tree by that JumpAtom's AtomID.

Note:
will abort if a BondedAtom's AtomID is passed in.
void core::kinematics::AtomTree::note_coordinate_change_registered ( ) const

The AtomTree provides a list of residues who's xyz coordinates have changed to the Conformation object. When the Conformation has finished reading off residues that have changed from the AtomTree, and has copied the coordinates of those residues into its conformation::Residue objects, it informs the AtomTree to reset this list by a call to mark_changed_residues_registered.

AtomTree & core::kinematics::AtomTree::operator= ( AtomTree const &  src)

Copy assignment, makes complete copy of another AtomTree.

makes a complete copy of another AtomTree src by cloning the root_atom and all its offspring atoms. Also update atom_pointer map.

Note:
clear the content of tree first to release memory before doing the assignment.

References clear(), core::kinematics::tree::Atom::clone(), and copy_coords().

void core::kinematics::AtomTree::promote_sameresidue_nonjump_child ( AtomID const &  parent_atom_id)
void core::kinematics::AtomTree::replace_residue_subtree ( id::BondID const &  incoming,
utility::vector1< id::BondID > const &  outgoing,
AtomPointer1D const &  new_atoms 
)

add an atom id1 to the AtomTree whose parent is id2 void add_atom( AtomID const & id1, AtomID const & id2, bool const add_bonded_atom, bool const from_xyz );

/ void setup_backrub_segment( utility::vector1< AtomID > const & mainchain, AtomID const & downstream_id, // mainchain child of last atom in mainchain vector utility::vector1< std::pair< Size, Size > > const & edges, Size const first_new_pseudo_residue ); ///////////////////////////////////////////////////////////////////////////////// /modification of topology: atoms are incorporated into tree, not cloned void insert_subtree( Atom * const subtree_root, AtomID const & anchor_id, bool const insert_at_front );

void insert_subtree_into_bond( Atom * const subtree_root, AtomID const & old_child_id, AtomID const & new_parent_id );replace any subtree of atoms in the atom tree by a new tree of atoms void replace_subtree( Atom * const subtree_root, AtomIDs const & old_atoms, id::AtomID_Map< AtomID > const & atom_map );

Note:
This can also handle the case of inserting a residue, proved that we've already renumbered atomtree leaving an empty slot at seqpos.
If the new residue contains the root of the tree, incoming.atom1 should be BOGUS_ATOM_ID
Note that for all BondID's atom1 should be the parent and atom2 should be the child Couple of special cases: -- appending a residue -- inserting a residue -- replacing the root residue -- inserting a new root residue

References core::id::BondID::atom1, core::id::BondID::atom2, core::id::AtomID::atomno(), core::kinematics::tree::Atom::child(), core::id::AtomID_Map< T >::clear(), core::kinematics::tree::Atom::delete_atom(), core::kinematics::tree::Atom::id(), core::kinematics::tree::Atom::insert_atom(), core::kinematics::tree::Atom::n_children(), core::kinematics::tree::Atom::parent(), core::kinematics::tree::Atom::replace_atom(), core::id::AtomID::rsd(), and core::id::AtomID::valid().

Referenced by core::conformation::replace_residue_in_atom_tree().

void core::kinematics::AtomTree::replace_tree ( AtomPointer2D const &  new_atom_pointer,
bool const  from_xyz = true 
)

replaces the entire tree

fill the AtomTree with a new tree of atoms by recording their pointers in the map. Sync internal and xyz coords.

References clear(), and core::id::AtomID_Map< T >::size().

Referenced by AtomTree().

ResidueListIterator core::kinematics::AtomTree::residue_xyz_change_list_begin ( ) const

The AtomTree provides to the Conformation object a list of residues whose xyz coordinates have changed. When the Conformation has finished reading off residues that have changed from the AtomTree, and has copied the coordinates of those residues into its conformation::Residue objects, it informs the AtomTree to reset this list by a call to mark_changed_residues_registered.

The list of which residues have had coordinate changes is unknown until the DFS has completed. The DFS must be triggered before iterators are given to the Conformation object.

ResidueListIterator core::kinematics::AtomTree::residue_xyz_change_list_end ( ) const

The list of which residues have had coordinate changes is unknown until the DFS has completed. The DFS must be triggered before iterators are given to the Conformation object.

Atom const* core::kinematics::AtomTree::root ( ) const [inline]
id::DOF_ID core::kinematics::AtomTree::set_bond_angle ( AtomID const &  atom1,
AtomID const &  atom2,
AtomID const &  atom3,
Real const  setting 
)
id::DOF_ID core::kinematics::AtomTree::set_bond_length ( AtomID const &  atom1,
AtomID const &  atom2,
Real const  setting 
)
void core::kinematics::AtomTree::set_dof ( DOF_ID const &  id,
Real const  setting 
)

setters

brief set a specific DOF in the tree

Referenced by set_bond_angle(), set_bond_length(), and set_torsion_angle().

void core::kinematics::AtomTree::set_jump ( AtomID const &  id,
Jump const &  jump 
)

set a specific jump transform

Note:
AtomID must point to a JumpAtom, otherwise it will die.

Referenced by set_jump_now().

void core::kinematics::AtomTree::set_jump_atom_stub_id ( StubID const &  id)
void core::kinematics::AtomTree::set_jump_now ( AtomID const &  id,
Jump const &  jump 
)

set a specific jump transform and immediately refold downstream atoms

Note:
DEPRICATED. AtomID must point to a JumpAtom, otherwise it will die. Hopefully, the new output-sentitive refold will make this method unneccessary

References set_jump().

id::AtomID core::kinematics::AtomTree::set_stub_transform ( StubID const &  stub_id1,
StubID const &  stub_id2,
RT const &  target_rt 
)

Set the transform between two stubs, returns the atomid of the jump atom which moved (for book-keeping)

Set the transform between two stubs Returns the atomid of the jump atom which moved.

Note:
Requires that there be a jump in the atomtree between a pair of atoms in the stubs

References protocols::comparative_modeling::features::A, core::id::StubID::atom(), protocols::match::upstream::b, core::kinematics::tree::distance_squared(), core::kinematics::find_stub_transform(), core::kinematics::tree::Atom::id(), core::kinematics::tree::Atom::is_jump(), core::kinematics::tree::Atom::parent(), core::kinematics::RT::reverse(), stub_from_id(), and core::kinematics::tree::Atom::transform_Ax_plus_b_recursive().

id::DOF_ID core::kinematics::AtomTree::set_torsion_angle ( AtomID const &  atom1,
AtomID const &  atom2,
AtomID const &  atom3,
AtomID const &  atom4,
Real const  setting 
)

set a torsion angle "setting" to a specifc DOF derived by the four atoms

@ details it is possible that no DOF can be obtained given these four atoms or the torsion does not match exactly the DOF(PHI) angle. In the former case, a BOGUS_DOF_ID is returned as indicator and in the latter case, an offset value is deducted from input setting to set the real DOF value properly.

References set_dof(), and torsion_angle_dof_id().

void core::kinematics::AtomTree::set_xyz ( AtomID const &  id,
PointPosition const &  xyz 
)

set a specific atom xyz position

Referenced by core::pack::scmin::ResidueAtomTreeCollection::update_atom_tree().

Size core::kinematics::AtomTree::size ( ) const [inline]
Stub core::kinematics::AtomTree::stub_from_id ( StubID const &  id) const [inline]

References xyz().

Referenced by get_stub_transform(), and set_stub_transform().

AtomTree const* core::kinematics::AtomTree::topological_match_to ( ) const [inline]

Functions only necessary for unit tests.

For testing purposes only: report the address of the AtomTree this tree is a topological copy of. The fact that AtomTrees keep track of other atom trees is "private" in the sense that no other class needs to worry about it. However, to *test* that the topological match algorithm is working properly, this private data needs to be readable. Do not use this function outside of the unit tests.

utility::vector1< AtomTree const * > const& core::kinematics::AtomTree::topological_observers ( ) const [inline]

For testing purposes only: report the list of observer AtomTrees that are topological copies of this tree. The fact that AtomTrees keep track of other atom trees is "private" in the sense that no other class needs to worry about it. However, to *test* that the topological match algorithm is working properly, this private data needs to be readable. Do not use this function outside of the unit tests.

Real core::kinematics::AtomTree::torsion_angle ( AtomID const &  atom1,
AtomID const &  atom2,
AtomID const &  atom3,
AtomID const &  atom4 
) const

calculate torsion angle defined by four atoms in the atom tree

Note:
this is NOT calculated straight from atom positions.Instead, it is calculated from interal DOFs. If no DOF can be found from these four atoms, 0.0 will be returned and a warning message is printed.

References torsion_angle_dof_id(), and core::kinematics::TR().

id::DOF_ID core::kinematics::AtomTree::torsion_angle_dof_id ( AtomID const &  atom1_in_id,
AtomID const &  atom2_in_id,
AtomID const &  atom3_in_id,
AtomID const &  atom4_in_id,
Real offset 
) const

get the DOF_ID of a torsion angle given those four atoms which define this torsion

an "offset" value is also calculated that torsion(id1,id2,id3,id4) = dof( dof_id ) + offset. A BOGUS_DOF_ID will be returned if no proper DOF can be found for these four atoms. offset is mainly for an atom with a previous sibling as the torsion(PHI) attached to it is calculated as improper angle with respect to its sibling.

References core::id::BOGUS_DOF_ID, core::pack::interaction_graph::debug, core::kinematics::tree::Atom::dihedral_between_bonded_children(), dof(), core::kinematics::tree::Atom::dof(), core::kinematics::tree::Atom::get_nonjump_atom(), core::kinematics::tree::Atom::id(), core::kinematics::tree::Atom::input_stub_atom0(), core::kinematics::tree::Atom::input_stub_atom1(), core::kinematics::tree::Atom::input_stub_atom2(), core::kinematics::tree::Atom::input_stub_atom3(), core::kinematics::tree::Atom::is_jump(), core::kinematics::tree::Atom::keep_dof_fixed(), core::kinematics::tree::Atom::parent(), core::id::PHI, core::id::THETA, core::kinematics::TR(), and core::kinematics::tree::Atom::xyz().

DOF_ID core::kinematics::AtomTree::torsion_angle_dof_id ( AtomID const &  atom1,
AtomID const &  atom2,
AtomID const &  atom3,
AtomID const &  atom4 
) const [inline]

a wrapper function to get the DOF_ID of a torsion angle given those four atoms which define this torsion

another version of this functino also calculates an offset value, which is not needed here

Referenced by core::scoring::methods::TorsionDatabase::lookup(), set_torsion_angle(), and torsion_angle().

void core::kinematics::AtomTree::update_domain_map ( DomainMap domain_map,
AtomID_Mask const &  dof_moved,
AtomID_Mask const &  xyz_moved 
) const

generates a "domain_map" defining the rigid body regions whose internal coords have not changed, according to the informaiton in the two bool Mask's update domain map from dof_moved and xyz_moved

domain map is residue-based and indicate which residues stay relatively rigid to each other in one domain since last move and therefore their interaction energy does not have to be recalculated. This function calls atom->update_domain_map from the root atom of the tree.

References core::kinematics::tree::Atom::update_domain_map().

void core::kinematics::AtomTree::update_sequence_numbering ( Size const  new_size,
utility::vector1< int > const &  old2new 
)

updates the Atom's AtomID's and the atom_pointer array

References core::id::AtomID_Map< T >::update_sequence_numbering().

Referenced by delete_seqpos(), and core::conformation::insert_residue_into_atom_tree().

PointPosition const & core::kinematics::AtomTree::xyz ( AtomID const &  id) const

get xyz position of an atom given its AtomID

retrieve the xyz position of an atom in the tree by its AtomID

Referenced by stub_from_id().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines