You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Formal charge correction fails in the presence of bonds to metal ions #80
In correct_formal_charges_for_specified_atoms, the result of _get_bond_degree_per_atom is treated as a literal bond degree (in that its relation to default_valence yields formal charge). But in fact, it returns the biotite.structure.BondType enum; coordination bonds (those to metal ions) have the improbable bond order of 8.
As a result, there are PDBs that don't parse unless formal charges go uncorrected (9VAR; nitrogen with 'corrected' charge +8" fails some rdkit assertion) as well as PDBs that don't parse unless formal charges are corrected (9DAG; phosphorus with 'uncorrected' charge +2 fails a different rdkit assertion).
I'm not sure if there is a single clean fix available, since whether a coordination bond actually alters formal charge can involve a little bit of understanding of the metal being coordinated.
Thanks for raising this! It's a hairy problem that we have come across as well... probably best is to just trust the charge in the CIF file for metals, I can make this update
Activity
nscorley commentedon May 15, 2026
Thanks for raising this! It's a hairy problem that we have come across as well... probably best is to just trust the charge in the CIF file for metals, I can make this update
Merge pull request RosettaCommons#80 from baker-laboratory/hotfix/sse…
nscorley commentedon Oct 5, 2026
Fixed in #116. Coordination bonds contribute zero to covalent valence, rather than their enum value of eight. Verified that 9VAR and 9DAG parse with metal coordination enabled. Regression test.