rs-station / reciprocalspaceship

Tools for exploring reciprocal space
https://rs-station.github.io/reciprocalspaceship/
MIT License
28 stars 11 forks source link

`hkl_to_asu` does not annotate M/ISYM field correctly #198

Closed ziyuanzhao2000 closed 1 year ago

ziyuanzhao2000 commented 1 year ago

Attached is an example mtz file generated from my workflow and it's computed from a structure that ideally should belong to P 21 21 21 (19) space group. So I expect to see four unique M/ISYM labels one for each symop from the space group. However, from the image below we see that hkl_to_asu did not assign the M/ISYM labels. Please kindly let me know if I'm doing anything wrong here and how to get the expected result. Thank you!

screen_shot_2022-12-21_at_4 37 40_pm

EF_10MV_cm_chainwise_zero_subtraj_0_avg.mtz.zip

JBGreisman commented 1 year ago

It looks to me like your input DataSet was already in spacegroup 19, and that all Miller indices were already in the asymmetric unit for that spacegroup:

In [1]: import reciprocalspaceship as rs

In [2]: ds = rs.read_mtz("EF_10MV_cm_chainwise_zero_subtraj_0_avg.mtz")

In [3]: ds.spacegroup
Out[3]: <gemmi.SpaceGroup("P 21 21 21")>

In [4]: all(rs.utils.in_asu(ds.get_hkls(), ds.spacegroup))
Out[4]: True

As such, ds.hkl_to_asu() did not use any symmetry operations to move the reflections to the asymmetric unit (or equivalently, just used the identity operator which is M/ISYM=1).

I'm not quite sure what you were trying to accomplish, but calling DataSet.hkl_to_asu() with data that is already in the proper ASU will always return a column with M/ISYM==1.

ziyuanzhao2000 commented 1 year ago

Hi Jack, thanks for the quick response! You are correct, and I now see this behavior is expected. I got myself a bit confused before because I have a different way of computing the reflections that gives a dataset with P1 symmetry and will give additional M/ISYM labels that allow me to assess data quality.