Skip to content
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

rs.utils.asu.in_asu() does not use the 'anomalous ASU' for stacked anomalous data. #194

Closed
DHekstra opened this issue Oct 28, 2022 · 1 comment
Labels
documentation Issue related to documentation

Comments

@DHekstra
Copy link
Contributor

DHekstra commented Oct 28, 2022

Not sure if this is an "issue" or not, but

this works:

`mtz="thermolysin_0.mtz"
ds =rs.read_mtz(mtz_path+mtz)

ds.compute_dHKL(inplace=True)
ds=ds.loc[(ds.dHKL>=custom_range[0]) & (ds.dHKL< custom_range[1]),ds.columns]
ds, labels = ds.assign_resolution_bins(nbins) # adds resolution bins

completeness=rs.stats.completeness.compute_completeness(ds.hkl_to_asu(inplace=False,anomalous=True),
bins=nbins, anomalous=True)
completeness.head(nbins)`

but this fails:

`mtz="thermolysin_0.mtz"
ds =rs.read_mtz(mtz_path+mtz)

ds.compute_dHKL(inplace=True)
ds=ds.loc[(ds.dHKL>=custom_range[0]) & (ds.dHKL< custom_range[1]),ds.columns]
ds, labels = ds.assign_resolution_bins(nbins) # adds resolution bins

ds=ds.stack_anomalous()
completeness=rs.stats.completeness.compute_completeness(ds.hkl_to_asu(inplace=False,anomalous=True),
bins=nbins, anomalous=True)
completeness.head(nbins)`

The problem seems to be that the assumption is baked in that the user provides unstacked data such that in_asu, called on line 107 of compute_completenes() (see https://github.com/Hekstra-Lab/reciprocalspaceship/blob/98409cc8552d22d03d6100c6c1dd01cc369e9647/reciprocalspaceship/stats/completeness.py#L107) can use the +ASU, after which the data are stacked.

This is probably perfectly fine behavior. The main thing to do would be to add a comment to the doc string that the output should not be stacked.

@DHekstra DHekstra added the documentation Issue related to documentation label Oct 28, 2022
@JBGreisman
Copy link
Member

yep I agree with you that it should at least be clarified in the docstring that merged DataSet objects should be provided in two-column anomalous format.

I will have to think a bit harder about whether one-column anomalous data should be supported.

JBGreisman added a commit that referenced this issue Aug 3, 2023
Fixes #194: Update rs.utils.in_asu() docstring to clarify behavior
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issue related to documentation
Projects
None yet
Development

No branches or pull requests

2 participants