Sorry for spamming the list. This is the correct version:
from rdkit import Chem
from rdkit.Chem import AllChem
mol = Chem.MolFromSmiles('CCCC')
mol=Chem.AddHs(mol)
AllChem.EmbedMolecule(mol)
AllChem.UFFOptimizeMolecule(mol)
conf = mol.GetConformer()
natom=mol.GetNumAtoms()
conf=mol.GetConformer()
minimum=1e100
for i in range(0, natom-1):
    for j in range(i+1,natom):
        if mol.GetBondBetweenAtoms(i,j)==None:
            dist=rdMolTransforms.GetBondLength(conf,i,j)
            if dist<minimum:
                minimum=dist
print(minimum)

Best wishes,
Michal

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to