Re: [Rdkit-discuss] reassembling a molecule from R-groups

2018-04-16 Thread Greg Landrum
One difference, if you care, is that the SMILES-based approach doesn’t preserve any information about coordinates. Andrew is providing further support for integrating this into the RDKit itself. :-) On Mon, 16 Apr 2018 at 08:30, Andrew Dalke wrote: > On Apr 16, 2018,

Re: [Rdkit-discuss] reassembling a molecule from R-groups

2018-04-16 Thread Andrew Dalke
On Apr 16, 2018, at 05:37, Patrick Walters wrote: > > Thanks Andrew, the SMILES approach seemed to have quite a few edge cases so I > wrote something to work directly on a molecule. That's the approach I started with, until I figured out that it doesn't preserve

Re: [Rdkit-discuss] reassembling a molecule from R-groups

2018-04-15 Thread Greg Landrum
Ah, I'm replying too late... sorry about that. There's a command line utility in rdkit.Chem.ChemUtils.TemplateExpand that could also be used for this purpose. The big difference is that it uses isotope labels on the dummy atoms to do the matching. A style point: you can now create an RWMol

Re: [Rdkit-discuss] reassembling a molecule from R-groups

2018-04-15 Thread Patrick Walters
Thanks Andrew, the SMILES approach seemed to have quite a few edge cases so I wrote something to work directly on a molecule. #!/usr/bin/env python import sys from rdkit import Chem from collections import defaultdict from rdkit.Chem.rdchem import EditableMol # Thanks to steeveslab-blog for

Re: [Rdkit-discuss] reassembling a molecule from R-groups

2018-04-15 Thread Andrew Dalke
Hi Pat, I wrote something like this for mmpdb, which is the MMPA code I helped develop, at https://github.com/rdkit/mmpdb . It has one restriction, which I'll get to in a moment. The general idea is to convert the attachment points to closures, join them with a ".", and canonicalize: >>>