Loading...
Searching...
No Matches
mol.h
Go to the documentation of this file.
/**********************************************************************
mol.h - Handle molecules. Declarations of OBMol, OBAtom, OBBond, OBResidue.
(the main header for Open Babel)
Copyright (C) 1998-2001 by OpenEye Scientific Software, Inc.
Some portions Copyright (C) 2001-2006 by Geoffrey R. Hutchison
Some portions Copyright (C) 2003 by Michael Banck
This file is part of the Open Babel project.
For more information, see <http://openbabel.org/>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
***********************************************************************/
#ifndef OB_MOL_H
#define OB_MOL_H
#include <openbabel/babelconfig.h>
#ifndef OB_EXTERN
# define OB_EXTERN extern
#endif
#ifndef THREAD_LOCAL
#ifdef SWIG
# define THREAD_LOCAL
# elif (__cplusplus >= 201103L)
//this is required for correct multi-threading
# define THREAD_LOCAL thread_local
# else
# define THREAD_LOCAL
# endif
#endif
#include <math.h>
#include <float.h>
#include <vector>
#include <string>
#include <map>
#include <openbabel/base.h>
namespace OpenBabel
{
class OBAtom;
class OBBond;
class OBResidue;
class OBRing;
class OBInternalCoord;
class OBConversion; //used only as a pointer
class vector3;
class OBBitVec;
class OBMolAtomDFSIter;
class OBChainsParser;
typedef std::vector<OBAtom*>::iterator OBAtomIterator;
typedef std::vector<OBBond*>::iterator OBBondIterator;
typedef std::vector<OBResidue*>::iterator OBResidueIterator;
// Class OBMol
//MOL Property Macros (flags) -- 32+ bits
#define OB_SSSR_MOL (1<<1)
#define OB_RINGFLAGS_MOL (1<<2)
#define OB_AROMATIC_MOL (1<<3)
#define OB_ATOMTYPES_MOL (1<<4)
#define OB_CHIRALITY_MOL (1<<5)
#define OB_PCHARGE_MOL (1<<6)
#define OB_HYBRID_MOL (1<<8)
#define OB_CLOSURE_MOL (1<<11)
#define OB_H_ADDED_MOL (1<<12)
#define OB_PH_CORRECTED_MOL (1<<13)
#define OB_CHAINS_MOL (1<<15)
#define OB_TCHARGE_MOL (1<<16)
#define OB_TSPIN_MOL (1<<17)
#define OB_RINGTYPES_MOL (1<<18)
#define OB_PATTERN_STRUCTURE (1<<19)
#define OB_LSSR_MOL (1<<20)
#define OB_ATOMSPIN_MOL (1<<21)
#define OB_REACTION_MOL (1<<22)
#define OB_PERIODIC_MOL (1<<23)
// flags 24-32 unspecified
#define SET_OR_UNSET_FLAG(X) \
if (value) SetFlag(X); \
else UnsetFlag(X);
#define OB_CURRENT_CONFORMER -1
enum HydrogenType { AllHydrogen, PolarHydrogen, NonPolarHydrogen };
// class introduction in mol.cpp
class OBAPI OBMol: public OBBase
{
protected:
int _flags;
bool _autoPartialCharge;
bool _autoFormalCharge;
std::string _title;
std::vector<OBAtom*> _vatom;
std::vector<OBAtom*> _atomIds;
std::vector<OBBond*> _vbond;
std::vector<OBBond*> _bondIds;
unsigned short int _dimension;
int _totalCharge;
unsigned int _totalSpin;
double *_c;
std::vector<double*> _vconf;
double _energy;
unsigned int _natoms;
unsigned int _nbonds;
std::vector<OBResidue*> _residue;
std::vector<OBInternalCoord*> _internals;
unsigned short int _mod;
public:
OBMol();
OBMol(const OBMol &);
virtual ~OBMol();
OBMol &operator=(const OBMol &mol);
OBMol &operator+=(const OBMol &mol);
void ReserveAtoms(int natoms)
{
if (natoms > 0 && _mod) {
_vatom.reserve(natoms);
_atomIds.reserve(natoms);
}
}
virtual void DestroyAtom(OBAtom*);
virtual void DestroyBond(OBBond*);
virtual void DestroyResidue(OBResidue*);
bool AddAtom(OBAtom& atom, bool forceNewId = false);
bool InsertAtom(OBAtom &);
bool AddBond(int beginIdx, int endIdx, int order,
int flags=0,int insertpos=-1);
bool AddBond(OBBond&);
bool AddResidue(OBResidue&);
OBAtom *NewAtom();
OBAtom *NewAtom(unsigned long id);
OBBond *NewBond();
OBBond *NewBond(unsigned long id);
OBResidue *NewResidue();
bool DeleteAtom(OBAtom*, bool destroyAtom = true);
bool DeleteBond(OBBond*, bool destroyBond = true);
bool DeleteResidue(OBResidue*, bool destroyResidue = true);
virtual void BeginModify(void);
virtual void EndModify(bool nukePerceivedData=true);
int GetMod() { return(_mod); }
void IncrementMod() { _mod++; }
void DecrementMod() { _mod--; }
int GetFlags() { return(_flags); }
const char *GetTitle(bool replaceNewlines = true) const;
unsigned int NumAtoms() const { return(_natoms); }
unsigned int NumBonds() const { return(_nbonds); }
unsigned int NumHvyAtoms();
unsigned int NumResidues() const { return(static_cast<unsigned int> (_residue.size())); }
unsigned int NumRotors(bool sampleRingBonds=false);
OBAtom *GetAtom(int idx) const;
OBAtom *GetAtomById(unsigned long id) const;
OBAtom *GetFirstAtom() const;
OBBond *GetBond(int idx) const;
OBBond *GetBondById(unsigned long id) const;
OBBond *GetBond(int a, int b) const;
// The safer version of the above method
OBBond *GetBond(OBAtom* bgn, OBAtom* end) const;
OBResidue *GetResidue(int idx) const;
std::vector<OBInternalCoord*> GetInternalCoord();
double GetTorsion(int,int,int,int);
double GetTorsion(OBAtom* a,OBAtom* b,OBAtom* c,OBAtom* d);
double GetAngle(OBAtom* a, OBAtom* b, OBAtom* c);
int AreInSameRing(OBAtom *a, OBAtom *b);
std::string GetFormula();
std::string GetSpacedFormula(int ones=0, const char* sp=" ", bool implicitH = true);
double GetEnergy() const { return _energy; }
double GetMolWt(bool implicitH = true);
double GetExactMass(bool implicitH = true);
int GetTotalCharge();
unsigned int GetTotalSpinMultiplicity();
unsigned short int GetDimension() const { return _dimension; }
double *GetCoordinates() { return(_c); }
std::vector<OBRing*> &GetSSSR();
std::vector<OBRing*> &GetLSSR();
bool AutomaticFormalCharge() { return(_autoFormalCharge); }
bool AutomaticPartialCharge() { return(_autoPartialCharge); }
void SetTitle(const char *title);
void SetTitle(std::string &title);
void SetFormula(std::string molFormula);
void SetEnergy(double energy) { _energy = energy; }
void SetDimension(unsigned short int d) { _dimension = d; }
void SetTotalCharge(int charge);
void SetTotalSpinMultiplicity(unsigned int spinMultiplicity);
void SetInternalCoord(std::vector<OBInternalCoord*> int_coord);
void SetAutomaticFormalCharge(bool val)
{ _autoFormalCharge=val; }
void SetAutomaticPartialCharge(bool val)
{ _autoPartialCharge=val; }
void SetAromaticPerceived(bool value = true) { SET_OR_UNSET_FLAG(OB_AROMATIC_MOL); }
void SetSSSRPerceived(bool value = true) { SET_OR_UNSET_FLAG(OB_SSSR_MOL); }
void SetLSSRPerceived(bool value = true) { SET_OR_UNSET_FLAG(OB_LSSR_MOL); }
void SetRingAtomsAndBondsPerceived(bool value = true) { SET_OR_UNSET_FLAG(OB_RINGFLAGS_MOL); }
void SetAtomTypesPerceived(bool value = true) { SET_OR_UNSET_FLAG(OB_ATOMTYPES_MOL); }
void SetRingTypesPerceived(bool value = true) { SET_OR_UNSET_FLAG(OB_RINGTYPES_MOL); }
void SetChainsPerceived(bool value = true) { SET_OR_UNSET_FLAG(OB_CHAINS_MOL); }
void SetChiralityPerceived(bool value = true) { SET_OR_UNSET_FLAG(OB_CHIRALITY_MOL); }
void SetPartialChargesPerceived(bool value = true) { SET_OR_UNSET_FLAG(OB_PCHARGE_MOL); }
void SetHybridizationPerceived(bool value = true) { SET_OR_UNSET_FLAG(OB_HYBRID_MOL); }
void SetClosureBondsPerceived(bool value = true) { SET_OR_UNSET_FLAG(OB_CLOSURE_MOL); }
void SetHydrogensAdded(bool value = true) { SET_OR_UNSET_FLAG(OB_H_ADDED_MOL); }
void SetCorrectedForPH(bool value = true) { SET_OR_UNSET_FLAG(OB_PH_CORRECTED_MOL); }
void SetSpinMultiplicityAssigned(bool value = true) { SET_OR_UNSET_FLAG(OB_ATOMSPIN_MOL); }
void SetIsPatternStructure(bool value = true) { SET_OR_UNSET_FLAG(OB_PATTERN_STRUCTURE); }
void SetIsReaction(bool value = true) { SET_OR_UNSET_FLAG(OB_REACTION_MOL); }
void SetPeriodicMol(bool value = true){ SET_OR_UNSET_FLAG(OB_PERIODIC_MOL); }
bool HasFlag(int flag) { return (_flags & flag) ? true : false; }
void SetFlag(int flag) { _flags |= flag; }
void UnsetFlag(int flag) { _flags &= (~(flag)); }
void SetFlags(int flags) { _flags = flags; }
// Description in transform.cpp (command-line transformations to this molecule)
virtual OBBase* DoTransformations(const std::map<std::string,std::string>* pOptions,OBConversion* pConv);
// Ditto (documentation on transformation options)
static const char* ClassDescription();
bool Clear();
void RenumberAtoms(std::vector<OBAtom*>&);
void RenumberAtoms(std::vector<int>);
void SetCoordinates(double *c);
void ToInertialFrame(int conf, double *rmat);
void ToInertialFrame();
void Translate(const vector3 &v);
void Translate(const vector3 &v, int conf);
void Rotate(const double u[3][3]);
void Rotate(const double m[9]);
void Rotate(const double m[9],int nconf);
void Center();
bool DeleteHydrogens();
bool DeleteHydrogens(OBAtom*);
bool DeletePolarHydrogens();
bool DeleteNonPolarHydrogens();
bool DeleteHydrogen(OBAtom*);
bool AddHydrogens(bool polaronly=false,bool correctForPH=false, double pH=7.4);
bool AddHydrogens(OBAtom*);
bool AddPolarHydrogens();
bool AddNonPolarHydrogens();
bool AddNewHydrogens(HydrogenType whichHydrogen, bool correctForPH=false, double pH=7.4);
bool StripSalts(unsigned int threshold=0);
std::vector<OBMol> Separate(int StartIndex=1);
bool GetNextFragment( OpenBabel::OBMolAtomDFSIter& iter, OBMol& newMol );
// docs in mol.cpp
bool CopySubstructure(OBMol& newmol, OBBitVec *includeatoms, OBBitVec *excludebonds = (OBBitVec*)nullptr,
unsigned int correctvalence=1,
std::vector<unsigned int> *atomorder=(std::vector<unsigned int>*)nullptr,
std::vector<unsigned int> *bondorder=(std::vector<unsigned int>*)nullptr);
bool ConvertDativeBonds();
bool MakeDativeBonds();
bool ConvertZeroBonds();
bool CorrectForPH(double pH=7.4);
// docs in mol.cpp
bool AssignSpinMultiplicity(bool NoImplicitH=false);
bool AssignTotalChargeToAtoms(int charge);
vector3 Center(int nconf);
void SetTorsion(OBAtom*,OBAtom*,OBAtom*,OBAtom*,double ang);
void FindSSSR();
void FindLSSR();
void FindRingAtomsAndBonds();
// documented in mol.cpp -- locates all atom indexes which can reach 'end'
void FindChildren(std::vector<int> & children,int bgnIdx,int endIdx);
// documented in mol.cpp -- locates all atoms which can reach 'end'
void FindChildren(std::vector<OBAtom*>& children,OBAtom* bgn,OBAtom* end);
void FindLargestFragment(OBBitVec &frag);
void ContigFragList(std::vector<std::vector<int> >&);
void Align(OBAtom*,OBAtom*,vector3&,vector3&);
void ConnectTheDots();
void PerceiveBondOrders();
void FindAngles();
void FindTorsions();
// documented in mol.cpp: graph-theoretical distance for each atom
bool GetGTDVector(std::vector<int> &);
// documented in mol.cpp: graph-invariant index for each atom
void GetGIVector(std::vector<unsigned int> &);
// documented in mol.cpp: calculate symmetry-unique identifiers
void GetGIDVector(std::vector<unsigned int> &);
bool Has2D(bool Not3D=false);
bool Has3D();
bool HasNonZeroCoords();
bool HasAromaticPerceived() { return(HasFlag(OB_AROMATIC_MOL)); }
bool HasSSSRPerceived() { return(HasFlag(OB_SSSR_MOL)); }
bool HasLSSRPerceived() { return(HasFlag(OB_LSSR_MOL)); }
bool HasRingAtomsAndBondsPerceived(){return(HasFlag(OB_RINGFLAGS_MOL));}
bool HasAtomTypesPerceived() { return(HasFlag(OB_ATOMTYPES_MOL));}
bool HasRingTypesPerceived() { return(HasFlag(OB_RINGTYPES_MOL));}
bool HasChiralityPerceived() { return(HasFlag(OB_CHIRALITY_MOL));}
bool HasPartialChargesPerceived() { return(HasFlag(OB_PCHARGE_MOL));}
bool HasHybridizationPerceived() { return(HasFlag(OB_HYBRID_MOL)); }
bool HasClosureBondsPerceived() { return(HasFlag(OB_CLOSURE_MOL)); }
bool HasChainsPerceived() { return(HasFlag(OB_CHAINS_MOL)); }
bool HasHydrogensAdded() { return(HasFlag(OB_H_ADDED_MOL)); }
bool IsCorrectedForPH() { return(HasFlag(OB_PH_CORRECTED_MOL)); }
bool HasSpinMultiplicityAssigned() { return(HasFlag(OB_ATOMSPIN_MOL)); }
bool IsReaction() { return HasFlag(OB_REACTION_MOL); }
bool IsPeriodic() { return(HasFlag(OB_PERIODIC_MOL)); }
bool Empty() { return(_natoms == 0); }
int NumConformers() { return((_vconf.empty())?0:static_cast<int> (_vconf.size())); }
void SetConformers(std::vector<double*> &v);
void AddConformer(double *f) { _vconf.push_back(f); }
void SetConformer(unsigned int i);
void CopyConformer(double* c,int nconf);
void DeleteConformer(int nconf);
double *GetConformer(int i) { return(_vconf[i]); }
void SetEnergies(std::vector<double> &energies);
std::vector<double> GetEnergies();
double GetEnergy(int ci);
double *BeginConformer(std::vector<double*>::iterator&i)
{ i = _vconf.begin();
return((i == _vconf.end()) ? nullptr:*i); }
double *NextConformer(std::vector<double*>::iterator&i)
{ ++i;
return((i == _vconf.end()) ? nullptr:*i); }
std::vector<double*> &GetConformers() { return(_vconf); }
OBAtomIterator BeginAtoms() { return _vatom.begin(); }
OBAtomIterator EndAtoms() { return _vatom.begin() + NumAtoms() ; }
OBBondIterator BeginBonds() { return _vbond.begin(); }
OBBondIterator EndBonds() { return _vbond.begin() + NumBonds() ; }
OBResidueIterator BeginResidues() { return _residue.begin(); }
OBResidueIterator EndResidues() { return _residue.end(); }
OBAtom *BeginAtom(OBAtomIterator &i);
OBAtom *NextAtom(OBAtomIterator &i);
OBBond *BeginBond(OBBondIterator &i);
OBBond *NextBond(OBBondIterator &i);
OBResidue *BeginResidue(OBResidueIterator &i)
{
i = _residue.begin();
return((i == _residue.end()) ? nullptr:*i);
}
OBResidue *NextResidue(OBResidueIterator &i)
{
++i;
return((i == _residue.end()) ? nullptr:*i);
}
OBInternalCoord *BeginInternalCoord(std::vector<OBInternalCoord*>::iterator &i)
{
i = _internals.begin();
return((i == _internals.end()) ? nullptr:*i);
}
OBInternalCoord *NextInternalCoord(std::vector<OBInternalCoord*>::iterator &i)
{
++i;
return((i == _internals.end()) ? nullptr:*i);
}
};
// Utility function prototypes
//tokenize and Trim declarations moved to base.h
// Deprecated -- use OBMessageHandler class instead (docs in obutil.cpp)
OBAPI void ThrowError(char *str);
// Deprecated -- use OBMessageHandler class instead (docs in obutil.cpp)
OBAPI void ThrowError(std::string &str);
OBAPI void CartesianToInternal(std::vector<OBInternalCoord*>&,OBMol&);
OBAPI void InternalToCartesian(std::vector<OBInternalCoord*>&,OBMol&);
// Replace the last extension in str with a new one (docs in obutil.cpp)
OBAPI std::string NewExtension(std::string&,char*);
namespace detail {
template<typename T, int size = sizeof(T)>
struct max_value
{
static const T result = (static_cast<T>(0xFF) << (size-1)*8) + max_value<T, size-1>::result;
};
template<typename T>
struct max_value<T, 0>
{
static const T result = 0;
};
}
// No unique id
static const unsigned long NoId = detail::max_value<unsigned long>::result;
//Utility Macros
#ifndef BUFF_SIZE
#define BUFF_SIZE 32768
#endif
#ifndef EQ
#define EQ(a,b) (!strcmp((a), (b)))
#endif
#ifndef EQn
#define EQn(a,b,n) (!strncmp((a), (b), (n)))
#endif
#ifndef SQUARE
#define SQUARE(x) ((x)*(x))
#endif
#ifndef IsUnsatType
#define IsUnsatType(x) (EQ(x,"Car") || EQ(x,"C2") || EQ(x,"Sox") || EQ(x,"Sac") || EQ(x,"Pac") || EQ(x,"So2"))
#endif
#ifndef __KCC
extern "C"
{
OBAPI void get_rmat(double*,double*,double*,int);
OBAPI void ob_make_rmat(double mat[3][3],double rmat[9]);
OBAPI void qtrfit (double *r,double *f,int size,double u[3][3]);
OBAPI double superimpose(double*,double*,int);
}
#else
OBAPI void get_rmat(double*,double*,double*,int);
OBAPI void ob_make_rmat(double mat[3][3],double rmat[9]);
OBAPI void qtrfit (double *r,double *f,int size,double u[3][3]);
OBAPI double superimpose(double*,double*,int);
#endif // __KCC
// extern OBMol* (*CreateMolecule) (void);
} // end namespace OpenBabel
#endif // OB_MOL_H
SET_OR_UNSET_FLAG
#define SET_OR_UNSET_FLAG(X)
Definition atom.h:64
base.h
Base classes to build a graph.
OpenBabel::OBAtom
Atom class.
Definition atom.h:72
OpenBabel::OBBase
Base Class.
Definition base.h:240
OpenBabel::OBBitVec
A speed-optimized vector of bits.
Definition bitvec.h:58
OpenBabel::OBBond
Bond class.
Definition bond.h:59
OpenBabel::OBConversion
Class to convert from one format to another.
Definition obconversion.h:60
OpenBabel::OBInternalCoord
Used to transform from z-matrix to cartesian coordinates.
Definition internalcoord.h:62
OpenBabel::OBMolAtomDFSIter
Iterate over all atoms in an OBMol in a depth-first search (DFS).
Definition obiter.h:67
OpenBabel::OBMol
Molecule Class.
Definition mol.h:121
OpenBabel::OBMol::HasRingAtomsAndBondsPerceived
bool HasRingAtomsAndBondsPerceived()
Have ring atoms and bonds been assigned?
Definition mol.h:574
OpenBabel::OBMol::GetCoordinates
double * GetCoordinates()
Definition mol.h:327
OpenBabel::OBMol::HasAtomTypesPerceived
bool HasAtomTypesPerceived()
Have atom types been assigned by OBAtomTyper?
Definition mol.h:576
OpenBabel::OBMol::_title
std::string _title
Molecule title.
Definition mol.h:126
OpenBabel::OBMol::NumAtoms
unsigned int NumAtoms() const
Definition mol.h:261
OpenBabel::OBMol::Empty
bool Empty()
Are there any atoms in this molecule?
Definition mol.h:601
OpenBabel::OBMol::SetAutomaticFormalCharge
void SetAutomaticFormalCharge(bool val)
Set the flag for determining automatic formal charges with pH (default=true).
Definition mol.h:363
OpenBabel::OBMol::SetHybridizationPerceived
void SetHybridizationPerceived(bool value=true)
Mark that hybridization of all atoms has been assigned.
Definition mol.h:388
OpenBabel::OBMol::_nbonds
unsigned int _nbonds
Number of bonds.
Definition mol.h:138
OpenBabel::OBMol::BeginResidues
OBResidueIterator BeginResidues()
Definition mol.h:654
OpenBabel::OBMol::_natoms
unsigned int _natoms
Number of atoms.
Definition mol.h:137
OpenBabel::OBMol::HasLSSRPerceived
bool HasLSSRPerceived()
Has the largest set of smallest rings (FindLSSR) been performed?
Definition mol.h:572
OpenBabel::OBMol::NumConformers
int NumConformers()
Definition mol.h:607
OpenBabel::OBMol::HasChiralityPerceived
bool HasChiralityPerceived()
Has atom chirality been assigned?
Definition mol.h:580
OpenBabel::OBMol::HasFlag
bool HasFlag(int flag)
Definition mol.h:402
OpenBabel::OBMol::_vbond
std::vector< OBBond * > _vbond
vector of bonds
Definition mol.h:129
OpenBabel::OBMol::SetRingAtomsAndBondsPerceived
void SetRingAtomsAndBondsPerceived(bool value=true)
Mark that rings have been perceived (see OBRing class for details).
Definition mol.h:376
OpenBabel::OBMol::operator+=
OBMol & operator+=(const OBMol &mol)
Copies atoms and bonds but not OBGenericData.
Definition mol.cpp:1349
OpenBabel::OBMol::UnsetFlag
void UnsetFlag(int flag)
Definition mol.h:404
OpenBabel::OBMol::GetConformer
double * GetConformer(int i)
Definition mol.h:621
OpenBabel::OBMol::IsPeriodic
bool IsPeriodic()
Is this molecule periodic? Should periodic boundary conditions be applied?
Definition mol.h:598
OpenBabel::OBMol::SetSpinMultiplicityAssigned
void SetSpinMultiplicityAssigned(bool value=true)
Definition mol.h:395
OpenBabel::OBMol::BeginInternalCoord
OBInternalCoord * BeginInternalCoord(std::vector< OBInternalCoord * >::iterator &i)
Definition mol.h:687
OpenBabel::OBMol::HasSpinMultiplicityAssigned
bool HasSpinMultiplicityAssigned()
Has total spin multiplicity been assigned?
Definition mol.h:594
OpenBabel::OBMol::GetEnergy
double GetEnergy() const
Definition mol.h:315
OpenBabel::OBMol::SetChiralityPerceived
void SetChiralityPerceived(bool value=true)
Mark that chirality has been perceived.
Definition mol.h:384
OpenBabel::OBMol::SetIsReaction
void SetIsReaction(bool value=true)
Definition mol.h:398
OpenBabel::OBMol::SetChainsPerceived
void SetChainsPerceived(bool value=true)
Mark that chains and residues have been perceived (see OBChainsParser).
Definition mol.h:382
OpenBabel::OBMol::BeginResidue
OBResidue * BeginResidue(OBResidueIterator &i)
Definition mol.h:672
OpenBabel::OBMol::SetCorrectedForPH
void SetCorrectedForPH(bool value=true)
Definition mol.h:394
OpenBabel::OBMol::SetAtomTypesPerceived
void SetAtomTypesPerceived(bool value=true)
Mark that atom types have been perceived (see OBAtomTyper for details).
Definition mol.h:378
OpenBabel::OBMol::SetPartialChargesPerceived
void SetPartialChargesPerceived(bool value=true)
Mark that partial charges have been assigned.
Definition mol.h:386
OpenBabel::OBMol::_mod
unsigned short int _mod
Number of nested calls to BeginModify().
Definition mol.h:141
OpenBabel::OBMol::_dimension
unsigned short int _dimension
Dimensionality of coordinates.
Definition mol.h:131
OpenBabel::OBMol::EndResidues
OBResidueIterator EndResidues()
Definition mol.h:656
OpenBabel::OBMol::SetSSSRPerceived
void SetSSSRPerceived(bool value=true)
Mark that Smallest Set of Smallest Rings has been run (see OBRing class).
Definition mol.h:372
OpenBabel::OBMol::_internals
std::vector< OBInternalCoord * > _internals
Internal Coordinates (if applicable).
Definition mol.h:140
OpenBabel::OBMol::_vconf
std::vector< double * > _vconf
vector of conformers
Definition mol.h:135
OpenBabel::OBMol::_c
double * _c
coordinate array
Definition mol.h:134
OpenBabel::OBMol::ReserveAtoms
void ReserveAtoms(int natoms)
Definition mol.h:160
OpenBabel::OBMol::NextInternalCoord
OBInternalCoord * NextInternalCoord(std::vector< OBInternalCoord * >::iterator &i)
Definition mol.h:695
OpenBabel::OBMol::NumBonds
unsigned int NumBonds() const
Definition mol.h:263
OpenBabel::OBMol::SetIsPatternStructure
void SetIsPatternStructure(bool value=true)
The OBMol is a pattern, not a complete molecule. Left unchanged by Clear().
Definition mol.h:397
OpenBabel::OBMol::SetRingTypesPerceived
void SetRingTypesPerceived(bool value=true)
Mark that ring types have been perceived (see OBRingTyper for details).
Definition mol.h:380
OpenBabel::OBMol::HasAromaticPerceived
bool HasAromaticPerceived()
Has aromatic perception been performed?
Definition mol.h:568
OpenBabel::OBMol::_totalSpin
unsigned int _totalSpin
Total spin on the molecule (if not specified, assumes lowest possible spin).
Definition mol.h:133
OpenBabel::OBMol::AddConformer
void AddConformer(double *f)
Add a new set of coordinates f as a new conformer.
Definition mol.h:611
OpenBabel::OBMol::SetHydrogensAdded
void SetHydrogensAdded(bool value=true)
Mark that explicit hydrogen atoms have been added.
Definition mol.h:393
OpenBabel::OBMol::EndAtoms
OBAtomIterator EndAtoms()
Definition mol.h:648
OpenBabel::OBMol::IsReaction
bool IsReaction()
Does this OBMol represent a reaction?
Definition mol.h:596
OpenBabel::OBMol::EndBonds
OBBondIterator EndBonds()
Definition mol.h:652
OpenBabel::OBMol::HasPartialChargesPerceived
bool HasPartialChargesPerceived()
Have atomic Gasteiger partial charges been assigned by OBGastChrg?
Definition mol.h:582
OpenBabel::OBMol::DecrementMod
void DecrementMod()
Definition mol.h:250
OpenBabel::OBMol::HasHybridizationPerceived
bool HasHybridizationPerceived()
Has atomic hybridization been assigned by OBAtomTyper?
Definition mol.h:584
OpenBabel::OBMol::OBMol
OBMol()
Constructor.
Definition mol.cpp:2716
OpenBabel::OBMol::SetLSSRPerceived
void SetLSSRPerceived(bool value=true)
Mark that Largest Set of Smallest Rings has been run (see OBRing class).
Definition mol.h:374
OpenBabel::OBMol::operator=
OBMol & operator=(const OBMol &mol)
Assignment, copies atoms,bonds and OBGenericData.
Definition mol.cpp:1228
OpenBabel::OBMol::AutomaticFormalCharge
bool AutomaticFormalCharge()
Get the current flag for whether formal charges are set with pH correction.
Definition mol.h:333
OpenBabel::OBMol::_flags
int _flags
bitfield of flags
Definition mol.h:123
OpenBabel::OBMol::BeginConformer
double * BeginConformer(std::vector< double * >::iterator &i)
Definition mol.h:631
OpenBabel::OBMol::SetAutomaticPartialCharge
void SetAutomaticPartialCharge(bool val)
Set the flag for determining partial charges automatically (default=true).
Definition mol.h:366
OpenBabel::OBMol::_totalCharge
int _totalCharge
Total charge on the molecule.
Definition mol.h:132
OpenBabel::OBMol::HasSSSRPerceived
bool HasSSSRPerceived()
Has the smallest set of smallest rings (FindSSSR) been performed?
Definition mol.h:570
OpenBabel::OBMol::SetFlags
void SetFlags(int flags)
Definition mol.h:405
OpenBabel::OBMol::SetClosureBondsPerceived
void SetClosureBondsPerceived(bool value=true)
Mark that ring closure bonds have been assigned by graph traversal.
Definition mol.h:390
OpenBabel::OBMol::SetEnergy
void SetEnergy(double energy)
Set the heat of formation for this molecule (in kcal/mol).
Definition mol.h:348
OpenBabel::OBMol::GetFlags
int GetFlags()
Definition mol.h:256
OpenBabel::OBMol::_atomIds
std::vector< OBAtom * > _atomIds
vector of atoms indexed by id
Definition mol.h:128
OpenBabel::OBMol::_autoPartialCharge
bool _autoPartialCharge
Assign partial charges automatically.
Definition mol.h:124
OpenBabel::OBMol::HasChainsPerceived
bool HasChainsPerceived()
Have biomolecule chains and residues been assigned by OBChainsParser?
Definition mol.h:588
OpenBabel::OBMol::BeginBonds
OBBondIterator BeginBonds()
Definition mol.h:650
OpenBabel::OBMol::GetMod
int GetMod()
Definition mol.h:244
OpenBabel::OBMol::NextResidue
OBResidue * NextResidue(OBResidueIterator &i)
Definition mol.h:679
OpenBabel::OBMol::NextConformer
double * NextConformer(std::vector< double * >::iterator &i)
Definition mol.h:636
OpenBabel::OBMol::_bondIds
std::vector< OBBond * > _bondIds
vector of bonds
Definition mol.h:130
OpenBabel::OBMol::_vatom
std::vector< OBAtom * > _vatom
vector of atoms
Definition mol.h:127
OpenBabel::OBMol::GetDimension
unsigned short int GetDimension() const
Definition mol.h:325
OpenBabel::OBMol::_energy
double _energy
heat of formation
Definition mol.h:136
OpenBabel::OBMol::SetDimension
void SetDimension(unsigned short int d)
Set the dimension of this molecule (i.e., 0, 1 , 2, 3).
Definition mol.h:350
OpenBabel::OBMol::IncrementMod
void IncrementMod()
Definition mol.h:247
OpenBabel::OBMol::SetFlag
void SetFlag(int flag)
Definition mol.h:403
OpenBabel::OBMol::SetAromaticPerceived
void SetAromaticPerceived(bool value=true)
Mark that aromaticity has been perceived for this molecule (see OBAromaticTyper).
Definition mol.h:370
OpenBabel::OBMol::HasRingTypesPerceived
bool HasRingTypesPerceived()
Have ring types been assigned by OBRingTyper?
Definition mol.h:578
OpenBabel::OBMol::_residue
std::vector< OBResidue * > _residue
Residue information (if applicable).
Definition mol.h:139
OpenBabel::OBMol::_autoFormalCharge
bool _autoFormalCharge
Assign formal charges automatically.
Definition mol.h:125
OpenBabel::OBMol::BeginAtoms
OBAtomIterator BeginAtoms()
Definition mol.h:646
OpenBabel::OBMol::GetConformers
std::vector< double * > & GetConformers()
Definition mol.h:640
OpenBabel::OBMol::HasHydrogensAdded
bool HasHydrogensAdded()
Have hydrogens been added to the molecule?
Definition mol.h:590
OpenBabel::OBMol::SetPeriodicMol
void SetPeriodicMol(bool value=true)
Definition mol.h:401
OpenBabel::OBMol::AutomaticPartialCharge
bool AutomaticPartialCharge()
Get the current flag for whether partial charges are auto-determined.
Definition mol.h:335
OpenBabel::OBMol::NumResidues
unsigned int NumResidues() const
Definition mol.h:267
OpenBabel::OBMol::HasClosureBondsPerceived
bool HasClosureBondsPerceived()
Have ring "closure" bonds been assigned? (e.g., OBBond::IsClosure()).
Definition mol.h:586
OpenBabel::OBMol::IsCorrectedForPH
bool IsCorrectedForPH()
Has the molecule been corrected for pH by CorrectForPH?
Definition mol.h:592
OpenBabel::OBResidue
Residue information.
Definition residue.h:51
OpenBabel::vector3
Represents a vector in 3-dimensional real space.
Definition vector3.h:45
OB_AROMATIC_MOL
#define OB_AROMATIC_MOL
Aromatic flags have been set for atoms and bonds.
Definition mol.h:76
OB_SSSR_MOL
#define OB_SSSR_MOL
Smallest Set of Smallest Rings (SSSR) done. See OBRing and OBMol::FindSSSR.
Definition mol.h:72
OB_ATOMSPIN_MOL
#define OB_ATOMSPIN_MOL
SpinMultiplicities on atoms have been set in OBMol::AssignSpinMultiplicity().
Definition mol.h:104
OB_HYBRID_MOL
#define OB_HYBRID_MOL
Atom hybridizations have been set. See OBAtomTyper.
Definition mol.h:84
OB_PERIODIC_MOL
#define OB_PERIODIC_MOL
Molecule is repeating in a periodic unit cell.
Definition mol.h:108
OB_REACTION_MOL
#define OB_REACTION_MOL
Treat as reaction.
Definition mol.h:106
OB_H_ADDED_MOL
#define OB_H_ADDED_MOL
Hyrdogen atoms have been added where needed. See OBMol::AddHydrogens.
Definition mol.h:88
OB_CHAINS_MOL
#define OB_CHAINS_MOL
Biomolecular chains and residues have been set. See OBChainsParser.
Definition mol.h:92
OB_CLOSURE_MOL
#define OB_CLOSURE_MOL
Ring "closure" bonds have been set. See OBBond::IsClosure.
Definition mol.h:86
OB_RINGTYPES_MOL
#define OB_RINGTYPES_MOL
Ring typing has been performed. See OBRingTyper.
Definition mol.h:98
OB_PCHARGE_MOL
#define OB_PCHARGE_MOL
Partial charges have been set or percieved.
Definition mol.h:82
OB_CHIRALITY_MOL
#define OB_CHIRALITY_MOL
Chirality detection has been performed.
Definition mol.h:80
OB_ATOMTYPES_MOL
#define OB_ATOMTYPES_MOL
Atom typing has been performed. See OBAtomTyper.
Definition mol.h:78
OB_PATTERN_STRUCTURE
#define OB_PATTERN_STRUCTURE
A pattern, not a complete molecule.
Definition mol.h:100
OB_LSSR_MOL
#define OB_LSSR_MOL
Largest Set of Smallest Rings (LSSR) done. See OBRing and OBMol::FindLSSR.
Definition mol.h:102
OB_RINGFLAGS_MOL
#define OB_RINGFLAGS_MOL
Ring flags have been set: See OBRing::FindRingAtomsAndBonds.
Definition mol.h:74
OB_PH_CORRECTED_MOL
#define OB_PH_CORRECTED_MOL
pH correction for hydrogen addition has been performed.
Definition mol.h:90
OpenBabel::detail
Nested namespace for max_value templates.
Definition mol.h:718
OpenBabel
Global namespace for all Open Babel code.
Definition alias.h:23
OpenBabel::superimpose
double superimpose(double *, double *, int)
Definition obutil.cpp:1104
OpenBabel::ThrowError
void ThrowError(char *str)
Definition obutil.cpp:55
OpenBabel::OBBondIterator
std::vector< OBBond * >::iterator OBBondIterator
A standard iterator over a vector of bonds.
Definition atom.h:46
OpenBabel::qtrfit
void qtrfit(double *r, double *f, int size, double u[3][3])
Definition obutil.cpp:687
OpenBabel::CartesianToInternal
void CartesianToInternal(std::vector< OBInternalCoord * > &, OBMol &)
Convert Cartesian XYZ to a set of OBInternalCoord coordinates.
Definition obutil.cpp:548
OpenBabel::ob_make_rmat
void ob_make_rmat(double mat[3][3], double rmat[9])
Definition obutil.cpp:897
OpenBabel::get_rmat
void get_rmat(double *, double *, double *, int)
Definition obutil.cpp:1198
OpenBabel::NoId
static const unsigned long NoId
Definition mol.h:736
OpenBabel::OBResidueIterator
std::vector< OBResidue * >::iterator OBResidueIterator
Definition mol.h:67
OpenBabel::NewExtension
std::string NewExtension(std::string &, char *)
Utility function: replace the last extension in string &src with new extension char *ext.
Definition obutil.cpp:109
OpenBabel::HydrogenType
HydrogenType
Definition mol.h:117
OpenBabel::PolarHydrogen
@ PolarHydrogen
Definition mol.h:117
OpenBabel::AllHydrogen
@ AllHydrogen
Definition mol.h:117
OpenBabel::NonPolarHydrogen
@ NonPolarHydrogen
Definition mol.h:117
OpenBabel::InternalToCartesian
void InternalToCartesian(std::vector< OBInternalCoord * > &, OBMol &)
Convert set of OBInternalCoord coordinates into Cartesian XYZ.
Definition obutil.cpp:444
OpenBabel::OBAtomIterator
std::vector< OBAtom * >::iterator OBAtomIterator
A standard iterator over a vector of atoms.
Definition atom.h:48
OpenBabel::detail::max_value< T, 0 >::result
static const T result
Definition mol.h:731
OpenBabel::detail::max_value
a C++ template to return the maximum value of a type (e.g., int)
Definition mol.h:723
OpenBabel::detail::max_value::result
static const T result
Definition mol.h:724