Loading...
Searching...
No Matches
OBRotamerList Class Reference

`#include <openbabel/rotamer.h>`

Inheritance diagram for OBRotamerList:
[legend]

## 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
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< unsignedchar * >::iterator | BeginRotamer ()
std::vector< unsignedchar * >::iterator | EndRotamer ()
std::vector< double * > | CreateConformerList (OBMol &mol)
void | ExpandConformerList (OBMol &mol, std::vector< double * > &confs)
bool | SetCurrentCoordinates (OBMol &mol, std::vector< int > arr)
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

## Protected Attributes

std::string | _attr
unsigned int | _type
DataOrigin | _source

## Detailed Description

Supports a set of rotamer coordinate sets for some number of potentially rotatable bonds.

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()
// -1 is for no rotation
// 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, ...
OpenBabel::OBRotamerList::ExpandConformerList
void ExpandConformerList(OBMol &mol, std::vector< double * > &confs)
Create a conformer list using the internal base set of coordinates.
Definition rotamer.cpp:478
OpenBabel::OBRotamerList::AddRotamer
void AddRotamer(double *)
Add a rotamer to the list based on the supplied coordinate set as a double*.
Definition rotamer.cpp:332
OpenBabel::OBRotamerList::SetBaseCoordinateSets
void SetBaseCoordinateSets(OBMol &mol)
Copies the mol's conformers (the coordinates, NOT the pointers) into the object as base coordinates.
Definition rotamer.cpp:579
OpenBabel::OBRotamerList::OBRotamerList
OBRotamerList()
Definition rotamer.h:54
OpenBabel::OBRotamerList::Setup
void Setup(OBMol &, OBRotorList &)
Set up a rotamer list based on an already created OBRotorList.
Definition rotamer.cpp:199
OpenBabel::OBRotorList
Given an OBMol, set up a list of possibly rotatable torsions,.
Definition rotor.h:458
OpenBabel::OBRotorList::Setup
bool Setup(OBMol &mol, bool sampleRings=false)
Definition rotor.cpp:56
OpenBabel::OBRotorList::Size
size_t Size()
Definition rotor.h:487

## Constructor & Destructor Documentation

## OBRotamerList()

OBRotamerList | ( |  | ) |

inline

Referenced by Clone().

## ~OBRotamerList()

~OBRotamerList | ( |  | ) |

## Member Function Documentation

## Clone()

OBGenericData * Clone | ( | OBBase * | parent | ) | const

virtual

Reimplemented from OBGenericData.

## Setup() [1/2]

void Setup | ( | OBMol & | mol,
|  | OBRotorList & | rl )

Set up a rotamer list based on an already created OBRotorList.

Referenced by Clone(), OBForceField::FastRotorSearch(), OBConformerSearch::GetConformers(), OBForceField::RandomRotorSearchInitialize(), OBForceField::SystematicRotorSearchInitialize(), and OBForceField::WeightedRotorSearch().

## Setup() [2/2]

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

Parameters

  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)

## NumRotors()

unsigned int NumRotors | ( |  | ) | const

inline

Returns
  the number of rotatable bonds considered

Referenced by Clone().

## NumRotamers()

unsigned int NumRotamers | ( |  | ) | const

inline

Returns
  the number of rotamer (conformation) coordinate sets

Referenced by Clone().

## AddRotamer() [1/4]

void AddRotamer | ( | double * | c | ) |

Add a rotamer to the list based on the supplied coordinate set as a double*.

Referenced by OBConformerSearch::GetConformers(), OBForceField::RandomRotorSearchInitialize(), and OBForceField::SystematicRotorSearchInitialize().

## AddRotamer() [2/4]

void AddRotamer | ( | int * | key | ) |

Add a rotamer to the list based on `key` as a configuration of the individual rotor bonds.

## AddRotamer() [3/4]

void AddRotamer | ( | std::vector< int > | key | ) |

Add a rotamer to the list based on `key` as a configuration of the individual rotor bonds.

## AddRotamer() [4/4]

void AddRotamer | ( | unsigned char * | key | ) |

Add a rotamer to the list based on `key` as a configuration of the individual rotor bonds.

## AddRotamers()

void AddRotamers | ( | unsigned char * | arr,
|  | int | nconf )

Add `nconf` rotamers based on `as` an array of configurations much like AddRotamer().

Referenced by Clone().

## GetReferenceArray()

void GetReferenceArray | ( | unsigned char * | ref | ) | const

