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

This work is licensed under a Creative Commons Attribution 3.0 Unported License.
Comments welcome
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |

This work is licensed under a Creative Commons Attribution 3.0 Unported License.
No comments:
Post a Comment