Opened 3 years ago

Closed 3 years ago

#8030 closed enhancement (fixed)

PDB file reader accepts "nan" coordinates without warning

Reported by: Tom Goddard Owned by: pett
Priority: moderate Milestone:
Component: Input/Output Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

A few times we have seen users open PDB files which have coordinates listed as "nan", probably from energy minimization. ChimeraX gives no warning and simply sets the coordinates to NaN which of course blows up almost any later code that tries to use it. The source of the error is then pretty unclear. It would be better if the PDB reader gave an error about NaN coordinates so the user knows what went wrong. But if it slows the PDB reader down it is probably not worth it.

Ticket #8014 is an example of this problem.

I'll attach a PDB file where I changed the x coordinate of /A:12@CB nan for testing.

Attachments (1)

1a0m.pdb (47.3 KB ) - added by Tom Goddard 3 years ago.
PDB file with /A:12@CB x coordinate changed to "nan", reads without error.

Download all attachments as: .zip

Change History (3)

by Tom Goddard, 3 years ago

Attachment: 1a0m.pdb added

PDB file with /A:12@CB x coordinate changed to "nan", reads without error.

comment:1 by pett, 3 years ago

Status: assignedaccepted

comment:2 by pett, 3 years ago

Resolution: fixed
Status: acceptedclosed

Use numpy.isnan() to check the coordinates coming from the PDB reader. Takes 0.002 seconds for 1jj2, so that seems okay.

Fix: https://github.com/RBVI/ChimeraX/commit/7ada17d0a332f937108dbb0fbe4dd82616ea4133

Note: See TracTickets for help on using tickets.