Hi JP,

When you generate a mol from a smiles I don't think a conformer is added by 
default.

So you have to do this yourself:

molecule = Chem.MolFromSmiles('CCCC')
mol_h = AllChem.AddHs(molecule)
mol_h.AddConformer(Chem.Conformer(mol_h.GetNumAtoms()))
ff = AllChem.UFFGetMoleculeForceField(mol_h)
energy_value = str(ff.CalcEnergy())
print energy_value

Should at least get rid of the error ... not that the above code is tested ... 
plus it obviously doesn't make any sense since all coordinates will be 0.0 :(

Ciao
Nik


From: JP [mailto:[email protected]]
Sent: Friday, January 13, 2012 1:07 PM
To: [email protected]
Subject: [Rdkit-discuss] UFF energy question(s)...


Hi there, (using RDKit 2011.09.01)

Any ideas why

molecule = Chem.MolFromSmiles('CCCC')
mol_h = AllChem.AddHs(molecule)
ff = AllChem.UFFGetMoleculeForceField(mol_h)
energy_value = str(ff.CalcEnergy())
print energy_value

Gives me:

Traceback (most recent call last):
  File "./energy_test.py", line 8, in <module>
    ff = AllChem.UFFGetMoleculeForceField(mol_h)
ValueError: Bad Conformer Id

There are no conformers in the molecule - so the default (implicit) confId -1 
should do the work no?
This code somehow works when I use suppliers...

Also, any ideas what the energy units returned from ff.CalcEnergy() are?  They 
must be in calories (not K/cal) as they are massive.  Correct?

-
Jean-Paul Ebejer
Early Stage Researcher
------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to