diff --git a/docs/JFJOCH_VIEWER.md b/docs/JFJOCH_VIEWER.md index 27239e38a..03824237b 100644 --- a/docs/JFJOCH_VIEWER.md +++ b/docs/JFJOCH_VIEWER.md @@ -18,7 +18,7 @@ newer on an Apple Silicon Mac** (M1 and newer; Intel Macs are not supported) and | --- | --- | --- | --- | | [`jfjoch_broker`](JFJOCH_BROKER.md) | Online, real-time streaming analysis on FPGA + GPU | HTTP/REST + ZeroMQ | Live results and statistics, images streamed to [`jfjoch_writer`](JFJOCH_WRITER.md) | | **`jfjoch_viewer`** | **Interactive, on-screen exploration** | **Qt desktop application** | **On screen; a processing job can write the same files as `rugnux`** | -| [`rugnux`](RUGNUX.md) | Offline batch processing of a stored dataset | Command-line interface | `_process.h5`, and `.mtz`/`.cif`/`.hkl` when merging | +| [`rugnux`](RUGNUX.md) | Offline batch processing of a stored dataset | Command-line interface | `.mtz`/`.cif`/`.hkl` and the results report when merging (the default); `_process.h5` with `--no-merge` or `--write-process-h5` | ## Functionality diff --git a/docs/RUGNUX_ADVANCED.md b/docs/RUGNUX_ADVANCED.md index 78b84867f..0981c315b 100644 --- a/docs/RUGNUX_ADVANCED.md +++ b/docs/RUGNUX_ADVANCED.md @@ -18,7 +18,7 @@ structure-factor file (`-z 1abc-sf.cif`, SF-mmCIF), gzipped or not; the format i file's content. From an mmCIF the first merged reflection block with a usable column is read (the log names it), its columns under the MTZ labels `gemmi cif2mtz` gives them (`IMEAN`, `FP`, `FC`, …), and its R-free set from `_refln.status` (`f` free, `o` working), or from `_refln.pdbx_r_free_flag` where -the status marks no test set. It is read once, before processing starts, and used for four things: +the status marks no test set. It is read once, before processing starts, and used for five things: - **It fixes the space group and the unit cell** the run works in, unless `-S` / `-C` override them. The cell is a *soft* reference: indexing may still drift within tolerance, so a small mismatch @@ -46,8 +46,9 @@ against a foreign dataset injects that dataset's systematics — so `-z` never p errors into the intensities. `--reference-column` picks the column to read where the automatic choice (`F-model`, else `IMEAN`/`I`, else `FP`/`FOBS`/`F`) is not the right one. -For the second of those four jobs — and only that one — an atomic model does as well: `--model` -computes the intensities it needs from the structure. Where a reference dataset exists, prefer it; +For the indexing ambiguity an atomic model does as well: `--model` computes the intensities it +needs from the structure (a model that fits also sets the hand label and the setting, see +[Validating against a model](#validating-against-a-model-rugnux---model)). Where a reference dataset exists, prefer it; where only a model does, it resolves the ambiguity just the same. ### The indexing ambiguity @@ -216,6 +217,8 @@ PDB: PanDDA's per-dataset input is `.pdb` beside `.mtz`, and dimple pair. (The PDB is skipped, with a log line, for a cell its fixed-width format cannot hold; the mmCIF is unconditional.) That is the file to open with the maps, and the one to hand to REFMAC5 or `phenix.refine`; its starting R-free is the `R_FREE=` the report quotes. +Rugnux's own refinement of it is written beside it as `_refined_model.cif` with +`_refined_maps.mtz` ([Refinement](RUGNUX_MODEL_AND_REFERENCE.md#refinement)). (`.cif` is the merged **reflections** — hence the separate name.) Where the run also wrote a **twin hypothesis** — `_twin_.mtz`/`.cif`, the same data merged @@ -286,7 +289,7 @@ A reference MTZ (`-z`) is accepted here on **stills** data, where it fixes the s reports CCref and hands over its R-free flags; on rotation data the rotation scaler declines it and the run stops with a message saying so. `--model` works here as in a full run, except that the model is placed by the rigid body only: a model it does not place, or a prediction, is not -searched for by molecular replacement, and `--mr` is refused. On rotation data, where the +searched for by molecular replacement, `--mr` is refused, and the placed model is not refined. On rotation data, where the [indexing ambiguity](#the-indexing-ambiguity) is one choice for the whole dataset, it can settle the enantiomorph label and the indexing — under the same fit test as always — and the re-merged reflections are written in what it settled. What no re-merge can repair is a **stills** `_process.h5` integrated without a reference: there the ambiguity was @@ -309,7 +312,8 @@ describes them - the cell and space group; `_software` with Rugnux named twice, beamline and its general class, the detector's make and model in `_diffrn_detector.type` and its class in `_diffrn_detector.detector`, and the collection date from the NXmx start time); and the merging statistics overall (`_reflns`) and per shell (`_reflns_shell`): completeness, multiplicity, -, R_merge, R_meas, R_pim, CC1/2 and CC\*, and SigAno where an anomalous split was made. A +, R_merge, R_meas, R_pim, CC1/2 and CC\*, and SigAno where an anomalous split was made; on rotation data the cell carries +its e.s.d.s (`_cell.length_a_esd`, …). A quantity the input does not state is left out rather than guessed. The unmerged observations are in the `_unmerged.mtz` (unscaled) and the `.hkl` (scaled), not in the `.cif`. @@ -341,9 +345,11 @@ General: | `-o, --output-prefix ` | Output file prefix (default: `output`) | | `-N, --threads ` | Number of worker threads (default, and for any value ≤ 0: every CPU the run may use - its affinity and cgroup quota). Some stages take fewer, because past a point more workers make them slower: the per-image loop of `--mode mx` uses at most 16 per GPU unless `-N` was given a positive value, and first-pass spot finding and the beam-stop pre-scan have ceilings of their own that `-N` does not lift. On a small card the two ceilings, and the per-image loop's 16 where `-N` was left at its default, come down to as many workers as keep their buffers (about 24 bytes per detector pixel each) within half of the card's total memory. Scaling, merging and the space-group search use the full count | | `-s, --start-image ` | First image to process (default: 0) | -| `-e, --end-image ` | Last image to process (default: all) | +| `-e, --end-image ` | End image number, exclusive: `-s 0 -e 100` processes images 0-99 (default: all) | | `-t, --stride ` | Process every *n*-th image (default: 1) | | `-v, --verbose` | Show the whole log on the terminal in place of the steps; `_log.txt` is written either way | +| `--simulate-live ` | Read a stored input as the collection it was while being written: image *i* becomes readable (*i*+1)·`ms` ms after the start (0: all at once). The run takes the live path a broker URL takes, with the same result; for testing the live workflow without a broker. `--mode mx` only | +| `--fast-live` | With `--simulate-live` or a broker URL: run as the broker's rugnux live mode does — every decision stands where it was first taken, nothing is re-checked or run again once the sweep is in, the integration radius is fixed, and SIGINT cuts the run to what it has established. A difficult crystal can come out worse | | `--no-gpu` | Run on the CPU only, as on a machine without a GPU, even where one is present: CUDA is not touched (nor, on macOS, the Apple GPU that Bragg integration, the model density and the molecular-replacement rotation function otherwise run on) and every GPU step takes its CPU path (`-X FFT` indexes with FFTW and `-X FFBIDX` with its CPU implementation; `-X cuFFT` is refused) | Mode — `--mode ` (default `mx`): @@ -371,9 +377,9 @@ Calibration (`--mode calibration`): | Option | Description | | --- | --- | -| `--calibrant ` | Powder standard: `lab6` \| `agbh` \| `ceo2` \| `si` \| `ice` (default `lab6`, case-insensitive) | +| `--calibrant ` | Powder standard: `lab6` \| `agbh` \| `ceo2` \| `si` \| `ice` (default `lab6`, case-insensitive). A cell given with `-C` overrides it: that cell is the standard, its rings enumerated from the cell, with the absences of `-S` where given | | `--calibration ` | How the rings are measured: `rings` \| `spots` (default `rings`; see above). `rings` defaults `--azim-phi-bins` to 32 | -| `--no-refine-tilt` | Do not refine the detector tilt: hold rot1/rot2 at the header value and fit only the beam centre and the distance, for a calibration handed to a program that cannot express a tilted detector (XDS) | +| `--no-refine-tilt` | Do not refine the detector tilt: hold rot1/rot2 at the header value and fit only the beam centre and the distance, for a calibration handed to a program that cannot express a tilted detector (XDS). On stills it holds the tilt in the geometry refinement too | Detector mask: @@ -385,7 +391,7 @@ Geometry: | Option | Description | | --- | --- | -| `--beam-center-check[=off]` | Measure the beam centre from the isotropy of the scattered background on **every** run, report how far the file's value is from it (against how right this geometry needs it to be), and on rotation data index a **second first pass** at the measured centre. The fit reads the projection `--detect-beam-stop` already builds, so it costs no extra frames. **On by default**; `=off` disables it, and with it the measured centre's part in the post-refinement bound. The measured centre is adopted where the file's centre indexes nothing and the measured one indexes a majority; where the two return cells related by an integer volume factor (2 to 4) and the measured centre's cell, larger or smaller, carries materially more of the pooled validation spots against its own chance level; and, on a two-pass run, where the first pass is run at both centres and the measured one merges better — done where the two give the same cell in different metric symmetries, where they agree only once less of each frame is read, and where they agree but lie further apart than the geometry absorbs and the file's centre merges inconsistently in the lowest-resolution shell. Otherwise the file's centre is kept. Still runs when `--beam-x`/`--beam-y` are given. See [§1.4](CPU_DATA_ANALYSIS_IMAGE.md) | +| `--beam-center-check[=off]` | Measure the beam centre from the isotropy of the scattered background on **every** run, report how far the file's value is from it (against how right this geometry needs it to be), and on rotation data index a **second first pass** at the measured centre. The fit reads the projection `--detect-beam-stop` already builds, so it costs no extra frames. **On by default**; `=off` disables it, and with it the measured centre's part in the post-refinement bound. The measured centre is adopted where the file's centre indexes nothing and the measured one indexes a majority; where the two return cells related by an integer volume factor (2 to 4) and the measured centre's cell, larger or smaller, carries materially more of the pooled validation spots against its own chance level; and, on a two-pass run, where the first pass is run at both centres and the measured one merges better — done where the two give the same cell in different metric symmetries, where they agree only once less of each frame is read, and where they agree but lie further apart than the geometry absorbs and the file's centre merges inconsistently in the lowest-resolution shell. Otherwise the file's centre is kept. On stills, where there is no first pass, the file's centre, the measured one and the point-symmetry capture's are each indexed on a sample of frames and the one putting materially more spots on the lattice is taken; with `-C` the detector distance is searched too (30-3000 mm, the file's value one hypothesis). Still runs when `--beam-x`/`--beam-y` are given. See [§1.4](CPU_DATA_ANALYSIS_IMAGE.md) | Spot finding: @@ -438,7 +444,7 @@ For very long axes the direction grid's angular resolution binds well below 500 | `-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 | | `--fft-min-unit-cell ` | Shortest cell axis the FFT search accepts, Å (default: 10). A candidate with a shorter axis is discarded — but a de-novo rotation run also runs a **second first-pass hypothesis with the floor lowered to 5 Å by default**, adopted when the standing cell turns out to be an integer supercell of what it finds, so a small-molecule cell is indexed without this flag. `-C` lowers the floor on its own to cover the cell given (and the second hypothesis then stays out of the way). On stills, where neither applies, 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 | +| `-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](#the-indexing-ambiguity)) | | `-r, --geom-refine ` | Geometry refinement: `none` \| `orientation` \| `beam_and_lattice` (default) \| `flex` (try all three per image, keep whichever indexes the most spots; alias `multi`) | | `-R, --two-pass-rotation[=num]` | Two-pass offline rotation indexing (default for goniometer data; optional first-pass image count, default 100) | | `--single-pass-rotation[=num]` | Online-like single-pass rotation indexing (optional min angular range, deg) | @@ -464,7 +470,7 @@ Scaling and merging: | `--relative-b[=deg]` | rot3d: fit a per-batch relative-*B* beyond the single decay slope over deg-degree batches, cross-validated (default 10° when bare; off otherwise) | | `--simple-stills` | Stills: treat every reflection as a full (*p* = 1, single-pass scale/merge) — disables the default-on physical partiality post-refinement | | `--no-expected-variance-merge` | Stills: disable the default expected-variance merge weighting (which rebuilds each weak observation's signal variance at the reflection mean to de-bias the inverse-variance merge); restores observed-sigma weighting | -| `--capture-uncertainty ` | rot3d: systematic sigma on under-captured fulls, ~num·(1−captured_fraction)·I (default: 1.0 for rotation, 0 otherwise) | +| `--capture-uncertainty ` | Systematic sigma num·(1−captured fraction)·⟨I⟩: on rot3d fulls the share of the rocking curve not captured, on stills the share of each partial its partiality does not see (default: 1.0 for rotation, 0 otherwise) | | `--min-captured-fraction ` | rot3d: drop a combined full whose rocking curve was captured below this fraction — edge-of-sweep truncated fulls (default: 0.7 for rotation, 0 otherwise; 0 = off) | | `--scaling-high-resolution ` | High-resolution limit for scaling, Å — manual override (default: no limit; disables the automatic cutoff below) | | `--scaling-low-resolution ` | Low-resolution limit of the scale fit, Å (default: 50, which is also XDS's own default; 0 removes the limit). Reflections coarser than it are merged and written but kept out of every fit of the scale model: on a large cell a few dozen of them, measured on a background the beam stop depresses, bent the model enough to move the merged 10–50 Å intensities by tens of percent. Which of them are measured at all is the beam-stop mask's decision - a reflection whose signal disk reaches the shadow is not integrated (`--detect-beam-stop`) | @@ -472,7 +478,7 @@ Scaling and merging: | `--resolution-cc-target ` | CC1/2 target defining the `cc-logistic` fall-off (default: 0.30) | | `--resolution-shells ` | Number of resolution shells in the reported statistics table (default: 9). The bins are equal steps in 1/d² between the lowest- and highest-resolution reflection merged, which is XDS's rule, and 9 is XDS's count — so at the same resolution limits the two tables have the same shells and can be read row for row | | `--report-resolution [,]` | Also report the merging statistics over this resolution range, Å (either order; `dmax` defaults to the run's own low-resolution limit), as a second table beside the run's own — the `REFRES_*` keys of the [results report](RUGNUX_REPORT.md#the-reference-range-table) — binned from the same merged reflections, so a run can be read against another program's table at that program's range. Report-only: the cut, the scaling, the error model and every decision stay the run's own, and shells finer than the run's own limit are reported as not merged rather than filled from data the run did not keep | -| `--min-partiality ` | Minimum partiality to accept a reflection (default: 0.02) | +| `--min-partiality ` | Minimum partiality to accept a reflection (default: 0.02 for rotation, 0.5 for stills) | | `--ice-min-score ` | Ice-presence gate: the measured per-run ice score (1 = no ice) a dataset must reach before **any** ice handling is applied — the flagging and the exclusion from scaling (default: 1.5; 0 = no gate). The fixed hexagonal bands cover 16–26 % of the unique reflections whether or not the crystal has ice, so handling ice on a clean crystal only costs completeness | | `--ice-min-spot-ratio ` | The second ice-presence channel: found **spots** on the hexagonal rings over the same q width of ice-free flanks beside them (1 = spots spread evenly). Ice in large crystallites diffracts as discrete spots and leaves the radial profile flat, so `--ice-min-score` alone is blind to it (default: 2.0; 0 disables this channel) | | `--reject-outliers ` | Per-observation outlier rejection, N σ from the per-reflection median (default: 6 for rotation, 10 for stills; 0 = off) | @@ -498,11 +504,11 @@ Integration: | --- | --- | | `--integrator ` | Spot integrator: `gaussian` (profile-fit, default) \| `empirical` \| `boxsum` (classical fallback) | | `--integration-radius ` | Signal-box radius `r1`, or `r1,r2,r3` (px). One value ⇒ `r2=r1+2`, `r3=r1+4` | -| `--adaptive-integration-radius[=on\|off]` | Set the signal radius `r1` from how wide this crystal's spots actually are (default: **on** for rotation, off for stills). `r1` is not the integration domain — that is the profile-fit grid — but it *is* the aperture the profile **width** is learned over, and a second moment over a disk of radius `a` saturates at `a²/4`, so at the shipped `r1 = 4` the learned σ can never exceed 2 px and a broader spot is fitted with a profile the model cannot represent. The pre-scan reads `r80`, the radius holding 80 % of a spot's flux, off isolated strong spots over a fixed 14 px aperture that owes nothing to `r1`, fits it against `1/d` and evaluates it at 5 Å; then `r1 = clamp(round(2·r80), 4, 6)`, `r2 = r1 + 2`, and `r3` is taken so the `r2..r3` background ring keeps the area it has at the default `4,6,13`. The ceiling of 6 is pattern density: `r2` also drives the neighbour-ownership radius and the ring's inner edge, and past it a dense pattern starts losing reflections whose ring falls below six clean pixels. Ignored when `--integration-radius` is given. The widened radius applies to the **final** integration pass only — the two-pass geometry pre-pass keeps the radius the run started with, because the post-refinement fits the detector distance and beam to the observed reflection positions and those move with the signal disk (33 µm and 0.02 px between `r1 = 4` and `r1 = 6` on one crystal, enough for the second pass's de-novo lattice search to settle on a different lattice and index a fifth fewer frames). And where the widened radius leaves more than 1.1 % of the predicted reflections without a background ring — a pattern too dense for it — the final pass is re-integrated at the fixed 4 px radius, and the log says so. Over the rotation regression battery it moves 12 of 38 crystals and leaves the merged intensities of the other 26 unchanged; where it moves them, per-shell ⟨I/σ⟩ improves by up to 31 % and R_meas by up to 24 % | +| `--adaptive-integration-radius[=on\|off]` | Set the signal radius `r1` from how wide this crystal's spots actually are (default: **on**). On stills it measures instead how far the background ring should reach: on empty apertures of the pre-scan frames, the `r3` (up to 14) whose ring best predicts the background under the signal disk. `r1` is not the integration domain — that is the profile-fit grid — but it *is* the aperture the profile **width** is learned over, and a second moment over a disk of radius `a` saturates at `a²/4`, so at the shipped `r1 = 4` the learned σ can never exceed 2 px and a broader spot is fitted with a profile the model cannot represent. The pre-scan reads `r80`, the radius holding 80 % of a spot's flux, off isolated strong spots over a fixed 14 px aperture that owes nothing to `r1`, fits it against `1/d` and evaluates it at 5 Å; then `r1 = clamp(round(2·r80), 4, 6)`, `r2 = r1 + 2`, and `r3` is taken so the `r2..r3` background ring keeps the area it has at the default `4,6,13`. The ceiling of 6 is pattern density: `r2` also drives the neighbour-ownership radius and the ring's inner edge, and past it a dense pattern starts losing reflections whose ring falls below six clean pixels. Ignored when `--integration-radius` is given. The widened radius applies to the **final** integration pass only — the two-pass geometry pre-pass keeps the radius the run started with, because the post-refinement fits the detector distance and beam to the observed reflection positions and those move with the signal disk (33 µm and 0.02 px between `r1 = 4` and `r1 = 6` on one crystal, enough for the second pass's de-novo lattice search to settle on a different lattice and index a fifth fewer frames). And where the widened radius leaves more than 1.1 % of the predicted reflections without a background ring — a pattern too dense for it — the final pass is re-integrated at the fixed 4 px radius, and the log says so. Over the rotation regression battery it moves 12 of 38 crystals and leaves the merged intensities of the other 26 unchanged; where it moves them, per-shell ⟨I/σ⟩ improves by up to 31 % and R_meas by up to 24 % | | `--integration-stencil ` | Push the `r2..r3` background ring out by `k` times the beam's radial streak `bandwidth·R_px`, per reflection (default `0` = the fixed circular ring). A fixed ring otherwise ends up on a streaked reflection's own tails at high resolution and measures them as background. Only the ring moves, and only radially — the `r1` signal box stays a circle — and the growth is capped at `2·r3`. The neighbour exclusion grows with it, so on a crowded pattern a few reflections can be left with too little background and dropped. On a monochromatic beam the streak is zero and this does nothing | | `--background-clip ` | High-side clip of the background ring at `mean + n·√mean` (default 4, whatever the bandwidth; 0 = off). The default background estimator — it rejects neighbour cores and zingers without the symmetric trim's Poisson skew bias. Ignored by `--integrator boxsum` | | `--background-trim ` | Use the old symmetric trimmed mean for the background ring instead of the clip, 0≤f<0.5 (`0.10` was the former default). Switches `--background-clip` off. A symmetric trim is biased low on Poisson data and adds ~5 counts to every partial, so this is for back compatibility only; `0` = plain ring mean. Rings holding more than 512 pixels fall back to the plain mean (the GPU sorts the ring in shared memory and the CPU now matches it), which the default radii never reach but wide ones do | -| `--background-radial[=on\|off\|auto]` | Correct the background ring for the **curvature** of the radial background (default **auto**). Disk and ring are concentric, so a background linear in position cancels between them and only curvature survives — which on a smooth ice ring reaches +26 counts on a single reflection. `auto` applies it per image where that image's ice score shows a *smooth* powder ring, since the model is a function of radius alone: on ice made of discrete crystallite spots there is no smooth ring and the correction makes the bias worse. Ignored by `--integrator boxsum` (no clip pass to take the curve from) | +| `--background-radial[=on\|off\|auto]` | Correct the background ring for the **curvature** of the radial background (default **auto**). Disk and ring are concentric, so a background linear in position cancels between them and only curvature survives — which on a smooth ice ring reaches +26 counts on a single reflection. `auto` decides per run in the pre-scan, on empty apertures of the pre-scan frames: on stills it is applied to every image where it makes the ring predict the background of empty apertures better at all; on rotation data to every image where it takes at least 10 % of that error away, and otherwise only to images whose ice score shows a *smooth* powder ring (ice made of discrete crystallite spots leaves no such ring, and the correction makes the bias worse). Ignored by `--integrator boxsum` (no clip pass to take the curve from) | | `--integration-high-resolution ` | High-resolution limit for prediction and integration. Omitted (or 0) means integration extends as far as the detector reaches — which is what the predictor can place on the detector anyway, since it rejects reflections that miss it. Set a value to integrate less than the detector offers | | `--max-hkl ` | Predict reflections with \|h\|,\|k\|,\|l\| ≤ `n` (max 511). By default this is derived per crystal from the refined cell as `ceil(max(a,b,c)/d_min) + 1`, which is the exact bound: the predictor keeps only \|q\| ≤ 1/d_min and `h = a·q`, so no reflection can lie outside it and no candidate inside it is wasted on a shorter axis. Set it only to override that | | `--bandwidth ` | Relative X-ray bandwidth FWHM (e.g. `0.01` for a 1% DMM). Default: the file's value; where the file states none, the one the pre-scan measures from how much longer strong spots are along their radius than across it, used where it is significant; otherwise 0 (monochromatic). `--bandwidth 0` forces a monochromatic beam | @@ -517,16 +523,16 @@ Geometry overrides (defaults are taken from the input file; override them to rep | --- | --- | | `--beam-x ` | Beam centre X (pixel). `--beam-center-check` still runs and can adopt its measured centre ([§1.4](CPU_DATA_ANALYSIS_IMAGE.md)) | | `--beam-y ` | Beam centre Y (pixel). `--beam-center-check` still runs and can adopt its measured centre ([§1.4](CPU_DATA_ANALYSIS_IMAGE.md)) | -| `--detector-distance ` | Detector distance (mm) | +| `--detector-distance ` | Detector distance (mm). On stills it is then held: neither searched nor refined. Without it, stills with a reference cell (`-C`) search the distance and refine it with the cell | | `--wavelength ` | Wavelength (Å) | | `--pixel-size ` | Pixel size (µm), for a file that does not state it (an XTC stream of an unknown camera) | -| `--gain ` | Detector units per photon, for input in detector units (SACLA, CXI, XTC, SMV, marCCD and `--crystfel-geometry` input). The frames are analysed in their own units and the gain enters where a photon count is assumed; the integrated intensities come out in photons. Default: measured on the background of a few frames ([Serial XFEL inputs](RUGNUX_FORMATS.md#serial-xfel-inputs)) | +| `--gain ` | Detector units per photon, for input in detector units (SACLA, CXI, XTC, SMV, marCCD and `--crystfel-geometry` input). Where the background resolves single photons (SACLA, CXI and `--crystfel-geometry` input) the frames are counted in whole photons as they are read; otherwise they are analysed in their own units and the gain enters where a photon count is assumed. The integrated intensities come out in photons either way. Default: measured on the background of a few frames ([Serial XFEL inputs](RUGNUX_FORMATS.md#serial-xfel-inputs)) | | `--saturation ` | Pixel value from which a pixel is overloaded, in the units the frames are read in. Replaces the file's limit and the one stills read off the frames | | `--crystfel-geometry ` | Place the panels of an HDF5/CXI input by a CrystFEL geometry file instead of the file's own metadata: module geometry, camera length, mask arrays and bad regions (optional; [Serial XFEL inputs](RUGNUX_FORMATS.md#serial-xfel-inputs)) | | `--module-geometry ` | Where the detector's modules are: an NXmx file with one NXdetector_module per module (what a run writes as `_modules.h5`) or a CrystFEL geometry file whose panels are laid on the image. Overrides the input's own | -| `--refine-modules[=off]` | Stills: place each module as a rigid block in the geometry bundle adjustment, where that predicts held-out spots better (default: on). Used for a foreign multi-panel detector, measured and reported only for a JUNGFRAU; the placement is written to `_modules.h5` | +| `--refine-modules[=on\|off\|diagnose]` | Stills: place each module as a rigid block in the geometry bundle adjustment, where that predicts held-out spots better (default: on). Used for a foreign multi-panel detector, measured and reported only for a JUNGFRAU; the placement is written to `_modules.h5` | | `--mask-good [:][@]` / `--mask-bad [:][@]` | HDF5/CXI stills: a mask array in the frames' stored layout, in `` or in each data file; usable only where non-zero (or with all ``) / unusable where non-zero (or with any ``). Repeatable ([Serial XFEL inputs](RUGNUX_FORMATS.md#serial-xfel-inputs)) | -| `--rot1 ` | PONI detector rotation 1 (rad) | +| `--rot1 ` | PONI detector rotation 1 (rad). On stills, `--rot1` or `--rot2` holds the tilt (not refined); without them stills refine the tilt where held-out frames agree | | `--rot2 ` | PONI detector rotation 2 (rad) | | `--rot3 ` | PONI detector rotation 3, about the beam (rad) — the one `rugnux --mode calibration` writes into its `.poni`, so a refined third rotation can be given straight back | | `--detector-mirror-y` | The stored image is mirrored in Y relative to the frame the PONI angles are stated in | diff --git a/docs/RUGNUX_INTEGRATION.md b/docs/RUGNUX_INTEGRATION.md index 0edab83f3..ebbf59e05 100644 --- a/docs/RUGNUX_INTEGRATION.md +++ b/docs/RUGNUX_INTEGRATION.md @@ -42,8 +42,11 @@ ignores them, and one that does can find them without guessing. > `.cif` is not comparable with one taken from a newer one. **SHELX HKLF 4** (`.hkl`). Fixed-format `3I4,2F8.2` — `h k l I σ(I)`, terminated by a -`0 0 0` record — which is what **SHELXL**, **SHELXC**, **SHELXD** and **ANODE** expect. Two -properties worth knowing before using it: +`0 0 0` record — which is what **SHELXL**, **SHELXC**, **SHELXD** and **ANODE** expect. It is +written with a SHELX instruction file, `.ins`, beside it: `CELL`, `ZERR` (the cell's e.s.d.s, +measured on rotation runs), `LATT` and `SYMM`, and a placeholder `SFAC`/`UNIT` (see +[Small-molecule structures](#small-molecule-structures-with-shelxt-and-shelxl)). Two properties of +the `.hkl` worth knowing before using it: - **On rotation data it is unmerged**: one record per full reflection (its partials summed), with the per-frame scale and every correction applied and the σ(I) the merge weighted it with, but not @@ -116,7 +119,7 @@ file is self-contained, so several of them can be handed to pointless and aimles **Columns.** `H K L M/ISYM BATCH I SIGI FRACTIONCALC XDET YDET ROT LP QE FLIGHT FLAG` — POINTLESS's own set down to `FLAG`, plus `QE` and `FLIGHT` (the sensor-efficiency and flight-path -divisors described above; `QE` is DIALS's column) — then four Rugnux extras, `DELPHI` (offset from +divisors described below; `QE` is DIALS's column) — then four Rugnux extras, `DELPHI` (offset from the centre of the rocking curve), `ZETA` (the Lorentz geometry of that curve), `BGMEAN` and `BGVAR` (the background that was subtracted, and its variance). `BATCH` is the image ordinal plus one, and a batch header is written for every batch that carries an @@ -433,8 +436,8 @@ with. `myrun_unmerged.mtz` is not part of this chain (it is unscaled), so a run `--no-export-unmerged` is not missing a file SHELX needs. **HKLF 4 carries no metadata**, so the cell and the space group have to be repeated on the SHELXC -command — take them from `UNIT_CELL_CONSTANTS` and `SPACE_GROUP_NAME` in section 2 of the -report, with the spaces taken out of the group's name. (SHELXC also puts a wavelength in the `CELL` +command — take them from the `CELL` line of `myrun.ins`, or from `UNIT_CELL_CONSTANTS` and +`SPACE_GROUP_NAME` in section 2 of the report, with the spaces taken out of the group's name. (SHELXC also puts a wavelength in the `CELL` line of the `.ins` files it writes; that is its own 0.98 Å default, not anything read from the data, and neither SHELXD nor SHELXE uses it.) The whole chain, for a sulfur substructure — the cell and group here are tetragonal lysozyme's, so substitute your own report's: @@ -517,7 +520,7 @@ the beam), so the numbers are directly comparable, and a tilt appears as the two vectors rather than as angles, which is how XDS reports it after refinement. Two things to keep in mind: **`ORGX`/`ORGY` are 1-based**, because XDS counts pixels from 1 and Jungfraujoch from 0; and they are the **PONI**, the same quantity Jungfraujoch's beam centre is — so no correction is needed — -but not the direct beam once the detector is tilted (see above). **`ROTATION_AXIS` is rugnux's axis +but not the direct beam once the detector is tilted. **`ROTATION_AXIS` is rugnux's axis negated**: rugnux turns the crystal by -phi about its axis, XDS by +phi, and with rugnux's own sign `IDXREF` indexes only the chance floor of a mis-signed spindle. The detector axes appear only where the detector is tilted. diff --git a/docs/RUGNUX_MODEL_AND_REFERENCE.md b/docs/RUGNUX_MODEL_AND_REFERENCE.md index caf6d1542..03daac042 100644 --- a/docs/RUGNUX_MODEL_AND_REFERENCE.md +++ b/docs/RUGNUX_MODEL_AND_REFERENCE.md @@ -29,6 +29,9 @@ the rest walks through a run step by step. another space group, or a twinned subgroup, that merge is written *beside* the answer as `_mr.mtz`/`.cif`, with the model as placed there. `.mtz` stays the data's own answer. +- **A placed model is then refined**, after every decision has been taken, and written beside the + answer as `_refined_model.cif` with its maps ([Refinement](#refinement)); `--no-refine` + skips it. The refinement changes nothing else the run writes. - **A reference dataset (`-z`) and a space group or cell you give (`-S`, `-C`) are different:** they are taken as facts about the crystal. They fix the space group and the cell before processing, so with them the space group is yours, not the data's. @@ -121,6 +124,7 @@ these letters. | `p.mtz` space-group label | data | yours | the reference's | hand relabel only | (b) | | `_mr.mtz`/`.cif`, `_mr_model.*` | not written | — | — | another group or the twin subgroup the model chose | (c) | | Maps, `_model.*`, section 5 of the report | not written | — | — | always, whatever the verdict | (d) | +| Refinement, `_refined_*`, `_blobs.json`, `REFINE_` keys | not written | — | — | where the model was placed (not with `--no-refine`) | (d) | ## A run with `--model`, step by step @@ -171,14 +175,15 @@ these letters. for the placement that was kept, against the merge it was chosen on, and written: `_maps.mtz` (map coefficients), `_model.cif`/`.pdb` — or the `_mr_*` equivalents where the choice was `_mr`. A rejected model gets its maps - too: that is the case where looking at it in the density is most useful. + too: that is the case where looking at it in the density is most useful. A placed model is then + [refined](#refinement) (`_refined_model.cif`, `_refined_maps.mtz`, `_blobs.json`). 9. **The reflection files** — `.mtz`, `.cif`, `.hkl`, `_unmerged.mtz` — are written last, carrying only the class-(b) labels from step 5 and the hand from step 7. `MODEL_PLACEMENT=` summarises steps 3–7: `RIGID_BODY`, `MR` or `NOT_PLACED`. In `--mode scale`, `--model` is steps 3–5 only: the rigid body, its null, and the hand and indexing -it may settle. There is no molecular replacement, no setting change and no twin hypothesis, and +it may settle. There is no molecular replacement, no setting change, no twin hypothesis and no refinement, and `--mr` is refused. ### Serial stills: the one place a model acts before the merge @@ -337,7 +342,7 @@ saying what had to be made of the input. | Option | Description | | --- | --- | -| `--model ` | The model (required) | +| `--model ` | The model (required; it can also be given among the inputs, told by content) | | `--refine-score-only` | Score the model as given and refine nothing; every term of the score - R-work and R-free overall and in 20 resolution shells, the overall scale, B and anisotropic B, ksol and Bsol, the likelihood over the working and the free reflections and its figure of merit over the working reflections, and the geometry's rmsd and rmsZ - under `REFINE_SCORE_` keys (`--developer` prints them all) | | `--refine-d-min ` | Leave out reflections finer than this | @@ -391,7 +396,7 @@ the data, a weak shell says nothing about them, and nothing acts on it. **When to give a model.** - **You have a structure of this crystal form** (a fragment campaign, a ligand soak, a reference - structure): give it with `--model`. You get maps and a placed model ready for refinement, the + structure): give it with `--model`. You get maps, a placed model and Rugnux's own first refinement of it, the indexing of every dataset brought into the model's, and the hand fixed — the things that make a campaign's files directly comparable. A wrong or rejected model costs a few seconds and changes nothing.