Re: [Rdkit-discuss] SMARTS pattern

2022-06-07 Thread Greg Landrum
Hi Eduardo, If I'm understanding what you want to do correctly, then you could try extending your SMARTS pattern to include a ring bond to a neighbor from each atom in the ring: *@*~1~*(@*)~*(@*)~*(@*)~*(@*)~*~1@* If you only want the indices of the ring atoms, you can then just pick those out

Re: [Rdkit-discuss] SMARTS pattern

2022-06-07 Thread Wim Dehaen
The above solution with !r4 doesn't work because for sssr reasons these atoms are considered to be in a 4 membered ring also if the 4 membered ring is "exo" to the central 6 membered one. AFAIK there is no good way to do a general ring size filter in an atom definition using SMARTS. Below is a

Re: [Rdkit-discuss] SMARTS pattern

2022-06-07 Thread Geoffrey Hutchison
> Nevermind, x3 won't exclude the fused 4-atom rings from your first example. > I'll let you know if I think of some other way. :-) I think you'd want something like this, perhaps - to exclude atoms in ring size 4? [*;R2!r4]~1~[*;R2!r4]~[*;R2!r4]~[*;R2!r4]~[*;R2!r4]~[*;R2!r4]~1 I also don't

Re: [Rdkit-discuss] SMARTS pattern

2022-06-07 Thread Ivan Tubert-Brohman
On Tue, Jun 7, 2022 at 1:39 PM Ivan Tubert-Brohman < ivan.tubert-broh...@schrodinger.com> wrote: > Perhaps using x3 instead (means "number of ring bonds") would work for > your purposes? > Nevermind, x3 won't exclude the fused 4-atom rings from your first example. I'll let you know if I think of

Re: [Rdkit-discuss] SMARTS pattern

2022-06-07 Thread Ivan Tubert-Brohman
Hi Eduardo, I believe the problem is that r6 means "in *smallest* SSSR ring of size ", where "smallest" in this context means that, for example, for an atom at the ring fusion between a 5-member ring and a 6-member ring, r5 would match that atom but r6 wouldn't. Perhaps using x3 instead (means

[Rdkit-discuss] SMARTS pattern

2022-06-07 Thread Eduardo Mayo
Greetings!! I hope this email finds you well. I need a SMARTS pattern that matches this molecule fragment [image: image.png] The first pattern I used was: [*;R2]~1~[*;R2]~[*;R2]~[*;R2]~[*;R2]~[*;R2]~1 However, it also matches this fragment. This is not the expected behavior but it agrees with

Re: [Rdkit-discuss] SMARTS pattern replacement inside a ring; without breaking the ring open...

2021-01-12 Thread Francois Berenger
On 12/01/2021 15:10, Fiorella Ruggiu wrote: Hi Francois, not sure if you have solved this yet. I believe it won't be possible to use AllChem.ReplaceSubstructs without breaking the rings or enumerating them. You can however use reactions for this problem. Here's an example based on yours: mol =

Re: [Rdkit-discuss] SMARTS pattern replacement inside a ring; without breaking the ring open...

2021-01-11 Thread Fiorella Ruggiu
Hi Francois, not sure if you have solved this yet. I believe it won't be possible to use AllChem.ReplaceSubstructs without breaking the rings or enumerating them. You can however use reactions for this problem. Here's an example based on yours: mol = Chem.MolFromSmiles('O=c1[nH]1') rxn =

[Rdkit-discuss] SMARTS pattern replacement inside a ring; without breaking the ring open...

2021-01-07 Thread Francois Berenger
Dear list, I have been trying to replace this SMARTS pattern in a ring: 'c(=O)[nH]' By this SMILES fragment: 'c(O)n' My trials using a single SMARTS pattern search then replace break open the ring, which is not what I want. My not working trial code: --- mol =

Re: [Rdkit-discuss] SMARTS Pattern and scaffold

2018-02-05 Thread Paolo Tosco
Dear Colin, you might specify the number of implicit Hs that you want on the carbons of the indazole nucleus, e.g.: '[#7]1:[#6]:[#6]2:[#6]:[#6]:[#6]:[#6]:[#6]:2:[#7]:1-[#6]-[#6]1:[#6]:[#6]:[#6]:[#6]:[#6]:1' This would rule out substituted indazoles. HTH, cheers p. On 02/05/18 09:26, Colin

[Rdkit-discuss] SMARTS Pattern and scaffold

2018-02-05 Thread Colin Bournez
Hello everyone, I have trouble finding what I want using smarts pattern : Let's say I have for example these molecules : smis =('n2cc1c1n2Cc1c1CC','n2cc1c1n2Cc1c(CC)cc(CCl)cc1','n2cc1c(CC)1n2Cc1c1CC','n2cc1cc(CF)ccc1n2Cc1cc(CC)ccc1CC') ms = [Chem.MolFromSmiles(x) for x in

Re: [Rdkit-discuss] SMARTS pattern matching of canonical forms of aromatic molecules

2017-09-08 Thread Jason Biggs
Start with your benzene molecule m = Chem.MolFromSmiles('c1c1') make a pattern using Peter's example, with three aromatic atoms connected by three aromatic bonds patt = Chem.MolFromSmarts('a:a:a') and it's a match: m.HasSubstructMatch(patt) >True Kekulize your mol, and the pattern

Re: [Rdkit-discuss] SMARTS pattern matching of canonical forms of aromatic molecules

2017-09-08 Thread Peter S. Shenkin
Hi, In SMARTS, 'a' matches an aromatic atom. So you would match your molecule with the pattern 'aaa', or if you wanted to restrict yourself to carbons, 'ccc'. This would match whether you created the molecule from a Kekulized or an aromatic SMILES. Remember that it's the molecular recognition

[Rdkit-discuss] SMARTS pattern matching of canonical forms of aromatic molecules

2017-09-08 Thread James T. Metz via Rdkit-discuss
Hello, Suppose I read in the SMILES of an aromatic molecule e.g., for benzene c1c1 I then want to convert the molecule to a Kekule representation and then perform various SMARTS pattern recognition e.g. [C]=[C]-[C] I have tried various Kekule commands in