Hi all,

I am trying to add a fragment to an existing molecule using RDkit - I start
by generating the desired molecules I would like to combine:

oh = '[OH-]'
ohh = Chem.MolFromSmiles(oh)
oh = Chem.AddHs(ohh)
AllChem.EmbedMolecule(oh, AllChem.ETKDG())

smiles_ = 'CCCCC'
m = Chem.MolFromSmiles(smiles_)
m_h = Chem.AddHs(vxm)
AllChem.EmbedMolecule(m_h, AllChem.ETKDG())

I combine them which works fine:

combo = Chem.CombineMols(m_h,oh)

and I can add the bond between the desired atoms:

edcombo = Chem.EditableMol(combo)

back = edcombo.GetMol()

The problems arises when I want to edit the geometry between the two :

from rdkit.Chem import rdMolTransforms as rdmt
conf = back.GetConformer(0)


writer3 = Chem.SDWriter('out_long.sdf')

RuntimeError                              Traceback (most recent call
last)<ipython-input-193-36d3c0480a45> in <module>()      2 conf =
back.GetConformer(0)      3 ----> 4 rdmt.SetBondLength(conf,3,43,10)
   5       6 writer3 = Chem.SDWriter('out_long.sdf')
RuntimeError: Pre-condition Violation
        RingInfo not initialized
        Violation occurred on line 66 in file Code/GraphMol/RingInfo.cpp
        Failed Expression: df_init
        RDKIT: 2017.03.3
        BOOST: 1_56

So I am not sure how fix - thanks in advance

With kind regards

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

Reply via email to