Closed speleo3 closed 2 years ago
Thanks as always, Thomas! The method from RDKit is slightly unclear to me when I read; I assume that one implies only explicit bonds being used?
Thanks for merging, Jarrett! I agree that the documentation of RDKit::Atom::getDegree()
could be more clear. I had a look at their code to confirm that it counts the number of explicit bonds (It's the "out degree" on the molecular graph). What's a bit confusing is that in RDKit, the number of explicit hydrogens is also a stored property and they add that when computing getTotalDegree().
This is how I understand the equivalence of the different methods:
Number of explicit bonds | Number of explicit + implicit bonds | Sum of explicit bond orders | Sum of explicit + implicit bond orders | |
---|---|---|---|---|
PyMOL | explicit_degree |
valence |
explicit_valence |
|
OpenBabel | GetExplicitDegree() |
GetTotalDegree() |
GetExplicitValence() |
GetTotalValence() |
RDKit | GetDegree() |
GetTotalDegree() |
GetExplicitValence() |
GetTotalValence() |
Add
explicit_valence
(sum of bond orders) andexplicit_degree
(number of directly-bonded neighbors) tocmd.iterate
. These properties should be equivalent to OBAtom::GetExplicitValence(), OBAtom::GetExplicitDegree() and RDKit::Atom::getDegree().Example: