Re: [Rdkit-discuss] SMARTS representing a fragment (with "unbonded" bonds)

2021-03-05 Thread Thomas
I need to do it on an indefinite number of decompositions of some molecule, expressed in the form of 1 SMILES + n SMILES fragments (starred SMILES). For example: CCC can be decomposed in C* C *C. And i want to highlight the SMILES in blu and the 2 fragments in yellow Ivan put me on a good path: m

Re: [Rdkit-discuss] SMARTS representing a fragment (with "unbonded" bonds)

2021-03-05 Thread Ivan Tubert-Brohman
Hi Thomas, I believe what you want can be done using recursive SMARTS and disconnected SMARTS. For example, In [7]: mol = Chem.MolFromSmiles('CCC=C') In [8]: mol.GetSubstructMatches(Chem.MolFromSmarts('[$(C-*)].CC.[$(C=*)]')) Out[8]: ((0, 1, 2, 3),) The recursive SMARTS let you match a single

[Rdkit-discuss] SMARTS representing a fragment (with "unbonded" bonds)

2021-03-05 Thread Thomas
Is it possible to search for a fragment that is not a valid structure itself, but part of a structure? Problem: "Given a structure, and a decomposition of the structure, highlight each part with a different color" The decomposition is always in the form of 1 SMILES and n SMILES FRAGMENTS The "smil