LOOS  v2.3.2
loos::AtomicGroup Class Reference

Class for handling groups of Atoms (pAtoms, actually) More...

#include <AtomicGroup.hpp>

Inheritance diagram for loos::AtomicGroup:
Collaboration diagram for loos::AtomicGroup:

Classes

class  Iterator
 Our own simple iterator for stepping over all managed atoms. More...
 

Public Types

typedef std::vector< pAtom >::iterator iterator
 
typedef std::vector< pAtom >::const_iterator const_iterator
 
typedef pAtom value_type
 

Public Member Functions

 AtomicGroup (const int n)
 Creates a new AtomicGroup with n un-initialized atoms. More...
 
 AtomicGroup (const AtomicGroup &g)
 Copy constructor (atoms and box shared)
 
AtomicGroup copy (void) const
 Creates a deep copy of this group. More...
 
virtual AtomicGroupclone (void) const
 Creates a lightweight clone of this group (for polymorphism) More...
 
uint length (void) const
 
uint size (void) const
 
bool empty (void) const
 
pAtom getAtom (const int i) const
 Get the ith atom from this group.
 
pAtom & operator[] (const int i)
 Same as getAtom(i)
 
const pAtom & operator[] (const int i) const
 
AtomicGroupappend (pAtom pa)
 Append the atom onto the group.
 
AtomicGroupappend (std::vector< pAtom > pas)
 Append a vector of atoms.
 
AtomicGroupappend (const AtomicGroup &grp)
 Append an entire AtomicGroup onto this one (concatenation)
 
AtomicGroupremove (pAtom pa)
 Delete a single atom.
 
AtomicGroupremove (std::vector< pAtom > pas)
 Deletes a set of atoms.
 
AtomicGroupremove (const AtomicGroup &grp)
 Deletes all atoms in the passed grp that are also in the current group.
 
AtomicGroupoperator+= (const AtomicGroup &rhs)
 
AtomicGroupoperator+= (const pAtom &rhs)
 
AtomicGroup operator+ (const AtomicGroup &rhs)
 
AtomicGroup operator+ (const pAtom &rhs)
 
bool operator== (AtomicGroup &rhs)
 Equality test for two groups. More...
 
bool operator!= (AtomicGroup &rhs)
 Inequality test for two groups.
 
bool operator== (const AtomicGroup &rhs) const
 Equality test for const groups. More...
 
bool operator!= (const AtomicGroup &rhs) const
 Inequality test for two groups.
 
AtomicGroup subset (const int offset, const int len=0)
 subset() and excise() args are patterned after perl's substr... More...
 
AtomicGroup excise (const int offset, const int len=0)
 excise returns the excised atoms as a group...
 
template<class EqualsOp >
bool contains (const pAtom &p, const EqualsOp &op)
 Determines if a pAtom is contained in this group using the EqualsOp atom-equality policy. More...
 
bool contains (const pAtom &p)
 Determines if a pAtom is contained in this group using the AtomEquals policy (ie the default comparison policy)
 
template<class EqualsOp >
bool contains (const AtomicGroup &g, const EqualsOp &op)
 Determines if the passed group is a subset of the current group using the EqualsOp atom-equality policy.
 
bool contains (const AtomicGroup &g)
 Determines if a group is a subset of the current group using the default AtomEquals policy.
 
template<class EqualsOp >
bool containsAny (const AtomicGroup &g, const EqualsOp &op)
 Determines if a group contains any atom.
 
bool containsAny (const AtomicGroup &g)
 Determines if a group contains any atom using the default AtomEquals policy.
 
template<class EqualsOp >
AtomicGroup intersect (const AtomicGroup &g, const EqualsOp &op)
 Computes the intersection of two groups using the EqualsOp atom-equality policy. More...
 
AtomicGroup intersect (const AtomicGroup &g)
 Intersection of two groups.
 
template<class EqualsOp >
AtomicGroup merge (const AtomicGroup &g, const EqualsOp &op)
 Union of two groups using the specified atom-equality policy. More...
 
AtomicGroup merge (const AtomicGroup &g)
 Union of two groups using the default AtomEquals atom-equality policy.
 
