Re: [Rdkit-discuss] Substructure search issue with aliphatic/aromatic bonds

2020-05-20 Thread theozh
Hi Paolo, argh... I thought if you are setting params.sanitize=False then you don't want sanitization. Apparently, you need it for the mols but skipping only aromatization. I guess, I slowly start to understand... What you explained here and in your github example I tried to find something

Re: [Rdkit-discuss] Substructure search issue with aliphatic/aromatic bonds

2020-05-20 Thread Paolo Tosco
Hi Theo, that's because you omitted the sanitization step completely, so the molecule is missing crucial information for the SubstructureMatch to do a proper job. If you put back sanitization, only leaving out the aromatization step, things work as expected. Also, you do not need to create

Re: [Rdkit-discuss] Substructure search issue with aliphatic/aromatic bonds

2020-05-20 Thread theozh
Hi Paolo, sorry, I made a typo (makeBondGeneric instead of makeBondsGeneric) that's why the bonds weren't UNSPECIFIED. The following examples seem to work fine now for these two SMILES, the first structure will be found in the second one. C12=CC=CN1NCCC2 and C12C=CC=C(C=C3)C=1N3NCC2

Re: [Rdkit-discuss] Substructure search issue with aliphatic/aromatic bonds

2020-05-19 Thread Paolo Tosco
Hi Theo, I don't think the RDKit version should make a difference; did you notice that rdmolops.AdjustQueryProperties() does not modify the molecule in place, but rather returns a modified copy? pattern_generic_bonds = Chem.AdjustQueryProperties(pattern, query_params) That might be the

Re: [Rdkit-discuss] Substructure search issue with aliphatic/aromatic bonds

2020-05-19 Thread theozh
Hi Paolo, thank you very much for your detailed answer. I tried to reproduce your last suggestion (but I don't have Jupyter Notebook). However, my bonds are still SINGLE and DOUBLE instead of UNSPECIFIED. Does this maybe depend on the RDKit Version, I have 2019.03... ? Maybe, I should update and

Re: [Rdkit-discuss] Substructure search issue with aliphatic/aromatic bonds

2020-05-19 Thread Paolo Tosco
Hi Theo, the lack of match is due to different aromaticity flags on atoms and bonds in the larger molecule. This gist provides some explanation and a possible solution: https://gist.github.com/ptosco/e410e45278b94e8f047ff224193d7788 Cheers, p. On 19/05/2020 14:13, theozh wrote: Dear

[Rdkit-discuss] Substructure search issue with aliphatic/aromatic bonds

2020-05-19 Thread theozh
Dear RDKit-users, I would like to do a very simple substructure search. The chapter 3.5 "Substructure Searching" in RDKit Documentation (2019.09.1) is pretty short and doesn't point to a solution. So far, I've learned that you can create your search pattern via Chem.MolFromSmiles() or