Created
August 7, 2016 13:35
-
-
Save jhjensen2/c6c7fdbad526b3b655c2480fa382c695 to your computer and use it in GitHub Desktop.
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment