MDAnalysis / GridDataFormats

GridDataFormats is a pure Python library to handle data on a regular grid using commonly used file formats in molecular simulations.
https://mdanalysis.org/GridDataFormats
GNU Lesser General Public License v3.0
29 stars 18 forks source link

Bug in CCP4.py #57

Closed Digp closed 5 years ago

Digp commented 6 years ago

Hi guys! Great job with the package ;) I just found a bug when reading a couple of .ccp4 files. The _header_struct object in the CCP4 class is reading "ncstart", "nrstart" and "nsstart" as unsigned integers ("I") when they should be signed integers ("i"). (Lines 180 and 181 in CCP4.py.)

In example: in the PDB structure 1jzv, the 2fo-fc/EDS map (1jzv.ccp4), "ncstart" is 4294967292 when it should be -4, and "nrstart" is 4294967273 when it should be -23.

Hope it helps!

Diego

orbeckst commented 5 years ago

Thanks @Digp. Sorry for the slow reply.

If you are comfortable with fixing the code then please submit a pull request.

orbeckst commented 5 years ago

@Digp many thanks for the great bug report. Sorry it took a while but this should now be fixed in the upcoming 0.4.1 release.