File failed to load: http://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/extensions/TeX/AmsMath.js

Sunday, August 7, 2016

Conformer search with RDKit

I'm teaching myself how to use RDKit.  Here is code for conformer search using RDKit that also computes the energy of each conformer using the MMFF94 force field.

Comments welcome

#conformer search with RDKIT
import sys
sys.path.append("/usr/local/lib/python2.7/site-packages/")
from rdkit import Chem
from rdkit.Chem import AllChem
m = Chem.AddHs(Chem.MolFromSmiles('CCCO')) #creates molecule from smiles and adds H's
AllChem.EmbedMultipleConfs(m,20) #makes 20 3D conformations
_=AllChem.MMFFOptimizeMoleculeConfs(m,maxIters=1000) #MMFF geometry optimization
i = 0
for conf in m.GetConformers():
tm = Chem.Mol(m,False,conf.GetId())
prop = AllChem.MMFFGetMoleculeProperties(tm, mmffVariant="MMFF94") #don't know
ff =AllChem.MMFFGetMoleculeForceField(tm,prop) #defines FF
print i,ff.CalcEnergy() #calculates and prints energy in kcal/mol
file = "out"+str(i)+".sdf"
writer = Chem.SDWriter(file) #writes sdf file for each confomer
writer.write(tm)
i += 1
Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.  

No comments: