cctbx / cctbx_project

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

mmtbx.command_line.mask (phenix.mask) doesn't work #938

Closed wojdyr closed 10 months ago

wojdyr commented 11 months ago

Hello,

When I tried to run a shell script from a few years ago I got such an error:

$ cctbx.python -m mmtbx.command_line.mask aa.pdb 
-------------------------------------------------------------------------------
phenix.mask: Given PDB file calculate bulk-solvent mask

How to run:
  phenix.mask model.pdb

-------------------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/wojdyr/miniforge3/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/wojdyr/miniforge3/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/wojdyr/miniforge3/lib/python3.10/site-packages/mmtbx/command_line/mask.py", line 53, in <module>
    run(args=sys.argv[1:])
  File "/home/wojdyr/miniforge3/lib/python3.10/site-packages/mmtbx/command_line/mask.py", line 44, in run
    mmtbx_masks_asu_mask_obj = mmtbx.masks.asu_mask(
TypeError: asu_mask.__init__() got an unexpected keyword argument 'n_real'

The signature of asu_mask.__init__() seem to has changed. The calling function was updated for example here: https://github.com/cctbx/cctbx_project/commit/2243cc9a24bc06c7f89ff3a5e927777a781121fa#diff-3f3f745e29616712b7e173ed18e25c5aaf137093fac8dec9189fdcfe69c1942d but not here: https://github.com/cctbx/cctbx_project/blob/4149890d6c5b6d9c4906d744553190bfa9c493d5/mmtbx/command_line/mask.py#L44-L46

dcliebschner commented 10 months ago

This should be fixed now.

bkpoon commented 10 months ago

You can try the fix in the nightly builds of the conda packages (only the most recent 5 builds are available, https://anaconda.org/cctbx-nightly/cctbx-base). You can try this command to update the cctbx-base in your active conda environment.

conda update -c cctbx-nightly cctbx-base

The update command should work with the latest build of cctbx-base from conda-forge. There was a change in the Boost libraries relatively recently, so if your environment has boost and boost-cpp, the update command may not work or may pick an earlier nightly build.

Alternatively, you can create a new environment with

conda create -n new_environment -c cctbx-nightly -c conda-forge cctbx-base

This will pull cctbx-base from the nightly build channel and all the other dependencies from conda-forge.

wojdyr commented 10 months ago

Thanks! I just forgot to close this issue.

bkpoon commented 10 months ago

No worries! The next release on conda-forge will have the fix.