#include <openbabel/rotamer.h>
Inheritance diagram for OBRotamerList:
Public Member Functions | |
OBRotamerList () | |
virtual OBGenericData * | Clone (OBBase *parent) const |
~OBRotamerList () | |
void | Setup (OBMol &, OBRotorList &) |
void | Setup (OBMol &mol, unsigned char *ref, int nrotors) |
unsigned int | NumRotors () const |
unsigned int | NumRotamers () const |
void | AddRotamer (double *) |
void | AddRotamer (int *key) |
void | AddRotamer (std::vector< int > key) |
void | AddRotamer (unsigned char *key) |
void | AddRotamers (unsigned char *arr, int nconf) |
void | GetReferenceArray (unsigned char *) const |
std::vector< double * > | CreateConformerList (OBMol &mol) |
void | ExpandConformerList (OBMol &mol, std::vector< double * > &confs) |
void | SetBaseCoordinateSets (OBMol &mol) |
void | SetBaseCoordinateSets (std::vector< double * > bc, unsigned int N) |
unsigned int | NumBaseCoordinateSets () const |
double * | GetBaseCoordinateSet (unsigned int i) const |
unsigned int | NumAtoms () const |
void | SetAttribute (const std::string &v) |
void | SetOrigin (const DataOrigin s) |
virtual const std::string & | GetAttribute () const |
unsigned int | GetDataType () const |
virtual const std::string & | GetValue () const |
virtual DataOrigin | GetOrigin () const |
Iterator methods | |
std::vector< unsigned char * >::iterator | BeginRotamer () |
std::vector< unsigned char * >::iterator | EndRotamer () |
Protected Attributes | |
std::string | _attr |
unsigned int | _type |
DataOrigin | _source |
A high-level class for rotamer / conformer generation, intended mainly for use with the related class OBRotorList and the OBRotorRules database
Rotamers represent conformational isomers formed simply by rotation of dihedral angles. On the other hand, conformers may include geometric relaxation (i.e., slight modification of bond lengths, bond angles, etc.)
The following shows an example of generating 2 conformers using different rotor states. Similar code could be used for systematic or Monte Carlo conformer sampling when combined with energy evaluation (molecular mechanics or otherwise).
OBRotorList rl; // used to sample all rotatable bonds via the OBRotorRules data // If you want to "fix" any particular atoms (i.e., freeze them in space) // then set up an OBBitVec of the fixed atoms and call // rl.SetFixAtoms(bitvec); rl.Setup(mol); // How many rotatable bonds are there? cerr << " Number of rotors: " << rl.Size() << endl; // indexed from 1, rotorKey[0] = 0 std::vector<int> rotorKey(rl.Size() + 1, 0); // each entry represents the configuration of a rotor // e.g. indexes into OBRotor::GetResolution() -- the different angles // to sample for a rotamer search for (unsigned int i = 0; i < rl.Size() + 1; ++i) rotorKey[i] = 0; // could be anything from 0 .. OBRotor->GetResolution().size() // The OBRotamerList can generate conformations (i.e., coordinate sets) OBRotamerList rotamers; rotamers.SetBaseCoordinateSets(mol); rotamers.Setup(mol, rl); rotamers.AddRotamer(rotorKey); rotorKey[1] = 2; // switch one rotor rotamers.AddRotamer(rotorKey); rotamers.ExpandConformerList(mol, mol.GetConformers()); // change the molecule conformation mol.SetConformer(0); // rotorKey 0, 0, ... conv.Write(&mol); mol.SetConformer(1); // rotorKey 0, 2, ...
OBRotamerList | ( | ) | [inline] |
~OBRotamerList | ( | ) |
OBGenericData * Clone | ( | OBBase * | parent | ) | const [virtual] |
Reimplemented from OBGenericData.
void Setup | ( | OBMol & | , | |
OBRotorList & | ||||
) |
Set up a rotamer list based on an already created OBRotorList.
void Setup | ( | OBMol & | mol, | |
unsigned char * | ref, | |||
int | nrotors | |||
) |
Set up a rotamer list based on the supplied reference atoms and the number of rotors
mol | The molecule to evaluate | |
ref | An array of the 4 dihedral atoms for each rotor | |
nrotors | The number of rotors (i.e., the size of ref / 4) |
unsigned int NumRotors | ( | ) | const [inline] |
unsigned int NumRotamers | ( | ) | const [inline] |
void AddRotamer | ( | double * | ) |
Add a rotamer to the list based on the supplied coordinate set as a double*.
void AddRotamer | ( | int * | key | ) |
Add a rotamer to the list based on key
as a configuration of the individual rotor bonds.
void AddRotamer | ( | std::vector< int > | key | ) |
Add a rotamer to the list based on key
as a configuration of the individual rotor bonds.
void AddRotamer | ( | unsigned char * | key | ) |
Add a rotamer to the list based on key
as a configuration of the individual rotor bonds.
void AddRotamers | ( | unsigned char * | arr, | |
int | nconf | |||
) |
Add nconf
rotamers based on as
an array of configurations much like AddRotamer().
void GetReferenceArray | ( | unsigned char * | ) | const |
std::vector<unsigned char*>::iterator BeginRotamer | ( | ) | [inline] |
std::vector<unsigned char*>::iterator EndRotamer | ( | ) | [inline] |
vector< double * > CreateConformerList | ( | OBMol & | mol | ) |
Create a conformer list using the internal base set of coordinates.
void ExpandConformerList | ( | OBMol & | mol, | |
std::vector< double * > & | confs | |||
) |
Create a conformer list using the internal base set of coordinates.
confs
void SetBaseCoordinateSets | ( | OBMol & | mol | ) | [inline] |
Copies the mol's conformers (the coordinates, NOT the pointers) into the object as base coordinates.
void SetBaseCoordinateSets | ( | std::vector< double * > | bc, | |
unsigned int | N | |||
) |
Copies the coordinates in bc, NOT the pointers, into this object.
bc | The conformer set for the molecule | |
N | The number of atoms in the molecule |
unsigned int NumBaseCoordinateSets | ( | ) | const [inline] |
double* GetBaseCoordinateSet | ( | unsigned int | i | ) | const [inline] |
Get a pointer to a specific base pointer (i.e., specific conformer).
unsigned int NumAtoms | ( | ) | const [inline] |
void SetAttribute | ( | const std::string & | v | ) | [inline, inherited] |
Set the attribute (key), which can be used to retrieve this data.
void SetOrigin | ( | const DataOrigin | s | ) | [inline, inherited] |
Set the origin of this data, which can be used to filter the data.
virtual const std::string& GetAttribute | ( | ) | const [inline, virtual, inherited] |
unsigned int GetDataType | ( | ) | const [inline, inherited] |
virtual const std::string& GetValue | ( | ) | const [inline, virtual, inherited] |
Base class returns a default value (the attribute type) but should never be called.
Reimplemented in OBCommentData, OBPairData, and OBPairTemplate.
virtual DataOrigin GetOrigin | ( | ) | const [inline, virtual, inherited] |
std::string _attr [protected, inherited] |
attribute tag (e.g., "UnitCell", "Comment" or "Author")
unsigned int _type [protected, inherited] |
attribute type -- declared for each subclass
DataOrigin _source [protected, inherited] |
source of data for accounting