AtomicGroup select (const AtomSelector &sel) const
 Return a group consisting of atoms for which sel predicate returns true...
 
std::vector< AtomicGroupsplitByUniqueSegid (void) const
 Returns a vector of AtomicGroups split from the current group based on segid. More...
 
std::vector< AtomicGroupsplitByMolecule (void) const
 Returns a vector of AtomicGroups split based on bond connectivity.
 
std::vector< AtomicGroupsplitByResidue (void) const
 Returns a vector of AtomicGroups, each comprising a single residue. More...
 
std::map< std::string, AtomicGroupsplitByName (void) const
 Returns a vector of AtomicGroups, each containing atoms with the same name.
 
AtomicGroup centrifyByMolecule () const
 Replace a group with the center of masses of contained molecules. More...
 
AtomicGroup centrifyByResidue () const
 Replace a group with the cente of masses of contained residues (see centrifyByMolecule())
 
pAtom findById (const int id) const
 Find a contained atom by its atomid. More...
 
AtomicGroup groupFromID (const std::vector< int > &id_list) const
 Create a new group from a vector of atomids. More...
 
AtomicGroup getResidue (pAtom res)
 
void renumber (const int start=1, const int stride=1)
 Renumber the atomid's of the contained atoms...
 
int minId (void) const
 
int maxId (void) const
 
int minResid (void) const
 
int maxResid (void) const
 
int numberOfResidues (void) const
 
int numberOfSegids (void) const
 
bool allHaveProperty (const Atom::bits &property) const
 True if all atoms in the group have the passed property(ies)
 
bool anyHaveProperty (const Atom::bits &property) const
 True if any atom in the group have the passed property(ies)
 
bool hasBonds (void) const
 Does any atom in the group have bond information???
 
bool hasCoords (void) const
 Do all the atoms in the group have coordinates?
 
void clearBonds (void)
 Remove any bonding information present in contained atoms.
 
void pruneBonds ()
 Attempt to prune connectivity (only retain bonds to atoms within this AtomicGroup) More...
 
void resetAtomIndices ()
 Reset the atom indices (used for interfacing with trajectories) More...
 
uint deduceAtomicNumberFromMass (const double tol=0.1)
 Deduce atomic number from mass (if present), returning number of atoms assigned. More...
 
bool sorted (void) const
 Is the array of atoms already sorted??? More...
 
void sort (void)
 Sort based on atomid.
 
bool isPeriodic (void) const
 Test whether or not periodic boundary conditions are set.
 
GCoord periodicBox (void) const
 Fetch the periodic boundary conditions.
 
void periodicBox (const GCoord &c)
 Set the periodic boundary conditions.
 
void periodicBox (const greal x, const greal y, const greal z)
 Set the periodic boundary conditions.
 
loos::SharedPeriodicBox sharedPeriodicBox () const
 Provide access to the underlying shared periodic box...
 
void removePeriodicBox ()
 Remove periodicity.
 
void reimage ()
 
void reimageByAtom ()
 Reimage atoms individually into the primary cell.
 
void mergeImage (pAtom &p)
 Takes a group that's split across a periodic boundary and reimages it so it's all together. More...
 
void mergeImage ()
 Takes a group that's split across a periodic boundary and reimages it so it's all together, using the first atom in the AtomicGroup as the reference. More...
 
AtomicGroup within (const double dist, AtomicGroup &grp) const
 Find atoms in the current group that are within dist angstroms of any atom in grp.
 
AtomicGroup within (const double dist, AtomicGroup &grp, const GCoord &box) const
 Find atoms in grp that are within dist angstroms of atoms in the current group, considering periodicity.
 
bool contactWith (const double dist, const AtomicGroup &grp, const uint min=1) const
 Returns true if any atom of current group is within dist angstroms of grp. More...
 
bool contactWith (const double dist, const AtomicGroup &grp, const GCoord &box, const uint min=1) const
 Returns true if any atom of current group is within dist angstroms of grp. More...
 
void findBonds (const double dist=1.65)
 Distance-based search for bonds. More...
 
template<class T >
apply (T func)
 Apply a functor or a function to each atom in the group. More...
 
iterator begin (void)
 
iterator end (void)
 
const_iterator begin (void) const
 
const_iterator end (void) const
 
std::vector< GCoordboundingBox (void) const
 Bounding box for the group... More...
 
GCoord centerAtOrigin (void)
 Translates the group so that the centroid is at the origin. More...
 
GCoord centroid (void) const
 Centroid of atoms (ignores mass, operates in group coordinates)
 
greal radius (const bool use_atom_as_reference=false) const
 Maximum radius from centroid of all atoms (not gyration) More...
 
GCoord centerOfMass (void) const
 Center of mass of the group (in group coordinates)
 
GCoord centerOfElectrons (void) const
 Analogous to center of mass.
 
GCoord dipoleMoment (void) const
 Dipole moment, relative to group's centroid.
 
greal totalCharge (void) const
 
greal totalMass (void) const
 
greal radiusOfGyration (void) const
 
greal sphericalVariance (const pAtom) const
 Spherical variance of group with respect to target atom. More...
 
greal sphericalVariance (const GCoord) const
 
greal rmsd (const AtomicGroup &)
 Compute the RMSD between two groups. More...
 
std::vector< GCoordgetTransformedCoords (const XForm &) const
 Returns a vector of coordinates transformed by the passed XForm. More...
 
void translate (const GCoord &v)
 Translate an atomic group by vector v.
 
void rotate (const GCoord &axis, const greal angle_in_degrees)
 Rotate group's coordinates (right-handed, about centroid)
 
void applyTransform (const XForm &)
 Apply the given transform to the group's coordinates...
 
void copyCoordinatesFrom (const AtomicGroup &g, const uint offset=0, const uint length=0)
 Copy coordinates from g into current group. More...
 
std::vector< uint > atomOrderMapFrom (const AtomicGroup &g)
 Map the order of atoms in AtomicGroup g into the current group. More...
 
void copyMappedCoordinatesFrom (const AtomicGroup &g, const std::vector< uint > &order)
 Given a mapping of atom order, copy the coordinates into the current group. More...
 
void copyMappedCoordinatesFrom (const AtomicGroup &g)
 Copy the coordinates from the group mapping the atom order. More...
 
void perturbCoords (const greal)
 Each atom is moved in a random direction by a vector of the passed size.
 
std::vector< GCoordprincipalAxes (void) const
 Compute the principal axes of a group. More...
 
std::vector< GCoordmomentsOfInertia (void) const
 Computes the moments of inertia for a group. More...
 
GMatrix superposition (const AtomicGroup &)
 Calculates the transformation matrix for superposition of groups. More...
 
GMatrix alignOnto (const AtomicGroup &)
 Superimposes the current group onto the passed group. More...
 
void setCoords (double *seq, int m, int n)
 
void getCoords (double **outseq, int *m, int *n)
 
std::vector< double > coordsAsVector () const
 

Static Public Attributes

static const double superposition_zero_singular_value = 1e-10
 

Protected Member Functions

void setGroupConnectivity ()
 

Protected Attributes

std::vector< pAtom > atoms
 
loos::SharedPeriodicBox box
 

Friends

std::ostream & operator<< (std::ostream &os, const AtomicGroup &grp)
 Output the group in pseudo-XML format...
 

Detailed Description

Class for handling groups of Atoms (pAtoms, actually)

This class contains a collection of shared pointers to Atoms (i.e. pAtoms). Copying an AtomicGroup is a light-copy. You can, however, perform a deep copy by using the AtomicGroup::copy() method. Note that atomid's are assumed to be unique for any given AtomicGroup.

Valid operators are '+' and '+=' and can combine either AtomicGroup objects or pAtom objects.

AtomicGroups also support periodic boundary conditions via the periodicBox() method. If a box has been set, then isPeriodic() will return true. The periodic box is shared between the parent group and all derived groups. AtomicGroup copies have non-shared periodic boxes...

Definition at line 87 of file AtomicGroup.hpp.

Constructor & Destructor Documentation

loos::AtomicGroup::AtomicGroup ( const int  n)
inline

Creates a new AtomicGroup with n un-initialized atoms.

The atoms will all have ascending atomid's beginning with 1, but otherwise no other properties will be set.

Definition at line 104 of file AtomicGroup.hpp.

Member Function Documentation

GMatrix loos::AtomicGroup::alignOnto ( const AtomicGroup grp)

Superimposes the current group onto the passed group.

Calls superposition to calculate the transformation matrix to superimpose the current group onto the passed one, then applies the transformation to the current group's coordinates.

Definition at line 196 of file AG_linalg.cpp.

template<class T >
T loos::AtomicGroup::apply ( func)
inline

Apply a functor or a function to each atom in the group.

apply() let's you apply a functor or a function pointer to each atom in the group. The functor is passed a pAtom. The functor object is also returned (in case it retained state). For example, the following code snippet shows how to calculate the centroid of a group using apply and a functor...

struct Functor {
Functor() : C(GCoord(0,0,0)), n(0) { }
void operator()(pAtom& p) { C += p->coords(); ++n; }
GCoord center(void) const { return(C/n); }
GCoord C;
int n;
};
Functor f = group.apply(Functor());
GCoord centroid = f.center();

Definition at line 512 of file AtomicGroup.hpp.

std::vector< uint > loos::AtomicGroup::atomOrderMapFrom ( const AtomicGroup g)

Map the order of atoms in AtomicGroup g into the current group.

Note that the order is only checked within a residue. The residues must appear in the same order between the two groups. This addresses edge issues such as when psfgen reorders the atoms within a residue. The map is an index into the AtomicGroup g that puts g into the same order as the current group.

Definition at line 948 of file AtomicGroup.cpp.

std::vector< GCoord > loos::AtomicGroup::boundingBox ( void  ) const

Bounding box for the group...

Returns a vector containing 2 GCoords, one containing (minx, miny, minz) and the other (maxx, maxy, maxz)

Definition at line 50 of file AG_numerical.cpp.

GCoord loos::AtomicGroup::centerAtOrigin ( void  )

Translates the group so that the centroid is at the origin.

Returns the old centroid of the group

Definition at line 340 of file AG_numerical.cpp.

AtomicGroup loos::AtomicGroup::centrifyByMolecule ( ) const

Replace a group with the center of masses of contained molecules.

The AtomicGroup is split into molecules. A new group is constructed where each atom is the center of mass of one molecule. The atom metadata is taken from the first atom of the associated molecule, but with the atom name "CEN".

Definition at line 1036 of file AtomicGroup.cpp.

AtomicGroup * loos::AtomicGroup::clone ( void  ) const
virtual

Creates a lightweight clone of this group (for polymorphism)

Despite the name, this is meant for polymorphic use. It is not a deep copy. If you don't understand what any of this means, then you almost certainly want to be using the copy() method instead.

Reimplemented in loos::Amber, loos::PDB, loos::PSF, loos::CHARMM, and loos::TinkerXYZ.

Definition at line 51 of file AtomicGroup.cpp.

bool loos::AtomicGroup::contactWith ( const double  dist,
const AtomicGroup grp,
const uint  min = 1 
) const
inline

Returns true if any atom of current group is within dist angstroms of grp.

min is the minimum number of pair-wise contacts required to be considered in contact

Definition at line 466 of file AtomicGroup.hpp.

bool loos::AtomicGroup::contactWith ( const double  dist,
const AtomicGroup grp,
const GCoord box,
const uint  min = 1 
) const
inline

Returns true if any atom of current group is within dist angstroms of grp.

min is the minimum number of pair-wise contacts required to be considered in contact

Definition at line 476 of file AtomicGroup.hpp.

template<class EqualsOp >
bool loos::AtomicGroup::contains ( const pAtom &  p,
const EqualsOp &  op 
)
inline

Determines if a pAtom is contained in this group using the EqualsOp atom-equality policy.

