You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to transform some molecules within a specific pattern defined by the next smirks reaction:
[CX4,CX3,NX2,NX3,NX4+:1]-,=[#6;A;X4H2,X3H1:2]#6;A;X4:3([H:5])[#8;A;X2:4][H]>>[CX4,CX3,NX2,NX3,NX4+:1]-,=[#6;A;X4H2,X3H1:2]#6;A;X3:3=[#8;A;X1:4]
This transformation is defined by the next graph:
There is a molecule to test this issue defined by the next SMILES CC1=CC=2CC(C)(C)CC2C(CO)=C1CCO that has 2 substructures matching.
However, the pattern does not find any substructure as well and, as a consequence, it does not run the reaction on the input SMILES.
And the results of products_src should return the molecule transformed, but it is empty.
The issue does not look to happen when the matching happens in the full structure or when there is no * in the left side of the smirks reaction definition.
Expected behavior
The substructure should be matched and it should return it using the
GetSubstructMatch(Mol) method from mol class or the RunReactants((ChemicalReaction)self, (tuple)reactants[, (int)maxProducts=1000]) method from the reaction class
Screenshots
Configuration (please complete the following information):
RDKit version: 2023.09.3
OS: Ubuntu 22.04
Python version (if relevant): 3.11.6
Are you using conda? Yes
If you are using conda, which channel did you install the rdkit from? rdkit
Additional context
The text was updated successfully, but these errors were encountered:
This is almost definitely happening because the reaction smarts includes explicit H atoms and you haven't added Hs to the molecule before calling runReactants
Is not the Chem.AddHs() mol.UpdatePropertyCache calculating them?
In the issue from 4 years ago someone wanted to do the same thing and they commented: #2512
"rdkit.Mol from SMARTS assigns incorrect aromaticity flags for some atoms and bonds (GetIsAromatic), which may be the cause of the problem"
I need to transform some molecules within a specific pattern defined by the next smirks reaction:
[CX4,CX3,NX2,NX3,NX4+:1]-,=[#6;A;X4H2,X3H1:2]#6;A;X4:3([H:5])[#8;A;X2:4][H]>>[CX4,CX3,NX2,NX3,NX4+:1]-,=[#6;A;X4H2,X3H1:2]#6;A;X3:3=[#8;A;X1:4]
This transformation is defined by the next graph:
There is a molecule to test this issue defined by the next SMILES CC1=CC=2CC(C)(C)CC2C(CO)=C1CCO that has 2 substructures matching.
However, the pattern does not find any substructure as well and, as a consequence, it does not run the reaction on the input SMILES.
To Reproduce
source_mol = Chem.MolFromSmiles('CC1=CC=2CC(C)(C)CC2C(CO)=C1CCO')
reaction = rdChemReactions.ReactionFromSmarts('[CX4,CX3,NX2,NX3,NX4+:1]-,=[#6;A;X4H2,X3H1:2]#6;A;X4:3([H:5])[#8;A;X2:4][H]>>[CX4,CX3,NX2,NX3,NX4+:1]-,=[#6;A;X4H2,X3H1:2]#6;A;X3:3=[#8;A;X1:4]')
reacts = (source_mol,)
products_src = reaction.RunReactants(reacts)
And the results of products_src should return the molecule transformed, but it is empty.
The issue does not look to happen when the matching happens in the full structure or when there is no * in the left side of the smirks reaction definition.
Expected behavior
The substructure should be matched and it should return it using the
GetSubstructMatch(Mol) method from mol class or the RunReactants((ChemicalReaction)self, (tuple)reactants[, (int)maxProducts=1000]) method from the reaction class
Screenshots
Configuration (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: