29 # define UNUSED(x) UNUSED_ ## x __attribute__((unused)) 30 #elif defined(__LCLINT__) 41 #define SQUARE(x) ((x)*(x)) 57 std::vector<double> _vals;
60 OBRotorRule(
char *buffer,
int ref[4],std::vector<double> &vals,
double d):
61 _delta(d), _s(buffer), _vals(vals)
65 memcpy(_ref,ref,
sizeof(
int)*4);
104 std::vector<OBRotorRule*> _vr;
105 std::vector<double> _sp3sp3;
106 std::vector<double> _sp3sp2;
107 std::vector<double> _sp2sp2;
112 void ParseLine(
const char*);
125 void GetRotorIncrements(
OBMol& mol,
OBBond* bond,
int refs[4],
126 std::vector<double> &vals,
double &delta);
138 std::vector<int> _rotatoms;
139 double _imag, _refang;
141 std::vector<int> _ref, _torsion;
142 OBBitVec _fixedatoms,_fixedbonds, _evalatoms;
143 std::vector<double> _torsionAngles;
144 std::vector<double> _invmag;
145 std::vector<std::vector<double> > _sn,_cs,_t;
146 std::vector<OBRing *> _rings;
185 void SetDihedralAtoms(std::vector<int> &ref);
190 void SetDihedralAtoms(
int ref[4]);
196 void SetRotAtoms(std::vector<int> &atoms);
202 _torsionAngles = angles;
222 double sn,cs,t,ang,mag;
224 ang = setang - CalcTorsion(coordinates);
226 if (fabs(ang) < 1e-5)
230 mag = CalcBondLength(coordinates);
237 Set(coordinates, sn, cs, t, 1.0 / mag);
249 void SetRotor(
double *coordinates,
int next,
int prev = -1);
254 void Set(
double *coordinates,
double sine,
double cosine,
double translation,
double invmag);
303 void Precompute(
double *coordinates);
311 void Set(
double *coordinates,
int idx);
318 void Precalc(std::vector<double*> &conformers);
328 void Set(
double *coordinates,
int conformer,
int idx)
330 Set(coordinates, _sn[conformer][idx], _cs[conformer][idx], _t[conformer][idx], _invmag[conformer]);
350 return _torsionAngles.size();
364 for (
int i = 0; i < 4; ++i)
387 return _torsionAngles;
402 double CalcTorsion(
double *coordinates);
407 double CalcBondLength(
double *coordinates);
415 return _torsionAngles.begin();
419 return _torsionAngles.end();
423 void RemoveSymTorsionValues(
int);
464 std::vector<int> _dffv;
465 std::vector<OBRotor*> _rotor;
466 std::vector<std::pair<OBSmartsPattern*,std::pair<int,int> > > _vsym2;
469 std::vector<std::pair<OBSmartsPattern*,std::pair<int,int> > > _vsym3;
489 return _rotor.size();
497 bool IsFixedBond(
OBBond*);
508 void RemoveSymVals(
OBMol&);
515 {
return _ringRotors; }
525 bool Setup(
OBMol &mol,
bool sampleRings =
false);
553 bool SetRotAtoms(
OBMol&);
566 bool FindRotors(
OBMol &mol,
bool sampleRingBonds =
false);
570 bool SetEvalAtoms(
OBMol&);
579 bool AssignTorVals(
OBMol &);
591 return((i ==_rotor.end()) ? NULL:*i);
600 return((i ==_rotor.end()) ? NULL:*i);
632 return(!_fixedatoms.
IsEmpty());
640 void SetRotAtomsByFix(
OBMol&);
648 rotor_digit(
unsigned int rs)
650 resolution_size = rs;
660 void set_size(
unsigned int rs)
662 resolution_size = rs;
666 void set_state(
int st)
678 return resolution_size;
683 if (state < static_cast<int>(resolution_size - 1)) {
692 unsigned int resolution_size;
695 }
typedef rotor_digit;
765 unsigned int numKeys = 0;
777 rotor_digit rd(size);
788 bool carry = _vr[0].next();
794 carry = _vr[i].next();
807 for(
unsigned int i = 0; i < _vr.size(); i++){
808 rt.push_back(_vr[i].get_state());
815 std::vector<rotor_digit> _vr;
OBSmartsPattern * GetSmartsPattern()
Definition: rotor.h:92
void Clear()
Clear all rotors.
Definition: rotor.h:758
bool HasFixedAtoms()
Definition: rotor.h:630
void SetBond(OBBond *bond)
Definition: rotor.h:164
void GetReferenceAtoms(int ref[4])
Definition: rotor.h:82
bool Next()
Definition: rotor.h:783
void SetFixAtoms(OBBitVec &fix)
Definition: rotor.h:621
void Set(double *coordinates, int conformer, int idx)
Definition: rotor.h:328
size_t GetSize()
Definition: rotor.h:114
size_t Size()
Definition: rotor.h:348
bool IsValid() const
Definition: parsmart.h:229
void SetIdx(int idx)
Definition: rotor.h:177
~OBRotor()
Definition: rotor.h:155
void IgnoreSymmetryRemoval()
Definition: rotor.h:636
OBBitVec & GetFixedBonds()
Definition: rotor.h:393
void SetFixedAtoms(OBBitVec &bv)
Definition: rotor.h:434
bool HasFixedBonds()
Definition: rotor.h:501
Bond class.
Definition: bond.h:58
Given an OBMol, set up a list of possibly rotatable torsions,.
Definition: rotor.h:457
Molecule Class.
Definition: mol.h:118
std::vector< int > & GetDihedralAtoms()
Definition: rotor.h:370
void GetDihedralAtoms(int ref[4])
Definition: rotor.h:362
void SetEvalAtoms(OBBitVec &bv)
Definition: rotor.h:438
bool IsValid()
Definition: rotor.h:78
Database of default hybridization torsional rules and SMARTS-defined OBRotorRule objects.
Definition: rotor.h:101
OBBitVec & GetFixedAtoms()
Definition: rotor.h:432
std::vector< double > & GetResolution()
Definition: rotor.h:442
double GetDelta()
Definition: rotor.h:86
void SetDelta(double d)
Set the resolution (delta) of a torsional step in degrees.
Definition: rotor.h:84
void SetDelta(double d)
Definition: rotor.h:428
OBRotor * NextRotor(OBRotorIterator &i)
Definition: rotor.h:597
A speed-optimized vector of bits.
Definition: bitvec.h:57
OBRotorRule(char *buffer, int ref[4], std::vector< double > &vals, double d)
Definition: rotor.h:60
void SetQuiet()
Definition: rotor.h:545
size_t Size()
Definition: rotor.h:487
OBRotorKeys()
A class to generate all possible rotorKeys.
Definition: rotor.h:752
std::vector< double >::iterator BeginTorIncrement()
Definition: rotor.h:413
void Init(std::string &fname)
Definition: rotor.h:537
SMARTS (SMiles ARbitrary Target Specification) substructure searching.
Definition: parsmart.h:154
OBRotor * BeginRotor(OBRotorIterator &i)
Definition: rotor.h:588
std::vector< int > GetKey()
Definition: rotor.h:802
void AddRotor(unsigned int size)
Definition: rotor.h:775
A class to generate all possible rotorKeys.
Definition: rotor.h:703
bool IdentifyEvalAtoms(OBMol &mol)
Definition: rotor.h:616
void SetFixedBonds(OBBitVec &bv)
Definition: rotor.h:207
void * GetRotAtoms()
Definition: rotor.h:440
unsigned int NumKeys()
Number of rotor keys (= number of possible conformers)
Definition: rotor.h:763
Open Babel atom and aromaticity typer.
void SetTorsionValues(std::vector< double > &angles)
Definition: rotor.h:200
double GetDelta()
Definition: rotor.h:430
std::string & GetSmartsString()
Definition: rotor.h:90
void SetToAngle(double *coordinates, double setang)
Definition: rotor.h:220
A single rotatable OBBond as part of rotamer searching.
Definition: rotor.h:135
void Quiet()
Turn off debugging output from GetRotorIncrements()
Definition: rotor.h:128
A rule for torsional conformer searching, defined by a SMARTS pattern.
Definition: rotor.h:51
void SetNumCoords(int nc)
Definition: rotor.h:444
int GetIdx() const
Definition: rotor.h:355
void Clear()
Set all bits to zero.
Definition: bitvec.cpp:381
bool HasRingRotors()
Definition: rotor.h:514
bool IsEmpty() const
Are there no bits set to 1 in this vector?
Definition: bitvec.cpp:297
const std::vector< double > & GetTorsionValues() const
Definition: rotor.h:385
std::vector< OBRotor * >::iterator OBRotorIterator
A standard iterator over a vector of rotors.
Definition: rotor.h:451
OBBitVec & GetEvalAtoms()
Definition: rotor.h:436
std::vector< double > & GetTorsionVals()
Definition: rotor.h:88
Fast and efficient bitstring class.
const std::vector< int > & GetRotAtoms() const
Definition: rotor.h:378
bool Init(const char *pattern)
Definition: parsmart.cpp:1712
OBRotorIterator BeginRotors()
Definition: rotor.h:605
void SetFixedBonds(OBBitVec &fix)
Definition: rotor.h:529
std::vector< double >::iterator EndTorIncrement()
Definition: rotor.h:417
void SetFilename(std::string &s)
Set the filename to be used for the database. Default = torlib.txt.
Definition: rotor.h:117
Base data table class, handles reading data files.
Definition: data.h:48
OBRotorIterator EndRotors()
Definition: rotor.h:609
Global namespace for all Open Babel code.
Definition: alias.h:22
void Init()
Read in the data file, falling back as needed.
Definition: data.cpp:666
~OBRotorRule()
Definition: rotor.h:68
OBBond * GetBond()
Definition: rotor.h:340