Hi,
I just ran into a small gotcha and thought I'd share it. I have a molecule
with a fragment of 6 carbons, 5 of which form a ring, and I am deleting
fragments that match "CCCCCC". I thought that if I were working in SMILES
the ring fragment would be spared, but not if it was a SMARTS. However as
the following code shows it gets deleted either way.
>>> import rdkit
>>> from rdkit import Chem
>>> query = Chem.MolFromSmiles('C.CC1CCCC1')
>>> remove_as_smiles = Chem.MolFromSmiles('CCCCCC')
>>> remove_as_smarts = Chem.MolFromSmarts('CCCCCC')
>>> print Chem.MolToSmiles(Chem.DeleteSubstructs(query, remove_as_smiles,
onlyFrags=True))
C
>>> print Chem.MolToSmiles(Chem.DeleteSubstructs(query, remove_as_smarts,
onlyFrags=True))
C
So now I know to use "[C!r][C!r][C!r][C!r][C!r][C!r]" explicitly if that's
what I mean. Hope this saves someone else from stumbling into my mistakes.
Yours,
Toby Wright
--
InhibOx Ltd
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss