-
Notifications
You must be signed in to change notification settings - Fork 46
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
Attempted fix for cosym reindex bug #2486 #2548
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2548 +/- ##
=======================================
Coverage 78.80% 78.80%
=======================================
Files 609 609
Lines 74659 74688 +29
Branches 10623 10633 +10
=======================================
+ Hits 58832 58858 +26
- Misses 13649 13651 +2
- Partials 2178 2179 +1 |
I would appreciate @biochem-fan and @dwpaley testing this change on any interesting/tricky datasets that you have. In particular any multi-crystal monoclinic datasets with some distribution in the integrated unit cell values, maybe also increase the |
Wonderful! I tested this on another C-centered monoclinic dataset (unpublished) that caused problems before. |
@biochem-fan Super, thanks! I have just tested on @dagewa's data from #2530, which crashes due to cosym working in MX space groups (P 1 2/m 1 != P 1 21/m 1), but apart from that seems to work, so working on adding a fix to this PR for non-MX space groups now.... |
This looks great. One comment about the procedure to determine |
Not necessarily. I often use cosym to sort out indexing ambiguities in small wedge datasets. |
@dwpaley you make an astute observation. The original cells have been mapped to a reduced cell, which is symmetrized. The tests only use one cell value, but if there were a distribution in cell parameters but with symmetry enforced, the first two cases would still have a symmetrized median cell. If the input were indexed in P1 but the true cell is high symmetry.... I need to think a bit more about exactly what is going to happen.... |
I've been giving this some thought, and I believe there is no issue with the fundamental cosym symmetry analysis, rather we are just not ensuring that we are outputting in the standard setting.
In some of the example cases highlighted, where the lattice symmetry is higher than the best cell (within tolerance of
lattice_symmetry_max_delta
), the cosym procedure can reindex into a valid but non-conventional cell. So we have to then recalculate what is the input-to-best cell transformation after the cosym procedure, in order to apply it correctly and recover the standard setting. I don't believe it is possible to reliably do this when choosing the seeds for the cosym reindexing.This change correctly processes the two examples - the 5AUI example and Dan's failing-input-single, and all the cosym command line tests pass. Note I have temporarily commented out the recent change that stops cosym being run on single datasets, just for testing purposes.
I plan to add some full tests to this PR to demonstrate the fix and stop regressions. I still need to think about a few of the FIXME's in the
change_of_basis_ops_to_best_cell
function, but wanted to get this out so people can test and comment.This has highlighted to me that we probably also want to reduce
lattice_symmetry_max_delta
(defaut 5). I think we can accurately index to a much higher tolerance, as we only want to catch datasets here which really could be misindexed. I note the default in dials.symmetry is 2, and I recently changed the default down from 2 to 0.5 in xia2.ssx for example because it was catching too many cases that didn’t need accidental-ambiguity assessment.We could definitely do with better documentation on this confusing/complicated program too.
Fixes #2486