Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

BTK Namespace Reference


Classes

class  Atom
 A minimal Atom class. More...

struct  atom_rotator
 Atom rotation functor. More...

class  AtomContainer
 A generalized container of atoms. More...

struct  AtomGroupConcept
 Interface class which allows atoms to get information from their container. More...

struct  AtomIndexPair
struct  AtomIndexTetrad
struct  is_any
struct  is_calpha
struct  is_protein_bb
struct  is_group_num_gt
struct  is_group_num_lt
struct  is_selected
class  BuildableAtomDecorator
 Adds buildable and bonded concepts to an atomtype. More...

struct  BuildableAtomGroupConcept
 Interface which allows buildable atoms to send a build request to their container. More...

class  BuildableMonomer
 a class that implements the buildable concept for monomers More...

class  BuildableMonomerFamilyPattern
struct  BuildableMonomerFamilyPattern::member_pattern_t
struct  BuildableMonomerFamilyPattern::member_modifier_t
struct  BuildableMonomerFamilyPattern::modifiable_member_pattern_t
struct  BuildableMonomerFamilyPattern::family_pattern_t
struct  BuildableMonomerFamilyPattern::get_atoms
struct  BuildableMonomerFamilyPattern::get_bonds
struct  BuildableMonomerFamilyPattern::get_tetrads
struct  CachedUnaryFunction
class  CHARMMAtomDecorator
struct  EigenState
 eigenvector/eigenvalue pair structure More...

class  Molecule
 Generic molecule class. More...

class  Monomer
 A minimal monomer object. More...

class  MonomerContainer
class  PDBAtomDecorator
class  PDBReader
class  PeptideBB
class  PeptideBBFamilyPattern
class  PeptideFamilyPattern
class  PeptideHeavyAtom
class  PeptideHeavyAtomFamilyPattern
class  Polymer
 Polymer is a class for representing polymeric molecules. More...

class  MatchListStrategy
class  PointerListStrategy
class  PredicateIterator
class  SasaAtomDecorator
class  SharedVector
class  SharedVectorBase
 A container that behaves like std::vector, with additional shallow-copy services. More...

class  StructureFileReader
class  StructureFileReader::StructureFileReadFailure
 Exception class for use with StructureFileReader objects. More...


Vector and Matrix types.

The BTK* types are typedefs to appropriate classes in the Boost::ublas linear algebra library. Using these types in the BTK makes it easier to write/read linear algebra code, and easier to switch the code to other linear algebra systems (should that ever become necessary).

typedef uBLAS::vector< double > BTKVector
typedef uBLAS::matrix< double > BTKMatrix
typedef uBLAS::symmetric_matrix<
double > 
BTKSymmetricMatrix

Functions to rotate atoms by Euler angles.

These functions rotate a structure using Euler angles under the 'X Convention,' where:

  • phi - first rotation, around the Z axis
  • theta - second rotation, around the X axis [0,pi]
  • psi - third rotation, around Z axis

The fixed_point parameter allows for specification of a linear translation to be performed to each point in the structure prior to rotation. You'll usually want to use the default fixed_point, which is the unweighted center of mass of the structure.

template<typename AtomIterator> void rotate (AtomIterator first, AtomIterator last, double phi, double theta, double psi, const BTKVector &fixed_point)
template<typename AtomIterator> void rotate (AtomIterator first, AtomIterator last, double phi, double theta, double psi)

Functions to rotate atoms around an axis.

These methods rotate a structure by theta radians about axis. As with Euler rotations, the fixed_point allows the specification of a linear translation to be performed to each point in the structure prior to rotation. The default is the structure's unweighted center of mass.

template<typename AtomIterator> void rotate (AtomIterator first, AtomIterator last, const BTKVector &axis, double theta, const BTKVector &fixed_point)
template<typename AtomIterator> void rotate (AtomIterator first, AtomIterator last, const BTKVector &axis, double theta)

Center of Mass functions.

template<typename AtomIterator> BTKVector center_of_mass (AtomIterator first, AtomIterator last)
 Unweighted center of mass calculator.

template<typename AtomIterator> void center (AtomIterator first, AtomIterator last)
 Center a structure.

template<typename AtomIterator1, typename AtomIterator2> void align_centers (AtomIterator1 fixed_first, AtomIterator1 fixed_last, AtomIterator2 align_first, AtomIterator2 align_last)
 Align center of 'align' atomset to center of 'fixed' atomset.


Rotation about an axis.

BTKMatrix create_rotation_matrix (const BTKVector &axis, double theta)
void initialize_rotation_matrix (const BTKVector &axis, double theta, BTKMatrix &rm)

Rotation by Euler angles.

Euler angles are evil. Don't use them. Of course, sometimes they're more efficient than any other alternative (such as when you need to rotate into another coordinate system) so we provide the ability to create a rotation from Euler angles, assuming the 'X convention':

  • phi - first rotation, around the Z axis.
  • theta - second rotation, around the X axis [0,pi].
  • psi - third rotation, around Z axis.

These are the conventions used in Mathematica, in case you're partial to that package. They may not be the same as whatever other package you're using, however, so beware!

BTKMatrix create_rotation_matrix (double phi, double theta, double psi)
 Create a new rotation matrix from Euler angles.

void initialize_rotation_matrix (double phi, double theta, double psi, BTKMatrix &rm)
 Initialize a pre-existing rotation matrix.


[NOHEADER]

template<class Predicate, class Iterator> PredicateIterator< Predicate,
Iterator > 
make_predicate_iterator (Iterator const &begin, Iterator const &end, Predicate const &p)
template<class Predicate, class Iterator> PredicateIterator< Predicate,
Iterator > 
make_predicate_iterator (Iterator const &end, Predicate const &p)

Mathematical Constants.

const double PI = 3.1415926535897323
const double DEG2RAD = PI/180.0
const double RAD2DEG = 180.0/PI

Typedefs

typedef Atom Atom
typedef BuildableAtomDecorator<
Atom
BuildableAtom
typedef CHARMMAtomDecorator<
BuildableAtom
CHARMMAtom
typedef Molecule< Atombasic_molecule
typedef Monomer< Atombasic_monomer
typedef PDBAtomDecorator<
Atom
PDBAtom
typedef PeptideBB< BuildableAtombasic_peptide_bb
typedef PeptideHeavyAtom<
BuildableAtom
basic_peptide
typedef Polymer< basic_monomerbasic_polymer
typedef Polymer< basic_peptidebasic_protein
typedef SasaAtomDecorator<
Atom
SasaAtom
typedef StructureFileReader StructureFileReader

Functions

void print_pdb_atom_line (int atom_num, const std::string &atom_name, const std::string &res_name, char chain_id, int res_num, const BTKVector &pos, std::ostream &os)
std::ostream & operator<< (std::ostream &os, const BTK::Atom &a)
template<bool SelectValue, typename AtomIterator> void set_atom_selection (AtomIterator first, AtomIterator last)
 Select or deselect an atom set.

template<bool SelectValue, typename AtomIterator, typename UnaryPredicate> void set_atom_selection (AtomIterator first, AtomIterator last, UnaryPredicate test)
template<typename AtomIterator> void translate (AtomIterator first, AtomIterator last, const BTKVector &T)
 Translate atomset along a vector.

template<typename AtomIterator> void rotate (AtomIterator first, AtomIterator last, const BTKMatrix &R)
 Rotate atoms using a rotation matrix.

template<typename AtomIterator> void transform (AtomIterator first, AtomIterator last, const BTKMatrix &R, const BTKVector &T)
 Combined translate/rotate.

template<typename AtomIterator> void principal_axes (AtomIterator first, AtomIterator last, std::vector< EigenState > &axes, BTKVector &COM)
 return the (covariance) principal axes and center of mass of a set of atoms

template<typename AtomIterator1, typename AtomIterator2> double get_trivial_rmsd (AtomIterator1 a1_first, AtomIterator1 a1_last, AtomIterator2 a2_first, AtomIterator2 a2_last)
 calculate the trivial (non-superimposed) rmsd between two atomsets

template<typename AtomIterator1, typename AtomIterator2> double get_rmsd (AtomIterator1 a1_first, AtomIterator1 a1_last, AtomIterator2 a2_first, AtomIterator2 a2_last)
 Calculate the rmsd of the least-squares superposition of two atom sets.

template<typename AtomIterator1, typename AtomIterator2> void leastsquares_superposition (AtomIterator1 fixed_first, AtomIterator1 fixed_last, AtomIterator2 superimpose_first, AtomIterator2 superimpose_last, BTKMatrix &R, BTKVector &T, double &rmsd)
 Calculate the transformation resulting in the least-squares superposition of two atom sets.

template<typename AtomIterator1, typename AtomIterator2, typename AtomIterator3> void leastsquares_superposition (AtomIterator1 fixed_first, AtomIterator1 fixed_last, AtomIterator2 superimpose_first, AtomIterator2 superimpose_last, AtomIterator3 transform_first, AtomIterator3 transform_last, double &rmsd)
 Apply the least-squares superposition of two atomsets to a third atomset.

template<typename AtomType> void add_bond (AtomType &first, AtomType &last)
 Add a covalent bond between two atoms.

template<typename AtomType> unsigned bond_distance_4 (AtomType &a1, AtomType &a2)
 Get the topological distance of another atom up to 4 bonds away.

template<typename AtomIterator> void build (AtomIterator first, AtomIterator last)
 Build a set of atoms by building transitively bonded neighbors.

template<typename AtomType> void build_atom (AtomType &a)
 Build atom by building transitively bonded neighbors.

template<typename AtomType> void restricted_rotate (AtomType &start, AtomType &boundary, double delta_angle)
 Rotate a transitively bonded atom group.

template<typename AtomType, typename UnaryFunction> UnaryFunction for_each_buildable_atom (AtomType &start, AtomType &boundary, UnaryFunction func)
 Apply a function to a sequence of bonded atoms.

BTKVector new_vector (double x=0., double y=0., double z=0.)
double length (const BTKVector &v)
BTKVector cross (const BTKVector &lhs, const BTKVector &rhs)
 cross product of two vectors.

BTKVector project (const BTKVector &a, const BTKVector &b)
BTKVector project_normal (const BTKVector &a, const BTKVector &b)
bool within_sqr_dist (const BTKVector &a, const BTKVector &b, double r_squared)
BTKVectornormalize (BTKVector &v)
BTKVector normalize (const BTKVector &v)
double cosine_vector_angle (const BTKVector &v1, const BTKVector &v2)
 calculate the cosine of the angle between two vectors.

double vector_angle (const BTKVector &v1, const BTKVector &v2)
 calculate the angle between two vectors.

double point_angle (const BTKVector &v1, const BTKVector &v2, const BTKVector &v3)
 calculate the angle formed by v1-v2 amd v3-v2

double vector_dihedral (const BTKVector &v1, const BTKVector &v2, const BTKVector &v3)
double point_dihedral (const BTKVector &a, const BTKVector &b, const BTKVector &c, const BTKVector &d)
BTKVector set_vector_from_dihedral (const BTKVector &v3, const BTKVector &v2, const BTKVector &v1, double len34, double ang234, double dih1234)
 calculate vector position from a dihedral angle

BTKVector set_vector_from_two_angles (const BTKVector &v3, const BTKVector &v2, const BTKVector &v1, double len34, double ang234, double ang134)
 Calculate vector position from two vector angles.

std::ostream & operator<< (std::ostream &os, const std::vector< EigenState > &es)
 Output an eigensystem.

std::vector< EigenStatediagonalize_symmetric (const BTKMatrix &m)
 Diagonalize a symmetric matrix.

template<typename InputIterator> double get_total_sasa (InputIterator first, InputIterator last)
template<typename InputIterator> double get_total_sasa_solvation_energy (InputIterator first, InputIterator last)

Variables

const double WATER_RADIUS = 1.4


Typedef Documentation

typedef class Atom BTK::Atom
 

typedef Molecule<Atom> BTK::basic_molecule
 

typedef Monomer<Atom> BTK::basic_monomer
 

typedef PeptideHeavyAtom<BuildableAtom> BTK::basic_peptide
 

typedef PeptideBB<BuildableAtom> BTK::basic_peptide_bb
 

typedef Polymer<basic_monomer> BTK::basic_polymer
 

typedef Polymer<basic_peptide> BTK::basic_protein
 

typedef uBLAS::matrix<double> BTK::BTKMatrix
 

typedef uBLAS::symmetric_matrix<double> BTK::BTKSymmetricMatrix
 

typedef uBLAS::vector<double> BTK::BTKVector
 

typedef BuildableAtomDecorator<Atom> BTK::BuildableAtom
 

typedef CHARMMAtomDecorator<BuildableAtom> BTK::CHARMMAtom
 

typedef PDBAtomDecorator<Atom> BTK::PDBAtom
 

typedef SasaAtomDecorator<Atom> BTK::SasaAtom
 

typedef class StructureFileReader BTK::StructureFileReader
 


Function Documentation

template<typename AtomIterator1, typename AtomIterator2>
void BTK::align_centers AtomIterator1  fixed_first,
AtomIterator1  fixed_last,
AtomIterator2  align_first,
AtomIterator2  align_last
 

Align center of 'align' atomset to center of 'fixed' atomset.

Here is the call graph for this function:

template<typename AtomIterator>
void BTK::center AtomIterator  first,
AtomIterator  last
 

Center a structure.

Places a structure's unweighted center of mass at the coordinate system origin.

Here is the call graph for this function:

template<typename AtomIterator>
BTK::BTKVector BTK::center_of_mass AtomIterator  first,
AtomIterator  last
 

Unweighted center of mass calculator.

Calculates the center of mass of all atoms in the range [first,last). All atoms are assumed to be of uniform mass.

Here is the call graph for this function:

double cosine_vector_angle const BTKVector &  v1,
const BTKVector &  v2
[inline]
 

calculate the cosine of the angle between two vectors.

BTKVector cross const BTKVector &  lhs,
const BTKVector &  rhs
[inline]
 

cross product of two vectors.

vector< EigenState > BTK::diagonalize_symmetric const BTKMatrix &  m  ) 
 

Diagonalize a symmetric matrix.

Here is the call graph for this function:

template<typename InputIterator>
double BTK::get_total_sasa InputIterator  first,
InputIterator  last
 

Calculate approximate solvent-acc surface area.

Calculate the approximate solvent-acc surface area in sq. Angstroms for any set of atoms by the boolean look-up table method of LeGrand and Merz.

Here is the call graph for this function:

template<typename InputIterator>
double BTK::get_total_sasa_solvation_energy InputIterator  first,
InputIterator  last
 

Calculate sasa solvation energy.

By setting an atomic solvation parameter (asp) for each atom, a solvation energy can be calculated from the surface area as sum_over_atoms(asp_atom*expoed_area_atom)

(Note that this should be modified to take a payload atom iterator, where payload = solvation radius, atomic solvation parameter)

Here is the call graph for this function:

template<typename AtomIterator1, typename AtomIterator2>
double BTK::get_trivial_rmsd AtomIterator1  a1_first,
AtomIterator1  a1_last,
AtomIterator2  a2_first,
AtomIterator2  a2_last
 

calculate the trivial (non-superimposed) rmsd between two atomsets

Returns:
trivial rmsd between atomsets

double length const BTKVector &  v  )  [inline]
 

Get the length of a vector. Warning: if you're calling this function from a multi-calculation expression, use the uBLAS norm_2() function instead.

template<class Predicate, class Iterator>
PredicateIterator<Predicate,Iterator> make_predicate_iterator Iterator const &  end,
Predicate const &  p
[inline]
 

Helper functions for making PredicateIterators.

template<class Predicate, class Iterator>
PredicateIterator<Predicate,Iterator> make_predicate_iterator Iterator const &  begin,
Iterator const &  end,
Predicate const &  p
[inline]
 

Helper functions for making PredicateIterators.

BTKVector new_vector double  x = 0.,
double  y = 0.,
double  z = 0.
[inline]
 

BTKVector normalize const BTKVector &  v  )  [inline]
 

Constant vector version of normalization. Unlike the non-const version of normalize, this one creates a new vector, which is a normalized copy of vector v.

Parameters:
v BTKVector to normalize.
Returns:
new vector containing normalized copy of v.

BTKVector& normalize BTKVector &  v  )  [inline]
 

Normalize a vector to unit length. This function normalizes the vector passed to it. The vector *is modified*.

Parameters:
v BTKVector to normalize.
Returns:
reference to v, following normalization.

ostream & BTK::operator<< std::ostream &  os,
const std::vector< EigenState > &  es
 

Output an eigensystem.

ostream & BTK::operator<< std::ostream &  os,
const BTK::Atom a
 

Here is the call graph for this function:

double point_angle const BTKVector &  v1,
const BTKVector &  v2,
const BTKVector &  v3
[inline]
 

calculate the angle formed by v1-v2 amd v3-v2

Here is the call graph for this function:

double BTK::point_dihedral const BTKVector &  a,
const BTKVector &  b,
const BTKVector &  c,
const BTKVector &  d
 

Calculate the dihedral angle between the planes a-b-c and d-c-b. This offers a more conventional "four point" access to the dihedral function.

Here is the call graph for this function:

template<typename AtomIterator>
void BTK::principal_axes AtomIterator  first,
AtomIterator  last,
std::vector< EigenState > &  axes,
BTKVector &  COM
 

return the (covariance) principal axes and center of mass of a set of atoms

Here is the call graph for this function:

void BTK::print_pdb_atom_line int  atom_num,
const std::string &  atom_name,
const std::string &  res_name,
char  chain_id,
int  res_num,
const BTKVector &  pos,
std::ostream &  os
 

BTKVector BTK::project const BTKVector &  a,
const BTKVector &  b
 

Project vector a onto vector b. Get the component of vector a that is parallel to vector b.

Here is the call graph for this function:

BTKVector BTK::project_normal const BTKVector &  a,
const BTKVector &  b
 

Project the component of vector a that is normal to vector b. Get the component of a that is perpendicular to b.

Here is the call graph for this function:

template<bool SelectValue, typename AtomIterator, typename UnaryPredicate>
void set_atom_selection AtomIterator  first,
AtomIterator  last,
UnaryPredicate  test
 

template<bool SelectValue, typename AtomIterator>
void set_atom_selection AtomIterator  first,
AtomIterator  last
 

Select or deselect an atom set.

BTKVector BTK::set_vector_from_dihedral const BTKVector &  v3,
const BTKVector &  v2,
const BTKVector &  v1,
double  len34,
double  ang234,
double  dih1234
 

calculate vector position from a dihedral angle

Calculates the position of a vector from 3 other atoms that define a a dihedral angle with the build vector

Parameters:
len34 distance between v3 and v4
ang234 angle formed by v2 - v3 and v4 - v3
dih1234 dihedral angle between v4 - v3 and v1 - v2 along the axis formed by v3 - v2
Returns:
v4, the vector built from vectors v1,v2 and v3

Here is the call graph for this function:

BTKVector BTK::set_vector_from_two_angles const BTKVector &  v3,
const BTKVector &  v2,
const BTKVector &  v1,
double  len34,
double  ang234,
double  ang134
 

Calculate vector position from two vector angles.

Calculates the position of a point, v4, using three other points, v1,v2,v3, given two vector angles (angle(v4-v3,v2-v3) & angle(v4-v3,v1-v3)), and a vector length ( |v4-v3| ), assuming a right-handed relationship between v1-v3,v2-v3 and v4-v3 (see below)

Submit the vectors in order such that the three vectors v1-v3, v2-v3 and v4-v3, form a right-handed system, ie. so that dot(v4-v3,cross(v1-v3,v2-v3)) is a positive number, if you have a left-handed arrangment, then swap the arguments v2 and v1 (and the corresponding angle arguments ang234 and ang134 )

Parameters:
len34 | v4-v3 |
ang234 vector angle between v2-v3 and v4-v3
ang134 vector angle between v1-v3 and v4-v3

Here is the call graph for this function:

template<typename AtomIterator>
void BTK::transform AtomIterator  first,
AtomIterator  last,
const BTKMatrix &  R,
const BTKVector &  T
 

Combined translate/rotate.

Changes every atom position P to P' such that P' = (U*(P)+T)

template<typename AtomIterator>
void BTK::translate AtomIterator  first,
AtomIterator  last,
const BTKVector &  T
 

Translate atomset along a vector.

Parameters:
first start iterator of atomset
last end iterator of atomset

double vector_angle const BTKVector &  v1,
const BTKVector &  v2
[inline]
 

calculate the angle between two vectors.

Here is the call graph for this function:

double BTK::vector_dihedral const BTKVector &  v1,
const BTKVector &  v2,
const BTKVector &  v3
 

Calculate the dihedral angle formed by three vectors. The dihedral angle is the angle formed between v1 and v3, about vector v2.

ctsa - note that this function used to be inlined, but it caused nasty core-dumps with g++ version 2.96 built w/ flags: -O2 -DNDEBUG

Here is the call graph for this function:

bool BTK::within_sqr_dist const BTKVector &  a,
const BTKVector &  b,
double  r_squared
 

See if two vectors are within a squared distance threshold of one another.

Parameters:
a BTKVector 1
b BTKVector 2
r_squared Squared distance threshold.
Returns:
true if vector 1 and 2 are within sqrt(r_squared) units of one another.


Variable Documentation

const double BTK::DEG2RAD = PI/180.0
 

const double BTK::PI = 3.1415926535897323
 

const double BTK::RAD2DEG = 180.0/PI
 

const double BTK::WATER_RADIUS = 1.4
 


Generated on Wed Apr 14 00:43:19 2004 for BTK by doxygen 1.3.6