It seemed that it was unexpectedly impossible to calculate the volume from the two-dimensional structure of the compound with built-in of openbabel and rdkit (I'm sad if I misunderstood this), so I implemented it with reference to the paper [1]. .. The unit is cubic angstrom.
https://github.com/keisuke-yanagisawa/python-tools/blob/master/calc_mol_volume.py
It has an implementation that depends on openbabel.
If you use this, for example, if you enter benzene,
from calc_mol_volume import *
import pybel
mol = pybel.readfile("sdf", "benzene.sdf").next()
print estimate_volume(mol)
# -> 81.1800000...
Will be. Also, annotate_sdf_volume
is prepared in calc_mol_volume.py.
from calc_mol_volume import *
annotate_sdf_volume("benzene.sdf", "benzene_annotated.sdf")
You can also output a new sdf file by doing.
[1] Zhao YH, et al., "Fast calculation of van der Waals volume as a sum of atomic and bond contributions and its application to drug compounds", The Journal of Organic Chemistry, 68(19), 7368-7373, 2003.
Recommended Posts