Skip to content

Inconsistence in perception of rotatable bonds before and after adding hydrogens #3776

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

You must be logged in to vote

Hi @rubbs14,
Here's a much simpler version of what you're asking about:

>>> m = Chem.MolFromSmiles('CCCO')
>>> mh = Chem.AddHs(Chem.MolFromSmiles('CCCO'))
>>> rdMolDescriptors.CalcNumRotatableBonds(m,strict=True)
1
>>> rdMolDescriptors.CalcNumRotatableBonds(mh,strict=True)
3

This is expected behavior. The num_rotatable_bonds descriptor, like many of RDKit's other "2D" functions, is assuming that you are operating on a molecule which does not have Hs in the graph.
Unless you have a very particular reason for not doing so, I do suggest making sure you've either called RemoveHs() or have parsed the molecule without changing the default options (which remove Hs).

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rubbs14
Comment options

Answer selected by greglandrum
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