Skip to content

Add Hs to a reaction #3612

Answered by greglandrum
thorlucas asked this question in Q&A
Discussion options

You must be logged in to vote

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 to ReactionFromSmarts()

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.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by greglandrum
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants