Dear JP,

On Tue, Jun 28, 2011 at 5:32 PM, JP <[email protected]> wrote:
> Something is not quite clear to me in the remove salts functionality -
> particularly the dontRemoveEverything flag.
>
> Watch out for this case (everything removed):
>>>> remover = SaltRemover()
>>>> len(remover.salts)>1
> True
>>>> mol = Chem.MolFromSmiles('CC(=O)O.[Na]')
>>>> res = remover.StripMol(mol)
>>>> res.GetNumAtoms()
> 0
>
> JP -- why does this return 0 ?!  why is the CC(=O)O part stripped here?

because acetic acid is one of the counterions present in the salt
definition file. Take a look at $RDBASE/Data/Salts.txt
If you want to create your own definitions, you can create a salt
stripper from them like this:
remover = SaltRemover(defnFilename='my_salt_file.txt')

> dontRemoveEverything helps with this by leaving the last salt:
>>>> res = remover.StripMol(mol,dontRemoveEverything=True)
>>>> res.GetNumAtoms()
> 4
>

It's the acetic acid:
[4]>>> m = Chem.MolFromSmiles('CC(=O)O.[Na]')

[5]>>> res = rm.StripMol(m,dontRemoveEverything=True)

[6]>>> Chem.MolToSmiles(res)
Out[6] 'CC(=O)O'

The reason that is left instead of the Na is because the Na comes
first in the Salts.txt file, so it's removed first. There are some
notes about this at the top of that file.

-greg

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to