Sanitization error while applying a reaction to an molecule with wedged bond. I am getting this error while applying a proton removal reaction to a molecule but I do not see any error in MolBlock information.
This is for a reaction problem in which I am trying to apply a simple reaction (proton removal) to a molecule given its isomeric SMILES.
I create a function to apply reaction using SMARTS and SMILES but I am getting the following error which I could not fixed.
I am using the following code to load my inputs.
smile = rdkit.Chem.rdmolfiles.MolToSmiles(mol,isomericSmiles=True)
which leads to:
C/C1=C\\C[C@@H]([C+](C)C)CC/C(C)=C/CC1
I create the following dictionary to use my SMILES and SMARTS:
reaction_smarts = {}
# proton removal reaction
reaction_smarts["proton_removal"] = "[Ch:1]-[C+1:2]>>[C:1]=[C+0:2].[H+]"
reactions = {name: AllChem.ReactionFromSmarts(reaction_smarts[name]) for name in reaction_smarts}
# function to run reactions
def run_reaction(molecule, reaction):
products = []
for product in reaction.RunReactant(molecule, 0):
Chem.SanitizeMol(product[0])
products.append(product[0])
return products
# apply reaction
products = run_reaction(cation_to_rdkit_mol["mol_name"], reactions["proton_removal"])
At this step I am getting this error but I cannot fix it.
RDKit ERROR: [10:43:23] Explicit valence for atom # 0 C, 5, is greater than permitted
Expected results should be the the molecule with the double bond and its stereoisomers:
First product: CC(C)=C1C/C=C(\\C)CC/C=C(\\C)CC1
Second product: C=C(C)[C@@H]1C/C=C(\\C)CC/C=C(\\C)CC1
Third product: C=C(C)[C@H]1C/C=C(\\C)CC/C=C(\\C)CC1
I am using Chem.EnumerateStereoisomers.EnumerateStereoisomers()
to get all stereoisomers but I am just getting the first and second product. I also added your initial proposal product[0].GetAtomWithIdx(0).SetNumExplicitHs(0)
which actually fix the Explicit valence error. But now I am trying to figure it out how to get all that three stereoisomers.
Any hint why this is happening?, cause if I check the mol block with all the info about valence it seems to be fine.