Loading...
Searching...
No Matches
OBRotor Class Reference

`#include <openbabel/rotor.h>`

## Public Member Functions

| OBRotor ()
| ~OBRotor ()
void | RemoveSymTorsionValues (int)
Setup
void | SetBond (OBBond *bond)
void | SetRings ()
void | SetIdx (int idx)
void | SetDihedralAtoms (std::vector< int > &ref)
void | SetDihedralAtoms (int ref[4])
void | SetRotAtoms (std::vector< int > &atoms)
void | SetTorsionValues (std::vector< double > &angles)
void | SetFixedBonds (OBBitVec &bv)
Performing rotations
void | SetToAngle (double *coordinates, double setang)
void | SetRotor (double *coordinates, int next, int prev=-1)
void | Set (double *coordinates, double sine, double cosine, double translation, double invmag)
void | Precompute (double *coordinates)
void | Set (double *coordinates, int idx)
void | Precalc (std::vector< double * > &conformers)
void | Set (double *coordinates, int conformer, int idx)
Methods to retrieve information
OBBond * | GetBond ()
size_t | Size ()
int | GetIdx () const
void | GetDihedralAtoms (int ref[4])
std::vector< int > & | GetDihedralAtoms ()
const std::vector< int > & | GetRotAtoms () const
const std::vector< double > & | GetTorsionValues () const
OBBitVec & | GetFixedBonds ()
double | CalcTorsion (double *coordinates)
double | CalcBondLength (double *coordinates)
Iterator methods
std::vector< double >::iterator | BeginTorIncrement ()
std::vector< double >::iterator | EndTorIncrement ()
Deprecated
void | SetDelta (double d)
double | GetDelta ()
OBBitVec & | GetFixedAtoms ()
void | SetFixedAtoms (OBBitVec &bv)
OBBitVec & | GetEvalAtoms ()
void | SetEvalAtoms (OBBitVec &bv)
void * | GetRotAtoms ()
std::vector< double > & | GetResolution ()
void | SetNumCoords (int nc)

## Detailed Description

A single rotatable OBBond as part of rotamer searching.

## Constructor & Destructor Documentation

## OBRotor()

OBRotor | ( |  | ) |

Constructor.

## ~OBRotor()

~OBRotor | ( |  | ) |

inline

Destructor.

## Member Function Documentation

## SetBond()

void SetBond | ( | OBBond * | bond | ) |

inline

Set the OBBond associated with this OBRotor.

Referenced by OBRotorList::FindRotors().

## SetRings()

void SetRings | ( |  | ) |

Set the rings associated with this bond (if it's a ring bond)

Since
  Version 2.4

Referenced by SetBond().

## SetIdx()

void SetIdx | ( | int | idx | ) |

inline

Set the index for this rotor. Used by OBRotorList

Referenced by OBRotorList::FindRotors().

## SetDihedralAtoms() [1/2]

void SetDihedralAtoms | ( | std::vector< int > & | ref | ) |

Set the dihedral atoms.

Parameters

  ref | The dihedral atom indexes. These indexes start from 1.

Referenced by OBRotorList::AssignTorVals(), OBRotorList::SetRotAtoms(), and OBRotorList::SetRotAtomsByFix().

## SetDihedralAtoms() [2/2]

void SetDihedralAtoms | ( | int | ref[4] | ) |

Set the dihedral atoms.

Parameters

  ref | The dihedral atom indexes. These indexes start from 1.

## SetRotAtoms()

void SetRotAtoms | ( | std::vector< int > & | atoms | ) |

Set the atom indexes that will be displaced when this rotor changes torsion angle. These indexes start from 0 and are multiplied by 3 for easy coordinate access.

Referenced by OBRotorList::AssignTorVals(), OBRotorList::SetRotAtoms(), and OBRotorList::SetRotAtomsByFix().

## SetTorsionValues()

void SetTorsionValues | ( | std::vector< double > & | angles | ) |

inline

Set the possible torsion values or angles.

Referenced by OBRotorList::AssignTorVals().

## SetFixedBonds()

void SetFixedBonds | ( | OBBitVec & | bv | ) |

inline

Set the bonds that will be fixed.

## SetToAngle()

void SetToAngle | ( | double * | coordinates,
|  | double | setang )

inline

Rotate the atoms in the specified `coordinates` to the specified angle.

Parameters

  coordinates | The coordinates to rotate.
  setang | The new torsion angle in radians.

## SetRotor()

void SetRotor | ( | double * | coordinates,
|  | int | next,
|  | int | prev = -1 )

Rotate the atoms in the specified `coordinates`. This function does not require any precomputation and will compute all needed information when needed.

Parameters

  coordinates | The coordinates for the molecules as pointer to double.
  next | The index of the new rotor angle. This is an index for the GetTorsionValues() list.
  prev | If specified, the torsion current torsion angle can be looked up and does not have to be calculated again.

## Set() [1/3]

void Set | ( | double * | coordinates,
|  | double | sine,
|  | double | cosine,
|  | double | translation,
|  | double | invmag )

Rotate the specified `coordinates` by using the specified rotation matrix.

Referenced by Set(), SetRotor(), and SetToAngle().

## Precompute()

void Precompute | ( | double * | coordinates | ) |

Precompute the reference angle and inverse bond length of this rotor for a single conformer. This function should be used in combination with Set(double *coordinates, int idx).

Parameters

  coordinates | The coordinates to use in the computation.

OBMol mol;
...
unsigned int numCoords = mol.NumAtoms() * 3;
double *coords = mol.GetCoordinates();
OBRotor rotor;
rotor.SetBond(mol.GetBond(3));
// set the possible torsion values
std::vector<double> angles;
angles.push_back(0.0);
angles.push_back(3.1415);
rotor.SetTorsionValues(angles);
// precompute inverse bond length (i.e. the bond length of bond with index 3
// using the specified coordinates) and reference angle (i.e. torsion angle
//in coords)
rotor.Precompute(coords);
// copy coordinates to coords_1
double *coords_1 = new double[numCoords];
for (unsigned int i = 0; i < numCoords; ++i)
coords_1[i] = coords[i];
// rotate the atoms in coords_1 to angle with index 0 (i.e. 0.0 degrees)
// note: on input, the coordinates should be the same as the coordinates used
// to precompute the inverse bond length and reference angle (in other
// words, the inverse magnitude and reference angle in the specfied
// coordinates should be the same as the one used for Precompute)
rotor.Set(coords_1, 0)
// copy coordinates to coords_2
double *coords_2 = new double[numCoords];
for (unsigned int i = 0; i < numCoords; ++i)
coords_2[i] = coords[i];
// rotate the atoms in coords_2 to angle with index 1 (i.e. 180.0 degrees)
rotor.Set(coords_2, 1)
delete coords_1;
delete coords_2;
OpenBabel::OBMol
Molecule Class.
Definition mol.h:121
OpenBabel::OBMol::GetCoordinates
double * GetCoordinates()
Definition mol.h:327
OpenBabel::OBMol::NumAtoms
unsigned int NumAtoms() const
Definition mol.h:261
OpenBabel::OBMol::GetBond
OBBond * GetBond(int idx) const
Definition mol.cpp:858
OpenBabel::OBRotor::SetTorsionValues
void SetTorsionValues(std::vector< double > &angles)
Definition rotor.h:200
OpenBabel::OBRotor::OBRotor
OBRotor()
Definition rotor.cpp:492
OpenBabel::OBRotor::SetBond
void SetBond(OBBond *bond)
Definition rotor.h:164
OpenBabel::OBRotor::Precompute
void Precompute(double *coordinates)
Definition rotor.cpp:600
OpenBabel::OBRotor::Set
void Set(double *coordinates, double sine, double cosine, double translation, double invmag)
Definition rotor.cpp:696

## Set() [2/3]

void Set | ( | double * | coordinates,
|  | int | idx )

Rotate the `coordinates` to set the torsion angle of this rotor to the angle specified by the index `idx`. Make sure to call Precompute before calling this function.

Parameters

  coordinates | The coordinates to rotate.
  idx | The index of the torsion angle in the GetTorsionValues() list.

## Precalc()

void Precalc | ( | std::vector< double * > & | conformers | ) |

Precompute the inverse bond lengths, rotation matrices for all specified conformers and all possible torsion values. This method is used in combination with Set(double *coordinates, int conformer, int idx).

Parameters

  conformers | The pointers to the conformer coordinates

## Set() [3/3]

void Set | ( | double * | coordinates,
|  | int | conformer,
|  | int | idx )

inline

Rotate the `coordinates` to set the torsion to the torsion value with the specified `index`. The coordinates should be the same as the conformer used for calling Precalc (i.e. conformers[conformer] == coordinates). Make sure to call Precalc before calling this method.

Parameters

  coordinates | The conformer coordinates.
  conformer | The conformer index in the conformer list given to Precalc().
  idx | The torsion value index in the GetTorsionValues() list.

## GetBond()

OBBond * GetBond | ( |  | ) |

inline

Get the OBBond object associated with this OBRotor.

Referenced by OBRotorList::AssignTorVals(), OBRotorList::RemoveSymVals(), OBRotorList::SetEvalAtoms(), OBConformerSearch::Setup(), and OBRotamerList::Setup().

## Size()

size_t Size | ( |  | ) |

inline

Get the number of possible torsion angles for this OBRotor. This is the length of the GetTorsionValues() list.

Referenced by OBRotorList::RemoveSymVals(), and OBRotorList::Setup().

## GetIdx()

int GetIdx | ( |  | ) | const

inline

Get the index for this rotor (index in an OBRotorList).

Referenced by OBRotamerList::Setup().

## GetDihedralAtoms() [1/2]

void GetDihedralAtoms | ( | int | ref[4] | ) |

inline

Get the dihedral atom indexes. These indexes start from 1.

Referenced by OBRotorList::SetRotAtoms(), OBRotorList::SetRotAtomsByFix(), OBRotamerList::Setup(), and OBRotorList::Setup().

## GetDihedralAtoms() [2/2]

std::vector< int > & GetDihedralAtoms | ( |  | ) |

inline

Get the dihedral atom indexes. These indexes start from 1.

## GetRotAtoms() [1/2]

const std::vector< int > & GetRotAtoms | ( |  | ) | const

inline

Get the atom indexes that will be displaced when this rotor changes torsion angle. These indexes start from 1.

## GetTorsionValues()

const std::vector< double > & GetTorsionValues | ( |  | ) | const

inline

Get the possible torsion angles for this OBRotor.

## GetFixedBonds()

OBBitVec & GetFixedBonds | ( |  | ) |

inline

Get an OBBitVec objects with bits set for all bonds that are fixed. Bonds are indexed from 0.

## CalcTorsion()

double CalcTorsion | ( | double * | coordinates | ) |

Calculate the torsion for this OBRotor using the specified coordinates.

Parameters

  coordinates | The coordinates (e.g. OBMol::GetCoordinates()).

Returns
  The torsion angle in radians.

Referenced by Precalc(), Precompute(), SetRotor(), and SetToAngle().

## CalcBondLength()

double CalcBondLength | ( | double * | coordinates | ) |

Calculate the bond length for this OBRotor using the specified coordinates.

Parameters

  coordinates | The coordinates (e.g. OBMol::GetCoordinates()).

Referenced by Precalc(), Precompute(), and SetToAngle().

## BeginTorIncrement()

std::vector< double >::iterator BeginTorIncrement | ( |  | ) |

inline

## EndTorIncrement()

std::vector< double >::iterator EndTorIncrement | ( |  | ) |

inline

## RemoveSymTorsionValues()

void RemoveSymTorsionValues | ( | int | fold | ) |

Remove all torsions angles between 0 and 360/fold.

Referenced by OBRotorList::RemoveSymVals().

## SetDelta()

void SetDelta | ( | double | d | ) |

inline

Deprecated
  Has no effect.

Referenced by OBRotorList::AssignTorVals().

## GetDelta()

double GetDelta | ( |  | ) |

inline

Deprecated
  Has no effect.

## GetFixedAtoms()

OBBitVec & GetFixedAtoms | ( |  | ) |

inline

Deprecated

## SetFixedAtoms()

void SetFixedAtoms | ( | OBBitVec & | bv | ) |

inline

Deprecated
  See SetFixedBonds

## GetEvalAtoms()

OBBitVec & GetEvalAtoms | ( |  | ) |

inline

Deprecated

## SetEvalAtoms()

void SetEvalAtoms | ( | OBBitVec & | bv | ) |

inline

Deprecated

Referenced by OBRotorList::SetEvalAtoms().

## GetRotAtoms() [2/2]

void * GetRotAtoms | ( |  | ) |

inline

Deprecated

## GetResolution()

std::vector< double > & GetResolution | ( |  | ) |

inline

Deprecated
  Bad name, see GetTorsionValues()

Referenced by OBForceField::FastRotorSearch(), OBForceField::RandomRotorSearchInitialize(), OBConformerSearch::Setup(), OBRotamerList::Setup(), OBForceField::SystematicRotorSearchInitialize(), and OBForceField::WeightedRotorSearch().

## SetNumCoords()

void SetNumCoords | ( | int | nc | ) |

inline

Deprecated

Referenced by OBRotorList::FindRotors().

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

- rotor.h
- rotor.cpp