From 344e5695001a4e6eaf5404fb572d7ff885a43db4 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Mon, 9 Nov 2026 17:29:30 +0100 Subject: [PATCH] Stills -C hypothesis: decide on the sampled spots on the lattice alone Started from the de novo fit's detector, a cell 5% too long with its beta 4 degrees off settled within 0.3% of the de novo distance while putting 6% as many sampled spots on the lattice, so "same detector" did not tell a minority crystal form from a cell of the wrong shape and kept the wrong one. The cell given is now kept where it puts at least 0.9x as many sampled spots on the lattice as the de novo cell, and otherwise the run is processed as without -C. Docs say that a minority form given with -C is dropped too where the de novo cell describes the majority well enough to index materially more spots. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HVeDQsU5a8AJUdJPgWevAK (cherry picked from commit 6e3e18cca5965481e032e09e2d956bb9d9766619) --- docs/CPU_DATA_ANALYSIS_INDEXING.md | 10 +++++----- docs/RUGNUX_CLI.md | 2 +- docs/RUGNUX_MODEL_AND_REFERENCE.md | 2 +- rugnux/RugnuxStills.cpp | 16 +++++----------- 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/docs/CPU_DATA_ANALYSIS_INDEXING.md b/docs/CPU_DATA_ANALYSIS_INDEXING.md index 673df990d..ca5cd6cf9 100644 --- a/docs/CPU_DATA_ANALYSIS_INDEXING.md +++ b/docs/CPU_DATA_ANALYSIS_INDEXING.md @@ -432,11 +432,11 @@ from the detector distance, centre and module placement that fit found: from a s can settle as far off as it started, and the de novo fit, whose cell takes up the start's error, is the nearer start for any cell of the sample. Each, with its refined cell and geometry, then indexes the same sample of frames. The cell given is kept where -it puts at least 0.9 times as many of the sample's spots on the lattice, and also where it does not but -its fit puts the detector within 2 % of where the de novo fit puts it: the detector is the same for every -crystal of the run, so such a cell is a crystal form of the sample (possibly a minority one, which the -user may be after). A cell that fits only with a detector of its own describes no crystal of the sample, -and the run is then processed as without `-C`, with a warning. +it puts at least 0.9 times as many of the sample's spots on the lattice as the de novo cell does. A cell given +that does not describe the frames - the same lattice in a shape they do not have, which the fit cannot leave +because the frames were indexed on it - fails this, and the run is then processed as without `-C`, with a warning. So does a minority crystal form +given with `-C` where the frames' de novo cell describes the majority well enough to index materially more of +the sample's spots. **One crystal form.** A sample can hold two crystal forms, and a known-cell indexer fits both to the given cell's orientation search; their refined cells then fall into two volume populations, and diff --git a/docs/RUGNUX_CLI.md b/docs/RUGNUX_CLI.md index 3c1dc4895..d09fd2dcc 100644 --- a/docs/RUGNUX_CLI.md +++ b/docs/RUGNUX_CLI.md @@ -264,7 +264,7 @@ For very long axes the direction grid's angular resolution binds well below 500 | `--force-still` | Treat a rotation (goniometer) dataset as independent stills instead of rotation | | `-X, --indexing-algorithm ` | `Auto` (default) \| `FFT` \| `cuFFT` \| `FFTW` \| `FFBIDX` \| `None`, case-insensitive. `FFT` is the de-novo FFT search, on the GPU (cuFFT) where there is one and `--no-gpu` is not given, otherwise on the CPU (FFTW); `cuFFT` and `FFTW` name one implementation each; `cuFFT` needs a GPU and is refused without one. `FFBIDX` (known cell, `-C`) runs on the GPU where there is one and otherwise on the CPU. `Auto` takes `FFBIDX` on stills with a known cell, and `FFT` otherwise; rotation data always use the FFT search | | `-F` | Short for `-X FFT`, kept for old command lines | -| `-C, --unit-cell ` | Reference unit cell `"a,b,c,alpha,beta,gamma"` (required by `ffbidx`). On rotation data it also widens the FFT search to cover the cell given, at both ends: the longest axis looked for is raised to reach it, and `--fft-min-unit-cell` is lowered to admit it. A candidate that is an integer supercell of the cell given (a twin's coincidence lattice, a row taken at a multiple of its length) is stepped down to it. On stills the geometry refinement takes it as a prior (1 % on the lengths, 1° on the angles the crystal system leaves free) and tests it against the cell the frames index to de novo: a cell that fits the frames only with a detector distance of its own (more than 2 % from the de novo fit's) and puts fewer than 0.9 times as many sampled spots on the lattice is dropped with a warning, and the run is processed as without `-C` ([§7.7](CPU_DATA_ANALYSIS_INDEXING.md#77-stills-a-given-cell-and-the-detector-modules)) | +| `-C, --unit-cell ` | Reference unit cell `"a,b,c,alpha,beta,gamma"` (required by `ffbidx`). On rotation data it also widens the FFT search to cover the cell given, at both ends: the longest axis looked for is raised to reach it, and `--fft-min-unit-cell` is lowered to admit it. A candidate that is an integer supercell of the cell given (a twin's coincidence lattice, a row taken at a multiple of its length) is stepped down to it. On stills the geometry refinement takes it as a prior (1 % on the lengths, 1° on the angles the crystal system leaves free) and tests it against the cell the frames index to de novo: a cell that, refined from the geometry the de novo fit found, puts fewer than 0.9 times as many sampled spots on the lattice as the de novo cell is dropped with a warning, and the run is processed as without `-C` ([§7.7](CPU_DATA_ANALYSIS_INDEXING.md#77-stills-a-given-cell-and-the-detector-modules)) | | `--fft-min-unit-cell ` | Shortest cell axis the FFT search accepts, Å (default: 10). A candidate with a shorter axis is discarded — but on rotation data a row shorter than the floor, down to 3 Å, is recognised under the multiple of it the search reports past the floor, so a small-molecule cell is indexed without this flag. `-C` lowers the floor on its own to cover the cell given. On stills a crystal below the floor cannot be indexed unless this is lowered | | `--min-indexed-spots ` | Spots a frame must have on the lattice before it counts as indexed (default: 6, minimum 4). It sets the reported indexing rate and the count the rotation first pass ranks candidate lattices by; whether the run has a lattice at all is decided on the pooled spots instead ([§4.1](CPU_DATA_ANALYSIS_INDEXING.md#41-indexed-spot-decision-inlier-test)), and integration is not gated by it | | `-S, --space-group ` | Space group number (`96`) or Hermann-Mauguin symbol (`P43212`) — for indexing and scaling. On serial stills whose group admits two indexings, it also lets the crystals be put on one from the data ([the indexing ambiguity](RUGNUX_ADVANCED.md#the-indexing-ambiguity)) | diff --git a/docs/RUGNUX_MODEL_AND_REFERENCE.md b/docs/RUGNUX_MODEL_AND_REFERENCE.md index d68ff1dd5..9e7dfd77a 100644 --- a/docs/RUGNUX_MODEL_AND_REFERENCE.md +++ b/docs/RUGNUX_MODEL_AND_REFERENCE.md @@ -58,7 +58,7 @@ the rest walks through a run step by step. | `--reference-column