From: Thomas G. K. <tg...@da...> - 2008-10-11 14:27:26
|
Hi all, I'm trying to rotate parts of a molecule around a rotable bond, but I can't seem to figure out how to do this from python. My experiments try to rotate the bonds of a ligand to see how the energy landscape changes. My goal is to experiment with energy minimization algorithms. I appreciate all the help I can get... Thomas G. Kristensen (phd student, Aarhus University, Denmark) p.s: This is how far I've gotten so far: #!/usr/bin/env python """ A (hopefully) small test that will reviel how easy it is to calculate the energy of a molecule using the open babel python swig bindings. """ import pybel import openbabel forcefield = openbabel.OBForceField.FindForceField("MMFF94") if __name__ == "__main__": for mol in pybel.readfile("mol2", "ligands.mol2"): obmol = mol.OBMol forcefield.Setup(obmol) print forcefield.Energy() for bond in openbabel.OBMolBondIter(obmol): print bond.IsRotor() # I cant ask this object to rotate :( for torsion in openbabel.OBMolTorsionIter(obmol): print torsion # Is not an object, can not be manipulated :( |