Rosetta 3.4
Public Member Functions
core::chemical::AutomorphismIterator Class Reference

Enumerates the automorphisms of a residue, which are basically chemical symmetries that affect RMSD calculations. More...

#include <automorphism.hh>

Inheritance diagram for core::chemical::AutomorphismIterator:
Inheritance graph
[legend]
Collaboration diagram for core::chemical::AutomorphismIterator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 AutomorphismIterator (ResidueTypeCOP restype, bool includeH=false)
 Including H will lead to many, many more automorphisms!
virtual ~AutomorphismIterator ()
utility::vector1< Sizenext ()
 Returns the next automorphism for this residue type as a vector that maps "old" atom indices to "new" atom indices. Returns an empty vector when no more automorphisms remain.

Detailed Description

Enumerates the automorphisms of a residue, which are basically chemical symmetries that affect RMSD calculations.

Common automorphisms include flipping a phenyl ring (think Phe chi2) or rotating a methyl group (or CF3, if you don't care about H). However, they can be much more complicated than that, and some cannot be imitated by rotation about a bond. Examples include labeling a -CF3 clockwise vs. counterclockwise, or swapping the -CF3 branches of -C(CF3)2R. See the ligand of PDB 1PQC for a reasonably complex example.

Formally, a graph automorphism is an isomorphism of that graph with itself: given a graph G(V,E) and a mapping M that relabels the vertices according to M(v) -> v', then M is an automorphism iff (M(u),M(v)) is an edge if and only if (u,v) is an edge. If the vertices are "colored" (in our case, have atom types), it must also be true that M(v) and v have the same color, for all v in V.

Thus you can re-label a phenyl ring

2 3 6 5 6 3 1 4 or 1 4 but not 1 4 6 5 2 3 2 5

because in the last case, there are new bonds 6-3 and 2-5, and missing bonds 6-5 and 2-3.

See also: OpenEye's OEChem library and its OERMSD() function.


Constructor & Destructor Documentation

core::chemical::AutomorphismIterator::AutomorphismIterator ( ResidueTypeCOP  restype,
bool  includeH = false 
) [inline]

Including H will lead to many, many more automorphisms!

virtual core::chemical::AutomorphismIterator::~AutomorphismIterator ( ) [inline, virtual]

Member Function Documentation

utility::vector1< Size > core::chemical::AutomorphismIterator::next ( )

Returns the next automorphism for this residue type as a vector that maps "old" atom indices to "new" atom indices. Returns an empty vector when no more automorphisms remain.

First automorphism is the identity, [1 2 3 4 ... N] The algorithm works its way through the list of atoms one at a time, for each one trying to pair it with every other possible atom (including itself) that isn't already paired with some earlier atom. To be paired, the atoms need only be of the same chemical type; for efficiency though, we also check that they have the same number of neighbors. We also check that all the edges between the current atom and previously paired atoms also exist between their paired counterparts (a condition for true automorphisms). If we get to a point where we can't find a partner for some atom, we know some earlier pairing is wrong, so we backtrack and try something else. This algorithm would be more natural to represent recursively, keeping state on the stack, but by "flattening" it like this we can use the backtracking machinery to "resume" our search on the next call to next(), thereby iterating over all the possible automorphisms. The vector curr_[] thus takes the place of the stack, and used[] serves to prevent two different atoms from being paired with the same partner simultaneously.

Referenced by core::scoring::automorphic_rmsd(), and protocols::ligand_docking::frac_atoms_within().


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