In this year I moved from MedChem team to CompChem team. And now I need to learn SBDD. Today I struggled mol object that has 3D information.
I would like to replace hydrogen which attached aromatic carbon to some atoms. I thought it is easy if I use rdChemReactions method. But I found that it was not good approach. Because RunReactants method generates products but the method can not keep 3D information of reacted atoms.
It is very interesting and good information for me. Let see example code.
Following code is very simple example.
At first, I tried to replace atom with rdChemReactions method. It worked well but the position of fluorine atom was 0, 0, 0. It indicates that the method can not keep 3D information. I think it is reasonable because some chemical reaction dramatically changes molecular conformation.
The second example used Editable mol.
This approach could keep 3D information, it means that the method do just replace atom!
Of course bond length of C-H and C-F is different but the approach is more suitable for atom scanning I think.
I always surprised that RDKit has many useful function for drug design.
I recommend using Chem.RWMol instead of EditableMol. EditableMol is the old way of doing things and RWMol is a lot more flexible and robust:
In [6]: m = Chem.MolFromSmiles(‘c1ccccc1O’)
In [7]: em = Chem.RWMol(m)
In [8]: em.ReplaceAtom(6,Chem.Atom(9))
In [9]: Chem.MolToSmiles(em)
Out[9]: ‘Fc1ccccc1’
I really need to update the docs to make this clear…. sorry that I haven’t done that yet.
Also: you can keep coordinates with a reaction if you actually match the H and replace it:
iwatobipen_reactions_and_coordinates.ipynb
hosted with ❤ by GitHub
Thank you for giving nice example!
That makes sense. It is really useful code for me!
Hi Greg,
Thank you for your advice. I just updated my gist.