2005-12-07 11:23:49 +00:00
Developer's Notes and Design Decisions for pyopenbabel.py
---------------------------------------------------------
2005-12-07 17:13:43 +00:00
The Atom class
==============
2005-12-07 11:23:49 +00:00
2005-12-07 17:13:43 +00:00
To find all of the GetVar() methods of the Atom class:
import openbabel
b = [x for x in openbabel.OBAtom.__dict__.keys() if x.startswith("Get")]
b.sort()
for c in b:
print c
GetAngle "NotImplementedError: No matching function for overloaded 'OBAtom_GetAngle'"
GetAtomicMass == atomicmass
GetAtomicNum == atomicnum
GetBond needs two arguments
GetCIdx == cidx
GetCoordinate replaced by a .coords attribute containing a tuple (x,y,z) (also "Segmentation fault")
GetCoordinateIdx == coordidx
GetData == data
GetDistance "NotImplementedError: No matching function for overloaded 'OBAtom_GetDistance'"
GetExactMass == exactmass
GetFormalCharge == formalcharge
GetHeteroValence == heterovalence
GetHvyValence == heavyvalence (if hetero isn't abbreviated, then neither should heavy)
GetHyb == hyb
GetIdx == idx
GetImplicitValence == implicitvalence
GetIsotope == isotope
GetNewBondVector needs three arguments
GetNextAtom not required (given a Molecule, you can loop through the atoms)
GetPartialCharge == partialcharge
GetResidue "Segmentation fault"
GetSpinMultiplicity == spin
GetType == type
GetValence == valence
GetVector == vector
GetX replaced by a .coords attribute containing a tuple (x,y,z)
GetY replaced by a .coords attribute containing a tuple (x,y,z)
GetZ replaced by a .coords attribute containing a tuple (x,y,z)
2005-12-09 09:22:46 +00:00
All attributes are calculated on-the-fly when you ask for them. They are also initialised when you create the Atom object, so that dir(myatom) gives a useful list of attributes.
2005-12-07 17:13:43 +00:00
The Molecule class
2005-12-09 09:22:46 +00:00
==================
2005-12-07 17:13:43 +00:00
To find all of the GetVar() methods of the Molecule class:
import openbabel
b = [x for x in openbabel.OBMol.__dict__.keys() if x.startswith("Get")]
b.sort()
for c in b:
print c
GetAtom replaced by a .atoms attributes containing a list of Atoms
2005-12-09 09:22:46 +00:00
GetBond (to be)replaced by a .bonds attributes containing a list of Bonds
GetConformer needs two arguments
GetConformers == conformers
GetCoordinates == coords
GetData == data
GetDimension == dim
GetEnergy == energy
GetExactMass == exactmass
2005-12-07 17:13:43 +00:00
GetFirstAtom not required (can use .atoms attribute instead)
2005-12-09 09:22:46 +00:00
GetFlags == flags
2005-12-07 17:13:43 +00:00
GetFormula == formula
2005-12-09 09:22:46 +00:00
GetGIDVector needs two arguments
GetGIVector needs two arguments
GetGTDVector == gtdvector
GetInternalCoord == internalcoord (or internalcoords??)
GetMod == mod
GetMolWt == molwt
GetResidue needs two arguments
GetSSSR == sssr
GetTitle == title
GetTorsion "NotImplementedError: No matching function for overloaded 'OBMol_GetTorsion'"
GetTotalCharge == charge
GetTotalSpinMultiplicity == spin
2005-12-07 17:13:43 +00:00
2005-12-09 09:22:46 +00:00
All attributes are calculated on-the-fly when you ask for them. They are also initialised when you create the Molecule object, so that dir(mymolecule) gives a useful list of attributes.