Hi Alfredo,

After parsing the SMILES strings of your molecules the RDKit considers all of 
the atoms of your triazole to be aromatic, which you can see in the SMILES 
string created from parsing your query molecule and regenerating its RDKit 
SMILES string.  I've included a simple template query that works below, which 
you could be made more specific with additional SMARTS features as you like. 

>>> from rdkit import Chem
>>> query = 'N1N=NC=C1'
>>> mol = Chem.MolFromSmiles(query)
>>> Chem.MolToSmiles(mol)
'c1c[nH]nn1'
>>> template = 'n1nncc1'
>>> mol.HasSubstructMatch(Chem.MolFromSmarts(template))
True
>>> specific_template = '[n&D2]1[n&D2][n&D2][c][c]1'
>>> mol.HasSubstructMatch(Chem.MolFromSmarts(specific_template))
True

Cheers,
Scott

-----Original Message-----
From: Alfredo Quevedo <maquevedo....@gmail.com> 
Sent: Sunday, August 28, 2022 7:09 PM
To: RDKit Discuss <rdkit-discuss@lists.sourceforge.net>
Subject: [Rdkit-discuss] problem matching SMART pattern

Dear users,

I am trying to math a triazole scaffold using SMARTS notation. My code is shown 
below:

query = 'N1N=NC=C1'
template = '[NX3H1]1[N]=[N][C]=[C]1'
mol = Chem.MolFromSmiles(query)
mol.HasSubstructMatch(Chem.MolFromSmarts(template))

This results in 'False'. By depicting the structures I can see that the SMARTS 
pattern is not including the explicit hydrogen in the structure. 
However as long as I understand I am indicating the nitrogen atom to contain 
the explicit hydrogen ('[NX3H1]'). However the structure is show as aromatic.

Can anyone suggest what is wrong with my code? the SMARTS pattern or some 
keyword to make hydrogens explicit?

thanks in advance for the support,

regards

Alfredo



_______________________________________________
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

Reply via email to