The problem with determining containment/intersection/etc is how to define when two atoms are equal... This is done by specifying a comparison functor (the EqualsOp) as a policy. There are two comparison policies currently in LOOS: AtomEquals and AtomCoordsEquals. The default behavior is to use AtomEquals which only compares a subset of the available Atom metadata. You can specify the more restrictive policy (or an user-defined policy) like:

bool b = group.contains(an_atom, loos::AtomCoordsEquals());

Or as another example, comparing only residue numbers...

struct ResidEquals : public std::binary_function<pAtom, pAtom, bool> {
bool operator()(const pAtom& a, const pAtom& b) { return(a.resid() == b.resid()); }
};
bool b = group.contains(an_atom, ResidEquals());

Definition at line 239 of file AtomicGroup.hpp.

AtomicGroup loos::AtomicGroup::copy ( void  ) const

Creates a deep copy of this group.

This creates a non-polymorphic deep copy of an AtomicGroup. The additional catch is that it may end up involving extra data-movement as the copy is constructed and then copied back out to wherever you're putting it.

Definition at line 56 of file AtomicGroup.cpp.

void loos::AtomicGroup::copyCoordinatesFrom ( const AtomicGroup g,
const uint  offset = 0,
const uint  length = 0 
)

Copy coordinates from g into current group.

The offset is relative to the start of the current group and length is the number of coordinates to copy. If length + offset is greater than the number of atoms in the current group, then the excess coordinates will not be copied.

If length is 0, then all coordinates in g will be copied.

It is assumed that the atoms in g are in the appropriate order relative to the current group for the copy to make sense.

Definition at line 939 of file AtomicGroup.cpp.

void loos::AtomicGroup::copyMappedCoordinatesFrom ( const AtomicGroup g,
const std::vector< uint > &  order 
)

Given a mapping of atom order, copy the coordinates into the current group.

See AtomicGroup::atomOrderMapFrom(const AtomicGroup& g) for more information

If you know that the atoms are in the same order in both groups, then AtomicGroup::copyCoordinatesFrom() will be faster...

Definition at line 976 of file AtomicGroup.cpp.

void loos::AtomicGroup::copyMappedCoordinatesFrom ( const AtomicGroup g)

Copy the coordinates from the group mapping the atom order.

See AtomicGroup::atomOrderFrom(const AtomicGroup& g) for more information

If you know that the atoms are in the same order in both groups, then AtomicGroup::copyCoordinatesFrom() will be faster...

Definition at line 986 of file AtomicGroup.cpp.

uint loos::AtomicGroup::deduceAtomicNumberFromMass ( const double  tol = 0.1)

Deduce atomic number from mass (if present), returning number of atoms assigned.

If an atom has a mass, then this is used to look up it's atomic number. Note that LOOS only has the first 96 elements in its tables. If a mass is not found in the LOOS table, then the atomic number is not modified (or set), otherwise any existing atomic number is overwritten.

Definition at line 923 of file AtomicGroup.cpp.

void loos::AtomicGroup::findBonds ( const double  dist = 1.65)

Distance-based search for bonds.

Searches for bonds within an AtomicGroup based on distance. does NOT clear the existing bond list prior to building new bonds. The default distance cutoff is 1.25

Definition at line 854 of file AtomicGroup.cpp.

pAtom loos::AtomicGroup::findById ( const int  id) const

Find a contained atom by its atomid.

The default behavior is to assume that the atoms in the AtomicGroup are not in order of increasing atomid and to therefore use a linear search. If the atoms are sorted (AtomicGroup::sort()), then the more efficient binary search will be used.

Definition at line 520 of file AtomicGroup.cpp.

void loos::AtomicGroup::getCoords ( double **  outseq,
int *  m,
int *  n 
)

This function is meant for Numpy/swig use. It will store the current model's coordinates into a newly allocated array (using malloc). The caller is expected to manage the memory.

Definition at line 1024 of file AtomicGroup.cpp.

AtomicGroup loos::AtomicGroup::getResidue ( pAtom  res)

Given an Atom, return a group of all the atoms contained by its containing residue

Definition at line 555 of file AtomicGroup.cpp.

std::vector< GCoord > loos::AtomicGroup::getTransformedCoords ( const XForm M) const

