Hello,
I think the error is in the placement of the $ in the SMARTS query, I am
not sure what is the purpose in there. if i run

reaction_smarts =
 
'[cX3]1[cX3][cX3][cX3]([NX3H2:1])[cX3]([NX3H2:2])[cX3]1>>[cX3]1[cX3][cX3][cX3][cX3]2[nX3:1]=[nX3]-[nX3H:2][cX3]12'
rxn = AllChem.ReactionFromSmarts(reaction_smarts)
product = rxn.RunReactants((reactant,))
Chem.SanitizeMol(product[0][0])
print(Chem.MolToSmiles(product[0][0]))
i get

c1ccc2[nH]nnc2c1


an alternative, somewhat shorter way to write this formation of a
benzotriazole would be:
reaction_smarts =
'c1ccc([NX3H2:1])c([NX3H2:2])[cX3]1>>c1cccc2[*:1]-[n]=[*:2]c12'

best wishes
wim



On Wed, Nov 23, 2022 at 3:36 PM Alfredo Quevedo <maquevedo....@gmail.com>
wrote:

> Dear users,
>
> I have been struggling for days trying to model a specific reaction but
> cannot succeed in matching the corresponding SMARTS notation, I am
> reproducing my code below,
>
> My molecule is:
>
> *reactant = 'c1ccc(N)c(N)c1'*
>
> I am trying to prepare a second ring by reacting the two primary amines.
> The final molecule should be:
>
> *product = 'c1cccc2nn[nH]c12'*
>
> In this way, I am setting the SMARTS reaction pattern as:
>
> *reaction_smarts =
> '[cX3]1[cX3][cX3][cX3]($[NX3H2:1])[cX3]($[NX3H2:2])[cX3]1>>[cX3]1[cX3][cX3][cX3][cX3]2$[nX3:1]=[nX3]-[nX3H:2]$[cX3]12'*
>
> And after running the reaction,
>
> *rxn = AllChem.ReactionFromSmarts(reaction_smarts)*
>
> *product = rxn.RunReactants((reactant,))*
>
> I am not getting no product at all,
>
> Any hint on what may be my problem would be greatly appreciated,
>
> Thank you very much in advance for the help,
>
> 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