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)
Change History (3)
by , 3 years ago
comment:1 by , 3 years ago
Status: | assigned → accepted |
---|
comment:2 by , 3 years ago
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
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
PDB file with /A:12@CB x coordinate changed to "nan", reads without error.