Loading...
Searching...
No Matches
OBRotorKeys Class Reference

`#include <openbabel/rotor.h>`

## Public Member Functions

| OBRotorKeys ()
void | Clear ()
unsigned int | NumKeys ()
void | AddRotor (unsigned int size)
bool | Next ()
std::vector< int > | GetKey ()

## Detailed Description

A class to generate all possible rotorKeys.

## Constructor & Destructor Documentation

## OBRotorKeys()

OBRotorKeys | ( |  | ) |

inline

A class to generate all possible rotorKeys.

This class can generate all possible rotor keys for a set of OBRotors which can all have their own resolution. Thanks to Yongjin Xu for this patch.

the code blow is taken from OBForceField::SystematicRotorSearch():

#include <openbabel/rotor.h>
#include <openbabel/mol.h>
// See OBConversion class to fill the mol object.
OBMol mol;
OBRotorList rl;
OBRotamerList rotamers;
rl.Setup(_mol);
rotamers.SetBaseCoordinateSets(_mol);
rotamers.Setup(_mol, rl);
cout << "number of rotatable bonds: " << rl.Size() << endl;
if (!rl.Size()) { // only one conformer
cout << "generated only one conformer" << endl;
// exit here
}
OBRotorKeys rotorKeys;
OBRotorIterator ri;
OBRotor *rotor = rl.BeginRotor(ri);
for (int i = 1; i < rl.Size() + 1; ++i, rotor = rl.NextRotor(ri)) { // foreach rotor
rotorKeys.AddRotor(rotor->GetResolution().size());
}
while (rotorKeys.Next()) {
std::vector<int> rotorKey = rotorKeys.GetKey();
cout << "rotorKey = " << rotorKey[1] << " " << rotorKey[2] << endl;
rotamers.AddRotamer(rotorKey);
}
rotamers.ExpandConformerList(_mol, _mol.GetConformers());
OpenBabel::OBMol
Molecule Class.
Definition mol.h:121
OpenBabel::OBRotamerList
Supports a set of rotamer coordinate sets for some number of potentially rotatable bonds.
Definition rotamer.h:36
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::Setup
void Setup(OBMol &, OBRotorList &)
Set up a rotamer list based on an already created OBRotorList.
Definition rotamer.cpp:199
OpenBabel::OBRotorKeys
A class to generate all possible rotorKeys.
Definition rotor.h:704
OpenBabel::OBRotorKeys::Next
bool Next()
Definition rotor.h:783
OpenBabel::OBRotorKeys::AddRotor
void AddRotor(unsigned int size)
Definition rotor.h:775
OpenBabel::OBRotorKeys::GetKey
std::vector< int > GetKey()
Definition rotor.h:802
OpenBabel::OBRotorList
Given an OBMol, set up a list of possibly rotatable torsions,.
Definition rotor.h:458
OpenBabel::OBRotorList::NextRotor
OBRotor * NextRotor(OBRotorIterator &i)
Definition rotor.h:597
OpenBabel::OBRotorList::BeginRotor
OBRotor * BeginRotor(OBRotorIterator &i)
Definition rotor.h:588
OpenBabel::OBRotorList::Setup
bool Setup(OBMol &mol, bool sampleRings=false)
Definition rotor.cpp:56
OpenBabel::OBRotorList::Size
size_t Size()
Definition rotor.h:487
OpenBabel::OBRotor
A single rotatable OBBond as part of rotamer searching.
Definition rotor.h:136
mol.h
Handle molecules. Declarations of OBMol, OBAtom, OBBond, OBResidue. (the main header for Open Babel).
OpenBabel::OBRotorIterator
std::vector< OBRotor * >::iterator OBRotorIterator
A standard iterator over a vector of rotors.
Definition rotor.h:451
rotor.h
Rotate torsional according to rotor rules.

Constructor

## Member Function Documentation

## Clear()

void Clear | ( |  | ) |

inline

Clear all rotors.

## NumKeys()

unsigned int NumKeys | ( |  | ) |

inline

Number of rotor keys (= number of possible conformers).

## AddRotor()

void AddRotor | ( | unsigned int | size | ) |

inline

Add a rotor

Parameters

  size | the rotor resolution

Referenced by OBForceField::SystematicRotorSearchInitialize().

## Next()

bool Next | ( |  | ) |

inline

Select the next rotor key

Returns
  true if there are more rotor keys

Referenced by NumKeys(), and OBForceField::SystematicRotorSearchInitialize().

## GetKey()

std::vector< int > GetKey | ( |  | ) |

inline

Get the currently selected rotor key

Returns
  current rotor key

Referenced by OBForceField::SystematicRotorSearchInitialize().

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

- rotor.h