I think the problem is that you specify exact, explicit hydrogen count on
the product end of your reaction SMARTS. Instead you can use this
(rxnSMARTS bolded):
rxn=AllChem.ReactionFromSmarts("
*[F][Zr@]([Cl])([Br])[CH2:1][C:2]([C:3])[C!H3:4].[CH2:5]=[CH1:6][C:7]>>[F][Zr@@]([Cl])([Br])[*:5][*@:6]([*:7])[*:1][*:2]([*:3])[*:4]*
")
products = rxn.RunReactants((Chem.MolFromSmiles("CCC[C@@H](C)C[Zr@
@](F)(Cl)Br"),Chem.MolFromSmiles("C=CC")))
display(products[0][0])
print(Chem.MolToSmiles(products[0][0]))
this gives
CCC[C@@H](C)C[C@@H](C)C[Zr@](F)(Cl)Br
which is a parsable valid SMILES.
The rxnSMARTS used above is also altered to give the (I think) intended
stereochemistry behavior: retain whatever configuration is in starting
product 1 and the newly introduce stereocenter (carbon 6) always give a
predefined configuration.
Some clarifying explanations of how reaction SMARTS are handled in RDkit
can be found in the rdkit book here.
https://www.rdkit.org/docs/RDKit_Book.html#chemical-reaction-handling
best wishes
wim
On Tue, May 30, 2023 at 8:04 PM Jarod Younker <[email protected]>
wrote:
> The following REACTIVE SMARTS:
>
> [F][Zr@]([Cl])([Br])[CH2:1][C@H:2]([C:3])[C!H3:4].[CH2:5]=[CH1:6][C:7]
> >>[F][Zr@@]([Cl])([Br])[CH2:5][C@H:6]([C:7])[CH2:1][C@H:2]([C:3])[C!H3:4]
>
> When reacting on the following two SMILES strings:
>
> CCC[C@@H](C)C[Zr@@](F)(Cl)Br and C=CC
>
> Gives the following SMILES product which cannot be sanitized ("explicit
> valence for atom # 10 C, 5, is greater than permitted"):
>
> CC[CH3][C@@H](C)C[C@@H](C)C[Zr@](F)(Cl)Br
>
> I don’t understand why? Could it be a bug? If not, what do I have wrong?
> _______________________________________________
> Rdkit-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss