Skip to content

KeyError: '112' in calculate_z_order #17

@pmiddend

Description

@pmiddend

I'm getting this error:

  File "/opt/xray/ccp4-8.0/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/opt/xray/ccp4-8.0/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/opt/xray/ccp4-8.0/lib/python3.7/site-packages/dimple/__main__.py", line 4, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/opt/xray/ccp4-8.0/lib/python3.7/site-packages/dimple/main.py", line 894, in main
    dimple(wf=wf, opt=options)
  File "/opt/xray/ccp4-8.0/lib/python3.7/site-packages/dimple/main.py", line 197, in dimple
    vol_ratio = (mtz_meta.asu_volume() /
  File "/opt/xray/ccp4-8.0/lib/python3.7/site-packages/dimple/cell.py", line 26, in asu_volume
    z = calculate_z_order(self.symmetry)
  File "/opt/xray/ccp4-8.0/lib/python3.7/site-packages/dimple/cell.py", line 290, in calculate_z_order
    return _centering_n[hm[0]] * _pg_symop[pg]
KeyError: '112'

Using the ccp4-8.0 version of dimple. You can reproduce the problem with the two files inside this zip file and with this command line:

dimple --hklout output-dimple.mtz --xyzout output-dimple.pdb input-mtz-rescut.mtz base-model.pdb .

Is it something about the mtz file (specifically the unit cell info) that's tripping dimple up? mtzdmp gives:

Space group = 'P 1 1 2' (number     1003)

So the code then tries to do _pg_symop['112'] in

def calculate_z_order(hm):
    pg = ''.join(a[0] for a in hm.split()[1:])
    return _centering_n[hm[0]] * _pg_symop[pg]

(with hm = "P 1 1 2"), but _pg_symop:

_pg_symop = {'1': 1,
             '2': 2, '121': 2,
             '222': 4,
             '4': 4,
             '422': 8,
             '3': 3,
             '32': 6, '312': 6, '321': 6,
             '6': 6,
             '622': 12,
             '23': 12,
             '432': 24,
             }

does not contain this key. Should it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions