Add Hs to a reaction #3612
-
Hi, I have a SMARTS reaction that is a full reaction, i.e. it's not a pattern. I'd like to call AddHs on it so that when I draw this reaction, it draws it with the Hs (rather than putting a dot for the lone electrons). AddHs only takes a molecule. How do I do this? |
Beta Was this translation helpful? Give feedback.
Answered by
greglandrum
Dec 4, 2020
Replies: 2 comments
-
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
greglandrum
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If the only reason you want to add the Hs is to have the molecule drawn without radicals, it's easier to just set the
includeRadicals
flag to False:Notice that I'm also using the
fromSmiles
argument toReactionFromSmarts()
Actually adding Hs is more complicated and you need to come in from SMARTS instead of SMILES:
also notice that I've made the bond orders explicit in the input SMARTS
If you actually want to use SMILES as the input things get considerably more complicated. I'm not going to show that here because I'm not convinced it's actually useful.