Skip to content

Formal charge correction fails in the presence of bonds to metal ions #80

@everyday847

Description

@everyday847

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.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions