Dear Jan,

you will need

new_m = Chem.MolFromMolFile(file, removeHs=False)

or hydrogens will be removed upon read.

Cheers,
p.

On 11/15/17 13:50, Jan Halborg Jensen wrote:
The following code
1. energy-minizes a molecule and computes the energy
2. writes to coordinates to an sdf file,
3. reads it in and re-computes the energy

But the two energies are off by 4 kcal/mol

Any idea what I am doing wrong?

Best regards, Jan



from rdkit import Chem
from rdkit.Chem import AllChem

smiles = "O=C(Nc1ccc(OCC(O)CNC(C)C)c(c1)C(=O)C)CCC"
m = Chem.MolFromSmiles(smiles)
m = Chem.AddHs(m)
AllChem.EmbedMolecule(m,randomSeed=2)

AllChem.MMFFOptimizeMolecule(m,maxIters=1000,mmffVariant="MMFF94")
prop = AllChem.MMFFGetMoleculeProperties(m, mmffVariant="MMFF94")
ff =AllChem.MMFFGetMoleculeForceField(m,prop)
print ff.CalcEnergy()

file = "e_test.sdf"
Chem.SDWriter(file).write(tm)

new_m = Chem.MolFromMolFile(file)
#new_m = Chem.SDMolSupplier(file)[0]

prop = AllChem.MMFFGetMoleculeProperties(new_m, mmffVariant="MMFF94")
ff =AllChem.MMFFGetMoleculeForceField(new_m,prop)
print ff.CalcEnergy()


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to