cctbx / cctbx_project

Computational Crystallography Toolbox
https://cci.lbl.gov/docs/cctbx
Other
208 stars 111 forks source link

Software name retrieval causes the mmcif parser to fail #937

Closed aozalevsky closed 7 months ago

aozalevsky commented 8 months ago

The attempt to retrieve the refinement software name from mmCIF files:

https://github.com/cctbx/cctbx_project/blob/a6ee7226b24817752953f2047a15b906be3c1390/iotbx/pdb/mmcif.py#L502C1-L503C1

Fails on files without one:

  File "/opt/molprobity/modules/cctbx_project/iotbx/pdb/mmcif.py", line 502, in get_program_name
    if i >= 0: return software_name[i]
TypeError: '>=' not supported between instances of 'NoneType' and 'int'

According to the dictionary neither the refinement software nor the software category is required to be present in a valid PBDx/mmCIF file.

For instance, this causes Molprobity (which relies on the cctbx) to fail on totally valid RCSB PDB or PDB-DEV files.

olegsobolev commented 7 months ago

Thanks for pointing this out. Fixed: https://github.com/cctbx/cctbx_project/commit/df5275df66dbcba658658f16a482ece663a278a5 .