Hi Dot-disconnected fragments are not going to work for this, as you describe. You need to use recursive SMARTS (see https://www.daylight.com/dayhtml/doc/theory/theory.smarts.html section 4.4). Something like: Clc[$(cBr);$(ccBr);$(cccBr)] should (I hope!) be a reasonable starting point.
Chris Earnshaw On Wed, 29 Jan 2020 at 11:12, Alexis Parenty <alexis.parenty.h...@gmail.com> wrote: > Hi everyone, > > > > Is there a way to get a substructure match of regioisomers using a smarts > by separating the fragments with “.”: > > > > The following approach works but is too permissive since it will also > match structures with a bromide or a chloride linked to a aliphatic > carbon... > > > [image: image.png] > > > > mol_smiles_structure = Chem.MolFromSmiles("Clc1cc(Br)ccc1") > > mol_smarts_fragment = Chem.MolFromSmarts("c1ccccc1.[Cl].[Br]") > > print(mol_smiles_structure.HasSubstructMatch(mol_smarts_fragment)) > > ð True > > > > > > mol_smiles_structure = Chem.MolFromSmiles("ClCc1cc(Br)ccc1") > > print(mol_smiles_structure.HasSubstructMatch(mol_smarts_fragment)) > > ð True > > > > If I specify that the Br and the Cl need to be attached to an aromatic to > make it less permissive, it no longer match because I cannot specify that > the two general aromatics [a] also belong to the benzene ring... (i,e. it > tries to look for 8 aromatics instead of six...) > > mol_smiles_structure = Chem.MolFromSmiles("Clc1cc(Br)ccc1") > > mol_smarts_fragment = Chem.MolFromSmarts("c1ccccc1.[a][Cl].[a][Br]") > > print(mol_smiles_structure.HasSubstructMatch(mol_smarts_fragment)) > > ð False > > > > Thanks! > > Alexis > > > > > _______________________________________________ > Rdkit-discuss mailing list > Rdkit-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/rdkit-discuss >
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss