-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
consistent asu diffmap #49
base: main
Are you sure you want to change the base?
Conversation
I triggered a re-run of these tests due to the recent |
Before doing a code review, I want to better understand the issues/context here: My general philosophy for (1) and (4) is that each of these commandline tools should have a clear interface with well-defined input, in this case being "merged" reflection data in the correct ASU. I agree we should check these input assumptions hold, and in some cases, sanitizing the input if it is easy to do so. From what I can tell, at least (4) seems intended to make this code robust to an upstream error. I worry such changes could have unintended consequences for other sorts of input data (such as unmerged data), but I'm also open to discussion on this. |
Thanks for your thoughtful comments, Jack! I will review and respond in the next few days. |
So, the thing seems to be: I used phenix.fmodel to generate an MTZ with phases needed to phase my difference map. The phenix.fmodel output MTZ produces
I see the same with the output from phenix.refine directly. When I open these MTZs using |
(2) -- I do need the corresponding change to the ordinary difference map calculation as well. |
(1) I'm still a bit confused whether this is an issue in (2) I'm ok with this being an added mode in both cases, though I'm still a bit unsure of its use. I would think that having "incorrect" 0 entries would be more confusing than dropping them in the first place. (4) As with (1), this seems to me like an issue with user input that I don't think the library should support. I think it would be ok to detect such cases and raise an appropriate error. |
Summary:
(1)
For some non-canonical spacegroups (my case going from P21 21 21 to P21 1 1), Phenix and rs appear to not create consistent reciprocal space ASUs. By calling
.hkl_to_asu()
for each input MTZ, this PR ensures that the ASUs will be consistent. This affects both the calculation of ordinary and internal isomorphous difference maps.(2) for internal difference maps, I include a flag,
-u
or--union
, which if added leads the script to return a diffmap MTZ file created using theouter
flag during thepandas
merge
call. ColumnswDF
,DF
,SigDF
are set to 0 for entries where either contributing reflection is not available.(3) I added print statements:
subset_to_F_SigF
applies French-WIlson scaling.update:
(4) When splitting MTZs by symop and scaling them jointly, Miller indices related to themselves under a relevant symop will be present, in essence, inferred twice. When recombining the output MTZs, one can accidentally include these duplicate entries in the final MTZ (as I did). Although this is an upstream issue, I added a call to a new function (
remove_HKL_duplicates
) todiffmap.py and
internaldiffmap.py` which checks for the presence of rows with the same Miller indices, removes duplicate entries (except for the first occurrences), and sets merged=True on each MTZ.