rs-station / matchmaps

https://rs-station.github.io/matchmaps/
Other
2 stars 0 forks source link

"Provided DataSets are not isomorphous" error while running scaleit on the on mtz #43

Closed ncara closed 3 months ago

ncara commented 6 months ago

Description

"Provided DataSets are not isomorphous" error raised while trying to run matchmaps on a specific set of mtz files, during the scaleit run on the mtzon file. Both datasets are in space-group 19, and have a ~5A difference on the C axis. Matchmaps has previously worked on data from the same targer, with a similar Unit-Cell parameter difference. Both datasets are produced by serial crystallography (monochromatic, at a synchrotron) and were truncated with ctruncate (CCP4).

What I Did


> matchmaps --mtzoff my_mtzoff-unique1.mtz F SIGF --mtzon my_mtzon.mtz F SIGF --pdboff my_pdboff.pdb --output-dir output/ --script output/ --dmin 1.70 --verbose --keep-temp-files output/ --ligand CRC.cif --script test

10:32:59: Running scaleit to scale 'on' data to 'off' data...
Number of common reflections: 78414
Traceback (most recent call last):
  File "/home/esrf/ncaramel/.conda/envs/mm_dFo/bin/rs.scaleit", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/esrf/ncaramel/.conda/envs/mm_dFo/lib/python3.11/site-packages/rsbooster/scaleit/scaleit.py", line 142, in main
    joined = rs.concat([ref.loc[common]] + mtzs, axis=1)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/esrf/ncaramel/.conda/envs/mm_dFo/lib/python3.11/site-packages/reciprocalspaceship/concat.py", line 37, in concat
    raise ValueError("Provided DataSets are not isomorphous")
ValueError: Provided DataSets are not isomorphous
Traceback (most recent call last):
  File "/home/esrf/ncaramel/.conda/envs/mm_dFo/bin/matchmaps", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/esrf/ncaramel/.conda/envs/mm_dFo/lib/python3.11/site-packages/matchmaps/_compute_realspace_diff.py", line 466, in main
    compute_realspace_difference_map(
  File "/home/esrf/ncaramel/.conda/envs/mm_dFo/lib/python3.11/site-packages/matchmaps/_compute_realspace_diff.py", line 135, in compute_realspace_difference_map
    mtzon_scaled_py = rs.read_mtz(str(mtzon_scaled))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/esrf/ncaramel/.conda/envs/mm_dFo/lib/python3.11/site-packages/reciprocalspaceship/io/mtz.py", line 187, in read_mtz
    gemmi_mtz = gemmi.read_mtz_file(mtzfile)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] Failed to open output/my_mtzon_scaled.mtz: No such file or directory

Many thanks in advance for your help with this, the program is fantastic has has worked beautifully for me up to that point !

dennisbrookner commented 6 months ago

Hi! Thank you for the kind words and for raising this issue. Given the nature of the expected inputs for matchmaps, this is an important one to fix!

The good news is that the method which raises the error (https://github.com/rs-station/reciprocalspaceship/blob/main/reciprocalspaceship/concat.py) offers the option check_isomorphous=False, which would allow the above to run successfully.

The bad news is that the rs.concat method is being called not directly by matchmaps, but rather by a utility in the rs-booster package (https://github.com/rs-station/rs-booster/blob/main/rsbooster/scaleit/scaleit.py). The rs-booster function does not expose the check_isomorphous flag to the user. All that to say, this is fixable, but it will require me to first push a change to rs-booster before I can actually fix the bug in matchmaps.

I'll get this started today, and continue to update this thread as progress is made!

dennisbrookner commented 6 months ago

@ncara this bug should now be fixed! Please let me know if it is working now, whenever you get a chance.

Note that currently, the bug fix relies on a development version of the rs-booster package, and the dependencies can be a little finicky. I recommend installing matchmaps as

pip install git+https://github.com/rs-station/matchmaps.git

in a fresh environment; this should pull the correct versions of everything. In an existing environment, no guarantees!

To make sure you have the right rs-booster version, you can call

rs.scaleit -h

If the help message contains the --ignore-isomorphism option, you should be good to go; if not, you will need to update rs-booster via

pip install git+https://github.com/rs-station/rs-booster.git

I'm going to leave this issue open until everything is on PyPI. Thanks for bearing with this!

dennisbrookner commented 3 months ago

Update: I just published rs-booster 0.1.2 to PyPI, which includes the relevant update to the rs.scaleit command. It should no longer be necessary to use a development build of rs-booster.

Next up, I will push a new release of matchmaps.

dennisbrookner commented 3 months ago

As of matchmaps 0.6.3, this issue is resolved.