Returns
  A reference array (as used by AddRotamer() as a configuration of the individual rotor bonds

Referenced by Clone().

## BeginRotamer()

std::vector< unsignedchar * >::iterator BeginRotamer | ( |  | ) |

inline

## EndRotamer()

std::vector< unsignedchar * >::iterator EndRotamer | ( |  | ) |

inline

## CreateConformerList()

vector< double * > CreateConformerList | ( | OBMol & | mol | ) |

Create a conformer list using the internal base set of coordinates.

Returns
  The set of coordinates by rotating the bonds in each rotamer

Referenced by ExpandConformerList().

## ExpandConformerList()

void ExpandConformerList | ( | OBMol & | mol,
|  | std::vector< double * > & | confs )

Create a conformer list using the internal base set of coordinates.

Returns
  The set of coordinates as a reference in `confs`

Referenced by OBConformerSearch::GetConformers(), OBForceField::RandomRotorSearchInitialize(), and OBForceField::SystematicRotorSearchInitialize().

## SetCurrentCoordinates()

bool SetCurrentCoordinates | ( | OBMol & | mol,
|  | std::vector< int > | arr )

Change the current coordinate set

Since
  version 2.2

Referenced by OBForceField::FastRotorSearch(), and OBForceField::WeightedRotorSearch().

## SetBaseCoordinateSets() [1/2]

void SetBaseCoordinateSets | ( | OBMol & | mol | ) |

Copies the mol's conformers (the coordinates, NOT the pointers) into the object as base coordinates.

Referenced by Clone(), OBForceField::FastRotorSearch(), OBConformerSearch::GetConformers(), OBForceField::RandomRotorSearchInitialize(), SetBaseCoordinateSets(), OBForceField::SystematicRotorSearchInitialize(), and OBForceField::WeightedRotorSearch().

## SetBaseCoordinateSets() [2/2]

void SetBaseCoordinateSets | ( | std::vector< double * > | bc,
|  | unsigned int | N )

Copies the coordinates in bc, NOT the pointers, into this object.

Parameters

  bc | The conformer set for the molecule
  N | The number of atoms in the molecule

## NumBaseCoordinateSets()

unsigned int NumBaseCoordinateSets | ( |  | ) | const

inline

Returns
  The number of "base" coordinate sets (i.e., the number of conformers in the base OBMol)

Referenced by Clone().

## GetBaseCoordinateSet()

double * GetBaseCoordinateSet | ( | unsigned int | i | ) | const

inline

Get a pointer to a specific base pointer (i.e., specific conformer).

Referenced by Clone().

## NumAtoms()

unsigned int NumAtoms | ( |  | ) | const

inline

Returns
  The number of atoms in the base OBMol

Referenced by Clone().

## SetAttribute()

void SetAttribute | ( | const std::string & | v | ) |

inline inherited

Set the attribute (key), which can be used to retrieve this data.

Referenced by OBGastChrg::AssignPartialCharges(), OBMol::DoTransformations(), AliasData::Expand(), OBMol::FindLSSR(), OBMol::FindSSSR(), OBForceField::GetAtomTypes(), OBMol::GetFormula(), OBMol::GetLSSR(), OBForceField::GetPartialCharges(), OBMol::GetSSSR(), OBDescriptor::PredictAndSave(), and OBMol::SetFormula().

## SetOrigin()

void SetOrigin | ( | const DataOrigin | s | ) |

inline inherited

Set the origin of this data, which can be used to filter the data.

Referenced by OBGastChrg::AssignPartialCharges(), OBMol::DoTransformations(), OBMol::FindAngles(), OBMol::FindLSSR(), OBMol::FindSSSR(), OBMol::FindTorsions(), OBMol::GetFormula(), OBMol::GetLSSR(), OBMol::GetSSSR(), OBDescriptor::PredictAndSave(), and OBMol::SetFormula().

## GetAttribute()

virtual const std::string & GetAttribute | ( |  | ) | const

inline virtual inherited

Returns
  The attribute (key), which can be used to retrieve this data

Referenced by OBMoleculeFormat::MakeCombinedMolecule().

## GetDataType()

unsigned int GetDataType | ( |  | ) | const

inline inherited

Returns
  the data type for this object as defined in OBGenericDataType

## GetValue()

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, and OBPairData.

Referenced by OBDepict::DrawMolecule(), OBDescriptor::FilterCompare(), and OBDescriptor::GetValues().

## GetOrigin()

virtual DataOrigin GetOrigin | ( |  | ) | const

inline virtual inherited

## Member Data Documentation

## _attr

std::string _attr

protected inherited

attribute tag (e.g., "UnitCell", "Comment" or "Author")

Referenced by OBRotamerList::Clone(), GetAttribute(), GetValue(), OBGenericData(), OBNasaThermoData::OBNasaThermoData(), OBRotamerList::OBRotamerList(), OBSymmetryData::OBSymmetryData(), and SetAttribute().

## _type

unsigned int _type

protected inherited

attribute type – declared for each subclass

Referenced by OBRotamerList::Clone(), GetDataType(), OBGenericData(), OBNasaThermoData::OBNasaThermoData(), OBRotamerList::OBRotamerList(), and OBSymmetryData::OBSymmetryData().

## _source

DataOrigin _source

protected inherited

source of data for accounting

Referenced by GetOrigin(), OBGenericData(), OBSymmetryData::OBSymmetryData(), OBAngleData::operator=(), OBConformerData::operator=(), OBSymmetryData::operator=(), OBTorsionData::operator=(), and SetOrigin().

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

- rotamer.h
- rotamer.cpp