Skip to content

User defined scattering table overwrites base table #1102

@kbega

Description

@kbega

When providing a custom scattering table to phenix.fmodel, the base scattering table, i. e. neutron scattering length, is overwritten. In situations where the user intends to provide a single modified scattering length, e.g. for hydrogen, they need to also provide all other atom types' scattering lengths. Otherwise, the wrong values from the default table, here, X-ray, are kept, leading to an error message.

In the phenix unit test, this behavior can be triggered by providing a partial scattering table.

https://gitlab.com/phenix_project/phenix_regression/-/blob/master/refinement/tst_152.py?ref_type=heads

scat_neutron = """ H -15.340 """ #partial scattering table with higher value

produces

RuntimeError: child process stderr output:
  command: 'phenix.fmodel tst_152kb.pdb high_resolution=1.5 type=real r_free=0.1 custom_scattering_factors=tst_152kb.scat scattering_table=neutron output.file_name=tst_152kb.mtz >tst_152kb.log'
  Traceback (most recent call last):
    File "/lustre/orion/stf006/world-shared/kbegam/DNP2/phenix_installed/lib/python3.9/site-packages/mmtbx/command_line/fmodel.py", line 9, in <module>
      run_program(program_class=fmodel.Program)
    File "/lustre/orion/stf006/world-shared/kbegam/DNP2/phenix_installed/lib/python3.9/site-packages/iotbx/cli_parser.py", line 999, in run_program
      task.run()
    File "/lustre/orion/stf006/world-shared/kbegam/DNP2/phenix_installed/lib/python3.9/site-packages/mmtbx/programs/fmodel.py", line 429, in run
      mmtbx.utils.fmodel_from_xray_structure(
    File "/lustre/orion/stf006/world-shared/kbegam/DNP2/phenix_installed/lib/python3.9/site-packages/mmtbx/utils/__init__.py", line 1233, in __init__
      xray_structure.scattering_type_registry(
    File "/lustre/orion/stf006/world-shared/kbegam/DNP2/phenix_installed/lib/python3.9/site-packages/cctbx/xray/structure.py", line 1207, in scattering_type_registry
      raise RuntimeError(errmsg)
  RuntimeError: Mixed xray and neutron scattering table! 
    Element: H  a: ()  b: ()  c: -1.457
    Element: N  a: (2.77545321643, 1.37595750403, 1.06289560478, 1.03805703625, 0.625821830249, 0.120841771171)  b: (15.0644760293, 7.17746883597, 0.527446769306, 37.9622771317, 0.187618748878, 0.0471843880812)  c: 0.0
    Element: O  a: (2.91262062551, 2.58808134565, 0.98056775412, 0.696629143599, 0.685079864349, 0.136773884437)  b: (14.4846217841, 6.03817696541, 0.422545666842, 0.154463824621, 35.5389178226, 0.0384134680409)  c: 0.0

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