Build Packages / Create release (push) Successful in 7s
Build Packages / build:portable:macos-arm64:nocuda (push) Successful in 4m56s
Build Packages / build:rugnux:linux-aarch64:cuda (push) Successful in 9m10s
Build Packages / build:portable:linux-x86_64:nocuda (push) Successful in 13m51s
Build Packages / build:portable:linux-x86_64:cuda (push) Successful in 16m56s
Build Packages / build:jfjoch:rocky8:nocuda (push) Successful in 20m59s
Build Packages / build:portable:windows-x86_64:nocuda (push) Successful in 21m25s
Build Packages / build:jfjoch:rocky9:nocuda (push) Successful in 21m17s
Build Packages / build:jfjoch:ubuntu2204:nocuda (push) Successful in 14m14s
Build Packages / HDF5 consumer tests (DIALS, XDS) (push) Successful in 25m59s
Build Packages / build:portable:windows-x86_64:cuda (push) Successful in 25m48s
Build Packages / build:jfjoch:ubuntu2404:nocuda (push) Successful in 15m52s
Build Packages / build:jfjoch:rocky8:cuda-sls9 (push) Successful in 19m33s
Build Packages / Generate python client (push) Successful in 29s
Build Packages / Build documentation (push) Successful in 1m19s
Build Packages / build:jfjoch:ubuntu2204:cuda (push) Successful in 20m49s
Build Packages / build:jfjoch:rocky9:cuda-sls9 (push) Successful in 25m31s
Build Packages / build:jfjoch:rocky8:cuda (push) Successful in 25m24s
Build Packages / build:jfjoch:rocky9:cuda (push) Successful in 26m5s
Build Packages / build:jfjoch:ubuntu2404:cuda (push) Successful in 22m19s
Build Packages / Unit tests (push) Failing after 2h28m24s
Build Packages / Validation Battery (push) Successful in 40m33s
* Rugnux: Processes a collection live while jfjoch_broker writes it (`rugnux <master.h5> <broker URL>`). * Rugnux: Processing starts on the first images and confirms its choices once all are in, so analysis can begin during collection. * Rugnux: Faster processing, especially on servers with several GPUs and CPU sockets and on computers without a GPU (`--no-gpu`, macOS). * Rugnux: Uses much less GPU memory, so large data sets stay on the GPU of smaller cards, and a data set too large for the card is processed on the CPU instead. * Rugnux: On macOS, Bragg integration runs on the Apple GPU. * Rugnux: Better handling of twinning and pseudo-symmetry, with the twin hypothesis written as `<prefix>_twin_<SG>.mtz`, and a wrong `--model` no longer confirms the data or decides the hand. * Rugnux: `--model` accepts predicted (AlphaFold) models and falls back to molecular replacement when the model is not placed as a rigid body (experimental `--mr` forces it), settling space group, hand and twinning and writing a different answer as `<prefix>_mr.mtz`. * Rugnux: Molecular replacement is faster and settles the space group in more cases with several copies in the asymmetric unit. * Rugnux: Deposition-ready mmCIF, a richer report, and numbered steps on the terminal with the full log in `<prefix>_log.txt`; `_P1.mtz`, `--estimate-beam-center` and `--beam-center-search` are removed. * Rugnux: The beam-stop shadow is found correctly on tilted detectors. * Rugnux: Stills files that record a stationary goniometer axis get the default stills geometry refinement. * jfjoch_viewer: "Analyze dataset" uses the same defaults as a bare `rugnux <file>`, and shows the results of processed CBF, marCCD and SMV sweeps. * jfjoch_viewer: The Files panel refreshes on F5 and every few seconds, and the plot type and other selections stay put during live collection. * jfjoch_writer: Memory stays bounded and old data files are closed efficiently on long runs, any failure ends the run in an error state the broker is told about, and the master file appears only after its data files; the ZeroMQ pusher logs when a stalled writer makes it drop images. * Fixes: The TCP image pusher no longer blocks the broker's receiver, GPU out-of-memory failures stop with a clear message, and the XDS plugin masks module and chip edges. --------- Co-authored-by: Filip Leonarski <jungfrau@filips-mac-mini.home> Reviewed-on: #85 Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>
77 lines
3.6 KiB
Python
77 lines
3.6 KiB
Python
"""Which space-group differences a diffraction experiment could actually have decided.
|
|
|
|
A merged dataset sees only (a) which reflections are equivalent in intensity - the rotation parts
|
|
of the operations together with their negatives (Friedel's law), i.e. the Laue group in its real
|
|
orientation - and (b) which are systematically absent. Two space groups agreeing on both cannot be
|
|
told apart without solving the structure (or an anomalous signal strong enough to break Friedel's
|
|
law). Two families:
|
|
- same point group: body centring is the usual culprit - h+k+l=2n already forces h00: h=2n, so a
|
|
2_1 along <100> adds nothing (I222 = I212121); and the two hands of an enantiomorphic pair.
|
|
- different point groups of one Laue class with the same absences: acentric vs centric (P2 vs
|
|
P2/m, Pc vs P2/c, Pna21 vs Pnam) and the two acentric groups of one class (I41md vs I-42d).
|
|
|
|
The comparison is made per setting: two numbers are related if some setting of the one agrees with
|
|
some setting of the other (Pna21 matches Pnma as Pnam, not in the standard settings of both).
|
|
"""
|
|
import gemmi, collections
|
|
|
|
_N = 7
|
|
_HKL = [(h, k, l) for h in range(-_N, _N+1) for k in range(-_N, _N+1) for l in range(-_N, _N+1)
|
|
if (h, k, l) != (0, 0, 0)]
|
|
|
|
def signature(sg):
|
|
"""What the intensities of a crystal in this space group (a gemmi.SpaceGroup, in its setting)
|
|
can show: the Laue rotations, the centring and the absences."""
|
|
ops = sg.operations()
|
|
rots = [tuple(map(tuple, op.rot)) for op in ops]
|
|
return (frozenset(rots) | frozenset(tuple(tuple(-x for x in row) for row in r) for r in rots),
|
|
frozenset(tuple(t) for t in ops.cen_ops),
|
|
tuple(ops.is_systematically_absent(h) for h in _HKL))
|
|
|
|
_SIGS = collections.defaultdict(set) # number -> the signatures of its settings
|
|
_by_sig = collections.defaultdict(set)
|
|
for _sg in gemmi.spacegroup_table():
|
|
_s = signature(_sg)
|
|
_SIGS[_sg.number].add(_s)
|
|
_by_sig[_s].add(_sg.number)
|
|
CLASS = collections.defaultdict(set)
|
|
for _s in _by_sig.values():
|
|
for _n in _s:
|
|
CLASS[_n] |= _s - {_n}
|
|
|
|
def indistinguishable(a, b):
|
|
"""True if intensities alone could never have separated these two space groups (numbers), in
|
|
some setting of each."""
|
|
return a == b or b in CLASS.get(a, ())
|
|
|
|
def same_intensities(sg, number):
|
|
"""True if some setting of space group `number` shows exactly what `sg` (a gemmi.SpaceGroup, in
|
|
its own setting) shows: the same Laue rotations and the same absences."""
|
|
return signature(sg) in _SIGS[number]
|
|
|
|
def point_group(n):
|
|
return gemmi.find_spacegroup_by_number(n).point_group_hm()
|
|
|
|
def enantiomorphic(a, b):
|
|
"""True if the pair differs only by hand - anomalous signal can break it, absences cannot."""
|
|
return (indistinguishable(a, b) and a != b and point_group(a) == point_group(b)
|
|
and gemmi.find_spacegroup_by_number(a).is_enantiomorphic())
|
|
|
|
def describe(a, b):
|
|
if a == b: return "match"
|
|
if enantiomorphic(a, b): return "hand only (needs anomalous)"
|
|
if indistinguishable(a, b):
|
|
if point_group(a) == point_group(b): return "UNDECIDABLE from intensities"
|
|
return "point group UNDECIDABLE from intensities (same Laue class and absences)"
|
|
return "REAL difference (absences differ)"
|
|
|
|
if __name__ == "__main__":
|
|
seen = set()
|
|
for n, s in sorted(CLASS.items()):
|
|
s = frozenset(s | {n})
|
|
if len(s) < 2 or s in seen: continue
|
|
seen.add(s)
|
|
ns = sorted(s)
|
|
print(" ", " = ".join("%d %s" % (i, gemmi.find_spacegroup_by_number(i).hm) for i in ns),
|
|
" ->", "; ".join(describe(ns[0], i) for i in ns[1:]))
|