Skip to content

Formal charge 1 is unrecognized #4027

@BradyAJohnston

Description

@BradyAJohnston

The charge from some PDB files is not recognised. Testing with PDB files from CHARMM-GUI that have their charges specified in a slightly different format cannot be parsed.

While I believe the 'official' way to specify charges is 1+ or 1- (which MDAnalysis reads), these PDB files have either 1 or -1 which gets the error :

ValueError: Formal charge 1 is unrecognized

Minimum file that DOESN'T work:

ATOM      1  N   MET A   1     173.150 193.330  29.890  0.00  0.00           N 1
ATOM      2  HT1 MET A   1     172.490 193.030  29.140  0.00  0.00           H-1

Minimum file that DOES work:

ATOM      1  N   MET A   1     173.150 193.330  29.890  0.00  0.00           N1+
ATOM      2  HT1 MET A   1     172.490 193.030  29.140  0.00  0.00           H1-

This breaks at the parsing stage for mda.Universe(file).

Both of the files can be parsed successfully in version 2.2.0, but 2.3.0+ introduced the formal charge parsing for the .pdb files which now breaks the import.

I am unsure if this is something that MDAnalysis would formally support, but if not, any suggestions for a fix that I could include in Molecular Nodes so I can bump the MDAnalysis version from 2.2.0 would be very much appreciated.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions