Re: [Rdkit-discuss] HasSubstructureMatch using query atom list with hydrogen

2022-07-22 Thread Paolo Tosco
Hi Susan, adding explicit hydrogens is an expensive operation that you normally try to avoid unless you have to (e.g., because you need to deal with 3D molecule coordinates). I would rather change the query in order to use implicit H queries, e.g. something like: q =

Re: [Rdkit-discuss] HasSubstructureMatch using query atom list with hydrogen

2022-07-22 Thread Susan Leung
Sorry I replied too soon, just another quick question. I am trying to use the postgres cartridge. Is there any function to add hydrogens to the molecules once in the database? Or should this be done as a preprocessing step beforehand? E.g. I have a .smi or .sdf should all the molecules already

Re: [Rdkit-discuss] HasSubstructureMatch using query atom list with hydrogen

2022-07-22 Thread Susan Leung
Ah, great thanks Paolo! On Fri, Jul 22, 2022 at 11:44 AM Paolo Tosco wrote: > Hi Susan, > > If you use [#1] in your SMARTS query, for your molecule to match there > should be a real hydrogen atom in your molecule graph, while in your > molecule you only have implicit hydrogens, unless you

Re: [Rdkit-discuss] HasSubstructureMatch using query atom list with hydrogen

2022-07-22 Thread Paolo Tosco
Hi Susan, If you use [#1] in your SMARTS query, for your molecule to match there should be a real hydrogen atom in your molecule graph, while in your molecule you only have implicit hydrogens, unless you explicitly add them calling Chem.AddHs(): print(Chem.AddHs(m).HasSubstructMatch(q)) True

[Rdkit-discuss] HasSubstructureMatch using query atom list with hydrogen

2022-07-22 Thread Susan Leung
Hi all, I am trying to do substructure search using query atom lists, but I am seeing unexpected behaviour when I have hydrogen in my query atom list… import rdkit print(rdkit.__version__) from rdkit import Chem >>2022.03.2 ## having carbon in the query atom list seems to work as