Returns a vector of coordinates transformed by the passed XForm.

Does not alter the group's coordinates...

Definition at line 243 of file AG_numerical.cpp.

AtomicGroup loos::AtomicGroup::groupFromID ( const std::vector< int > &  id_list) const

Create a new group from a vector of atomids.

Note: when calling this, you'll want to make sure you use the outermost group (eg the psf or pdb you used to create things, rather than using a subselection, unless you're sure the subsection contains these atoms as well. The main use of this routine is to create a group of atoms bound to another atom.

Any missing atoms are ignored... This is in contrast with the previous behavior where missing atoms would throw an exception

Definition at line 539 of file AtomicGroup.cpp.

template<class EqualsOp >
AtomicGroup loos::AtomicGroup::intersect ( const AtomicGroup g,
const EqualsOp &  op 
)
inline

Computes the intersection of two groups using the EqualsOp atom-equality policy.

See AtomicGroup::contains(const pAtom&, const EqualsOp&) for more details

Definition at line 277 of file AtomicGroup.hpp.

template<class EqualsOp >
AtomicGroup loos::AtomicGroup::merge ( const AtomicGroup g,
const EqualsOp &  op 
)
inline

Union of two groups using the specified atom-equality policy.

Note that the periodic box of the current group is unchanged by this operation

Definition at line 295 of file AtomicGroup.hpp.

void loos::AtomicGroup::mergeImage ( pAtom &  p)

Takes a group that's split across a periodic boundary and reimages it so it's all together.

Works by translating the system so one atom is in the center of the box, reimaging by atom (so now the group is all in the middle of the box), and then translating back.

If you don't want to give it a reference atom, call the version that takes no argument; it uses the first atom in the AtomicGroup.

Definition at line 835 of file AtomicGroup.cpp.

void loos::AtomicGroup::mergeImage ( )

Takes a group that's split across a periodic boundary and reimages it so it's all together, using the first atom in the AtomicGroup as the reference.

Does the same as the other mergeImage, only using the first atom in the AtomicGroup as the reference atom.

Definition at line 846 of file AtomicGroup.cpp.

std::vector< GCoord > loos::AtomicGroup::momentsOfInertia ( void  ) const

Computes the moments of inertia for a group.

Calculates the principal moments and principal axes (from the moment of inertia). This is distinct from the principalAxes() function which calculates the distribution of points about the centroid.

Definition at line 48 of file AG_linalg.cpp.

bool loos::AtomicGroup::operator== ( AtomicGroup rhs)

Equality test for two groups.

The test for equality is based on whether or not the contained atom pointers are the same. This operator will also force both sides of the equation to be sorted.

Definition at line 749 of file AtomicGroup.cpp.

bool loos::AtomicGroup::operator== ( const AtomicGroup rhs) const

Equality test for const groups.

Similar to the non-const version, but it will sort copies of the atom lists if they are not already sorted...

Definition at line 769 of file AtomicGroup.cpp.

std::vector< GCoord > loos::AtomicGroup::principalAxes ( void  ) const

Compute the principal axes of a group.

Calculates the eigendecomposition of AA' where A is column-wise concatenation of coordinates from all atoms in the group. The mean coordinate is automatically subtracted from A... Returns a vector of GCoord's in order of decreasing magnitude of the corresponding eigenvalue. The eigenvalues are returned as a GCoord after the eigenvectors.

Example

vector<GCoord> V = group_of_atoms.principalAxes();
GCoord eigenvalues = V[3];
GCoord first_eigenvector = V[0]; // Most significant
GCoord second_eigenvector = V[1];
GCoord third_eigenvector = V[2]; // Least significant

Notes

  • Any errors encountered in the BLAS/LAPACK routines cause a runtime exception to be thrown...
  • Coord type of contained atoms will always be upcast to double.
  • Potential issue with f77int under linux when not on a 64-bit architecture.

Definition at line 104 of file AG_linalg.cpp.

void loos::AtomicGroup::pruneBonds ( )

Attempt to prune connectivity (only retain bonds to atoms within this AtomicGroup)

The connectivity list is searched for each atom and if a bond is not found in the current group, then it is removed from the bond-list for that atom. Note that this means that any AtomicGroup sharing the atom in question will also now have the modified bond list. It's therefore recommended that this function be called on a copy (AtomicGroup::copy()). Also note that FindById() does not implicitly sort the atoms for more efficient searching. You may want to call AtomicGroup::sort() prior to AtomicGroup::pruneBonds() if the exact atom order does not matter.

Definition at line 886 of file AtomicGroup.cpp.

greal loos::AtomicGroup::radius ( const bool  use_atom_as_reference = false) const

Maximum radius from centroid of all atoms (not gyration)

If optional argument is true, uses coordinates of atom 0 instead of centroid. Argument is false by default.

Definition at line 164 of file AG_numerical.cpp.

void loos::AtomicGroup::reimage ( )

Translate the entire group so that the centroid is in the primary cell

Definition at line 803 of file AtomicGroup.cpp.

void loos::AtomicGroup::resetAtomIndices ( )

Reset the atom indices (used for interfacing with trajectories)

The Atom index is the original ordering of atoms from whatever file format the model came from. This is used as an index into each frame of the trajectory for corresponding atom properties (such as coordinates). If an AtomicGroup is a subset, then it may be necessary to reset the indices when working with a subsetted trajectory as well. This function will reset the atom indices to be sequential, beginning with 0.

Definition at line 909 of file AtomicGroup.cpp.

greal loos::AtomicGroup::rmsd ( const AtomicGroup v)

Compute the RMSD between two groups.

Sorts both groups (if necessary), then assumes a 1:1 correspondence between ith atoms.

Definition at line 222 of file AG_numerical.cpp.

void loos::AtomicGroup::setCoords ( double *  seq,
int  m,
int  n 
)

This function is meant for Numpy/swig use in setting the model's coordinates. The passed array is row-major.

Definition at line 1014 of file AtomicGroup.cpp.

bool loos::AtomicGroup::sorted ( void  ) const
inline

Is the array of atoms already sorted???

While we make some effort to ensure that alterations to the AtomicGroup will invalidate the sorted status, it's a good idea to explicitly sort if you want to make sure that the group is in fact sorted.

Definition at line 411 of file AtomicGroup.hpp.

greal loos::AtomicGroup::sphericalVariance ( const pAtom  target) const

Spherical variance of group with respect to target atom.

spherical variance as a measure of how much atom "target" is inside this atomic group Mezei, J Mol Graph Modeling, 2003, 21, 463-472

Definition at line 204 of file AG_numerical.cpp.

std::vector< AtomicGroup > loos::AtomicGroup::splitByResidue ( void  ) const

Returns a vector of AtomicGroups, each comprising a single residue.

Splits an AtomicGroup into individual residues. The residue boundary is marked by either a change in the resid or in the segid.

Definition at line 461 of file AtomicGroup.cpp.

std::vector< AtomicGroup > loos::AtomicGroup::splitByUniqueSegid ( void  ) const

Returns a vector of AtomicGroups split from the current group based on segid.

The groups that are returned will be in the same order that the segids appear in the source AtomicGroup

Definition at line 318 of file AtomicGroup.cpp.

AtomicGroup loos::AtomicGroup::subset ( const int  offset,
const int  len = 0 
)

subset() and excise() args are patterned after perl's substr...

If offset is negative, then it's relative to the end of the group. If length is 0, then everything from offset to the appropriate end is used...

Definition at line 276 of file AtomicGroup.cpp.

GMatrix loos::AtomicGroup::superposition ( const AtomicGroup grp)

Calculates the transformation matrix for superposition of groups.

Uses the Kabsch alignment method (via SVD) to calculate the transformation matrix that superimposes the current group onto the passed group. Returns the matrix.

If too few atoms are given for aligning, the correlation matrix may become singular and return fewer than three eigenpairs. If this is detected, superposition() will throw a NumericalError. The threshold for a zero-eigenvalue (really, a zero singular value) is set in AtomicGroup::superposition_zero_singular_value

Definition at line 188 of file AG_linalg.cpp.


The documentation for this class was generated from the following files: