Open Babel  3.0
rotamer.h
Go to the documentation of this file.
1 /**********************************************************************
2 rotamer.h - Handle rotamer list data.
3 
4 Copyright (C) 1998-2000 by OpenEye Scientific Software, Inc.
5 Some portions Copyright (C) 2001-2006 by Geoffrey R. Hutchison
6 
7 This file is part of the Open Babel project.
8 For more information, see <http://openbabel.org/>
9 
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation version 2 of the License.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 ***********************************************************************/
19 
20 #ifndef OB_ROTAMER_H
21 #define OB_ROTAMER_H
22 
23 #include <vector>
24 #include <map>
25 
26 #include <openbabel/rotor.h>
27 #include <openbabel/generic.h>
28 
29 namespace OpenBabel
30 {
31  class OBMol;
32 
34  // Further class introduction in rotamer.cpp
35  class OBAPI OBRotamerList : public OBGenericData
36  {
38  unsigned int _NBaseCoords;
40  std::vector<double*> _c;
42  std::vector<std::pair<OBAtom**,std::vector<int> > > _vrotor;
45  std::vector<std::vector<double> > _vres;
47  std::vector<unsigned char*> _vrotamer;
49  std::vector<std::vector<int> > _vrings;
51  std::vector<std::vector<double> > _vringTors;
52 
53  public:
55  {
56  _NBaseCoords=0;
58  _attr="RotamerList";
59  }
60  virtual OBGenericData* Clone(OBBase* parent) const;
61 
62  ~OBRotamerList();
64  void Setup(OBMol&,OBRotorList&);
69  void Setup(OBMol &mol,unsigned char*ref,int nrotors);
71  unsigned int NumRotors() const
72  {
73  return (unsigned int)_vrotor.size();
74  }
76  unsigned int NumRotamers() const
77  {
78  return (unsigned int)_vrotamer.size();
79  }
81  void AddRotamer(double*);
83  void AddRotamer(int *key);
85  void AddRotamer(std::vector<int> key);
87  void AddRotamer(unsigned char *key);
89  void AddRotamers(unsigned char *arr,int nconf);
91  void GetReferenceArray(unsigned char*) const;
92 
94 
95  std::vector<unsigned char*>::iterator BeginRotamer()
96  {
97  return _vrotamer.begin();
98  }
99  std::vector<unsigned char*>::iterator EndRotamer()
100  {
101  return _vrotamer.end();
102  }
104 
107  std::vector<double*> CreateConformerList(OBMol& mol);
108 
111  void ExpandConformerList(OBMol&mol,std::vector<double*>& confs);
112 
113  bool SetCurrentCoordinates(OBMol &mol, std::vector<int> arr);
114 
117  void SetBaseCoordinateSets(OBMol& mol);
118 
120 
123  void SetBaseCoordinateSets(std::vector<double*> bc, unsigned int N);
124 
126  unsigned int NumBaseCoordinateSets() const
127  {
128  return static_cast<unsigned int> (_c.size());
129  }
130 
132  double *GetBaseCoordinateSet(unsigned int i) const
133  {
134  return (i<_c.size()) ? _c[i] : NULL;
135  }
136 
138  unsigned int NumAtoms() const
139  {
140  return _NBaseCoords;
141  }
142  };
143 
145  int Swab(int);
146 
147 }
148 
149 #endif // OB_ROTAMER_H
150 
Base class for generic data.
Definition: base.h:188
Supports a set of rotamer coordinate sets for some number of potentially rotatable bonds...
Definition: rotamer.h:35
unsigned int NumBaseCoordinateSets() const
Definition: rotamer.h:126
OBRotamerList()
Definition: rotamer.h:54
int Swab(int)
Swap Byte instruction (i.e., handle transfers between endian forms)
Definition: rotamer.cpp:104
Rotate torsional according to rotor rules.
Given an OBMol, set up a list of possibly rotatable torsions,.
Definition: rotor.h:457
Information for generating & manipulating rotamers, i.e. OBRotamerList.
Definition: base.h:85
Molecule Class.
Definition: mol.h:118
unsigned int NumRotors() const
Definition: rotamer.h:71
std::vector< unsigned char * >::iterator EndRotamer()
Definition: rotamer.h:99
double * GetBaseCoordinateSet(unsigned int i) const
Get a pointer to a specific base pointer (i.e., specific conformer)
Definition: rotamer.h:132
std::vector< unsigned char * >::iterator BeginRotamer()
Definition: rotamer.h:95
unsigned int NumAtoms() const
Definition: rotamer.h:138
Handle generic data classes. Custom data for atoms, bonds, etc.
Base Class.
Definition: base.h:239
unsigned int NumRotamers() const
Definition: rotamer.h:76
Global namespace for all Open Babel code.
Definition: alias.h:22