On Thu, Aug 30, 2012 at 5:23 AM, Greg Landrum <[email protected]> wrote:
> Dear Stephan,
>
> On Wed, Aug 29, 2012 at 8:53 PM, Stephan Reiling <[email protected]> wrote:
>> MolFromSmiles seems to consume all available memory (and beyond) with
>> certain Smiles strings when sanitize is set to True (the default). This also
>> affects the postgresql cartridge. I am using version 2012_06_1.
>> Below is an example:
>>
>> #!/usr/bin/env python
>>
>> """
>> example of rdkit consuming infinite amount of memory
>> Pubchem compound CID 57383442
>> http://pubchem.ncbi.nlm.nih.gov/summary/summary.cgi?cid=57383442
>> """
>>
>> from rdkit import Chem
>> smi =
>> 'CCCOc1c2CNC(=O)c3cc(cc(c3)C(=O)NCc3cc4cc(CNC(=O)c5cc(C(=O)NCc1cc(c2)c1cc2CNC(=O)c6cc(cc(c6)C(=O)NCc6cc4cc(CNC(=O)c4cc(C(=O)NCc(c1)c2OCCC)cc(c4)C(=O)NC(COCCC(=O)O)(COCCC(=O)O)COCCC(=O)O)c6OCCC)C(=O)NC(COCCC(=O)O)(COCCC(=O)O)COCCC(=O)O)cc(c5)C(=O)NC(COCCC(=O)O)(COCCC(=O)O)COCCC(=O)O)c3OCCC)C(=O)NC(COCCC(=O)O)(COCCC(=O)O)COCCC(=O)O'
>>
>> print "Calling MolFromSmiles WITHOUT sanitize"
>> m = Chem.MolFromSmiles(smi, sanitize=False )
>>
>> print "Calling MolFromSmiles WITH sanitize"
>> m = Chem.MolFromSmiles(smi, sanitize=True )
>>
>
> You just need to buy more memory! ;-)
>
> Seriously: I've confirmed the problem and localized it to the
> ring-finding code. I will file a bug and get it fixed for the next
> release.

Ha. that was a good one. Given enough memory, it actually would have
eventually finished, but it would have taken a *long* time and a *lot*
of memory.

It's fixed now :

In [5]: smi = 
'CCCOc1c2CNC(=O)c3cc(cc(c3)C(=O)NCc3cc4cc(CNC(=O)c5cc(C(=O)NCc1cc(c2)c1cc2CNC(=O)c6cc(cc(c6)C(=O)NCc6cc4cc(CNC(=O)c4cc(C(=O)NCc(c1)c2OCCC)cc(c4)C(=O)NC(COCCC(=O)O)(COCCC(=O)O)COCCC(=O)O)c6OCCC)C(=O)NC(COCCC(=O)O)(COCCC(=O)O)COCCC(=O)O)cc(c5)C(=O)NC(COCCC(=O)O)(COCCC(=O)O)COCCC(=O)O)c3OCCC)C(=O)NC(COCCC(=O)O)(COCCC(=O)O)COCCC(=O)O'

In [6]: %timeit m=Chem.MolFromSmiles(smi)
100 loops, best of 3: 3.94 ms per loop

The fix is checked in and it will be in the Q3 release.

Best,
-greg

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to