It was just pointed out to me (thanks Isidro!), that I never followed up on
this thread.
This bug has been fixed in the github version of the code (here's the bug
report and link to the fix: https://github.com/rdkit/rdkit/issues/42) and
it will be in the Q3 release (coming in the next few weeks).
Best,
-greg
On Mon, Jun 3, 2013 at 5:07 AM, Greg Landrum <[email protected]> wrote:
> Hi Dan,
>
> On Sun, Jun 2, 2013 at 6:30 PM, Daniel Warner <[email protected]>wrote:
>
>>
>> I've been having some problems with indexes following conversion from an
>> EditableMol. I can create the molecule, delete a specific group of atoms,
>> and extract a regular molecule without issue. The Debug method indicates
>> that I have the intended 15-atom fragment.
>>
>> smiles = "CCN1CCN(c2cc3[nH]c(C(=O)[C@@]4(CC)CC[C@](C)(O)CC4)nc3cc2Cl)CC1"
>> mol = Chem.MolFromSmiles(smiles)
>> tmp = Chem.EditableMol(mol)
>> for atom in [29, 28, 27, 26, 25, 24, 8, 7, 6, 5, 4, 3, 2, 1, 0]:
>> tmp.RemoveAtom(atom)
>> mol = tmp.GetMol()
>> mol.Debug()
>>
>> Unfortunately when I try to create a SMILES for the fragment it seems to
>> be trying to access an atom indexed 18. Does anyone have any ideas why? It
>> works perfectly for other example, including deletion of
>> the equivalent atoms from very similar structures.
>>
>> Chem.MolToSmiles(mol)
>>
>> ****
>> Range Error
>> idx
>> Violation occurred on line 153 in file
>> /home/dan/RDKit_2012_12_1/Code/GraphMol/ROMol.cpp
>> Failed Expression: 0 <= 18 <= 14
>> ****
>>
>> Any help would be much appreciated.
>>
>>
> It seems to be due to a problem caused by the presence of stereochemistry.
> If I remove the chiral specifications from your example molecule everything
> works fine:
>
> In [13]: smiles2 =
> "CCN1CCN(c2cc3[nH]c(C(=O)[C]4(CC)CC[C](C)(O)CC4)nc3cc2Cl)CC1"
>
> In [14]: mol = Chem.MolFromSmiles(smiles2)
>
> In [15]: tmp = Chem.EditableMol(mol)
>
> In [16]: for atom in [29, 28, 27, 26, 25, 24, 8, 7, 6, 5, 4, 3, 2, 1, 0]:
> tmp.RemoveAtom(atom)
>
> In [17]: mol = tmp.GetMol()
>
> In [18]: Chem.MolToSmiles(mol)
> Out[18]: 'CCC1(C(=O)c(n)[nH])CCC(C)(O)CC1'
>
>
> So it's clearly a bug (and a somewhat frustrating one, because I thought I
> had caught these cases already); I will get it fixed.
>
> Best,
> -greg
>
>
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss