Files
Jungfraujoch/docs/RUGNUX_ADVANCED.md
leonarski_f 4809c1622c
Build Packages / build:portable:linux-x86_64:nocuda (push) Successful in 16m43s
Build Packages / build:jfjoch:ubuntu2404:nocuda (push) Successful in 28m46s
Build Packages / build:jfjoch:rocky8:cuda-sls9 (push) Successful in 32m5s
Build Packages / build:jfjoch:rocky9:cuda (push) Successful in 39m44s
Build Packages / build:portable:macos-arm64:nocuda (push) Successful in 5m7s
Build Packages / Create release (push) Successful in 8s
Build Packages / Build documentation (push) Successful in 49s
Build Packages / build:portable:linux-x86_64:cuda (push) Successful in 22m30s
Build Packages / build:jfjoch:rocky8:nocuda (push) Successful in 31m54s
Build Packages / build:rugnux:linux-aarch64:cuda (push) Successful in 11m29s
Build Packages / build:portable:windows-x86_64:nocuda (push) Successful in 23m51s
Build Packages / build:jfjoch:ubuntu2204:nocuda (push) Successful in 26m7s
Build Packages / build:jfjoch:ubuntu2204:cuda (push) Successful in 29m38s
Build Packages / build:portable:windows-x86_64:cuda (push) Successful in 28m6s
Build Packages / HDF5 consumer tests (DIALS, XDS) (push) Successful in 29m44s
Build Packages / build:jfjoch:rocky9:nocuda (push) Successful in 33m22s
Build Packages / Generate python client (push) Successful in 47s
Build Packages / build:jfjoch:rocky9:cuda-sls9 (push) Successful in 34m6s
Build Packages / Unit tests (push) Successful in 1h2m47s
Build Packages / build:jfjoch:rocky8:cuda (push) Successful in 35m59s
Build Packages / build:jfjoch:ubuntu2404:cuda (push) Successful in 34m8s
Build Packages / Validation Battery (push) Successful in 38m31s
v1.0.0-rc.187 (#98)
* Rugnux: Refinement several times faster, one protocol on the CPU and the GPU, parts of it on the Apple GPU; its random draws are the same on every platform.
* Rugnux: Refinement follows common practice: the free set decides only the restraint weights and the displacement model (isotropic, TLS or anisotropic, by Hamilton's test), everything else is decided on the working set; lower R-free for placed and predicted models.
* Rugnux: Restraint dictionaries via `--restraints` (or among the inputs) and more built-in ligands; a model whose space group is a subgroup of the data's is refined in its own group; reflections plus a model select `--mode refine` on their own.
* Rugnux: `-C` fixes the crystal system on the axes as typed; `-S` alone fixes the space group only, the cell is still found and reduced; a space group or cell stored in the input file is ignored, with a line in the log.
* Rugnux: More reliable multi-sweep merging; `--mode scale` merges several stills runs as one; `_plot.txt` and the report name each input; a second crystal form is reported for stills given a cell.
* jfjoch_broker (experimental): Live Rugnux on FPGA detectors (JUNGFRAU) takes the same path as a DECTRIS stream, rotation and serial alike, model step included, with analysis threads per GPU; frames waiting for the analysis can be viewed; no host stage drops a frame - a source faster than the analysis is held at the card.
* jfjoch_broker: Summation of more than 256 frames per image is split between the card and the host (`summation_mode` is then `hybrid`), and live Rugnux runs on such collections; pedestal runs take a receiver of their own.
* jfjoch_broker (experimental): `stills_downsample` analyses 1 of every N serial images (chosen by a hash; the first 2000 all; the others written without analysis; reset to 1 by `/initialize`); `max_spot_count` left out means 250 for per-image indexing and up to 1000 for live stills; the live status gives the merge before the model work, the fitted resolution and the anomalous peak height of each unexplained blob.
* jfjoch_broker: Without a `pcie` entry the broker runs on a mock of the card instead of the HLS simulation; its spot, ROI and azimuthal results are zero then.
* Web frontend: Redesigned Rugnux live page; Vite 8, TypeScript 6, Mol* 5.13 and dependency security updates.
* Tools: `jfjoch_fpga_stills_test` measures live stills on the cards with a stored dataset; `jfjoch_fpga_test` loses the HLS-simulation option.
* Other: FFTW no longer fetched or linked (the CPU FFT indexer keeps the name `FFTW`); PCIe driver now GPL-2.0-or-later and third-party notices complete; several crash fixes.

Reviewed-on: #98
Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>
2026-11-19 20:49:28 +01:00

30 KiB

Advanced Rugnux

The machinery behind a run that needs more than the defaults: external reference data, model validation and re-merging without re-integration; the option tables are on Command-line options.

:local:
:depth: 2

Reference data and the indexing ambiguity

Reference data (-z)

-z reference.mtz supplies known intensities of the same crystal form — a previously merged dataset, or F-model amplitudes computed from a structure. The reference can equally be a PDB structure-factor file (-z 1abc-sf.cif, SF-mmCIF), gzipped or not; the format is taken from the 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 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 between reference and data is absorbed rather than rejected.
  • It fixes the axes the files are written on. The group is taken in the setting the reference is written in (P 2 21 21 stays P 2 21 21, not only "number 18"), and once the run has merged, every description of its lattice on the reference's axes - axis permutations, sign flips, I- against C-centred - and every alternative indexing on top is correlated with the reference; the best one is re-merged and written. REFERENCE_OPERATOR= names the operator (h,k,l where the data were already on the reference's axes), REFERENCE_CC= and REFERENCE_MATCHED_FRACTION= how well the result matches.
  • It resolves the indexing ambiguity (below) — the one thing the data cannot settle for themselves: which of the equivalent indexings is the reference's own.
  • It hands over its R-free test set, where the file carries one, so every dataset of a campaign is scored on the same free reflections - in the reference's frame, and only where the merge matches the reference (CC at least 0.5 over at least half of the merged reflections in its resolution range). A reference that does not is reported (REFERENCE_MISMATCH), and the merge keeps its own test set; REFERENCE_FREE_FLAGS_INHERITED= says which happened.
  • It reports CCref, the correlation of the merged intensities against the reference, in the statistics table. Stills only — the rotation merge never scores itself against the reference, and its table shows - in that column.

A reference is not a scale anchor. Both workflows scale against their own data — scaling images against a foreign dataset injects that dataset's systematics — so -z never puts the reference's 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.

An atomic model does not take part in the processing: --model is placed and validated after the merge, and a run with one merges exactly what a run without one does. A model that fits then sets the frame the merge is written in - the hand label, the setting and the indexing (see Validating against a model) - by relabelling it, never by re-merging.

The indexing ambiguity

Some crystals can be indexed in more than one way, each equally valid geometrically, and each giving different merged intensities. This happens whenever the lattice is more symmetric than the crystal: in P3, P4, P6, P31, C2 and their relatives (merohedral), and also where the cell is metrically more symmetric than the Laue class by accident (pseudo-merohedral, up to 2° of obliquity). The alternatives are related by the crystal's twin laws — reindexing operators such as k,h,-l.

Nothing in the data says which solution is the true one: the merge is equally self-consistent either way, so which comes out is arbitrary. What that costs depends on the workflow:

  • Rotation. The whole sweep is one lattice, so the whole dataset lands in one indexing, picked at random. The merge itself is sound; it may simply be the other solution from an earlier dataset of the same crystal form, and the two cannot be combined, compared or phased against the same model.
  • Serial stills. Every crystal is indexed independently, so a run mixes both indexings into one merge. That is not a labelling matter — reflections that are not symmetry mates get averaged together, and CC1/2, Rmeas and the anomalous signal all degrade. The data can say which crystals are in the same indexing, though, and that is what a merge needs: with the space group given (-S) and no reference, Rugnux puts each crystal into the indexing in which it agrees best with all the others, before anything is scaled. This takes seconds for tens of thousands of crystals, and the report says how clearly the crystals separated (AMBIGUITY_SEPARATION_SIGMA=, AMBIGUITY_DECIDED_FRACTION=) and how many were moved (AMBIGUITY_REINDEXED=). The indexing the whole merge ends up in is still arbitrary against other data sets, exactly as on rotation data. On a pseudo-merohedral cell each crystal's own refined cell also says something about which axis is which, as far as the run's axes differ by more than one crystal's cell scatters; it is weighed beside the intensities, crystal by crystal, and decides where they cannot.

Every run that merges tests for the ambiguity, and where it exists and nothing resolves it (serial stills whose space group was determined by the run rather than given), says so in the log and in the report's warnings:

Indexing ambiguity: this cell / space group admits alternative indexing (reindex operator(s):
-h,-k,l). Serial-stills crystals are indexed in one hand at random, and rugnux makes them consistent
from the data only where the space group is given: here it was determined by the run, so the merge
mixes the hands and CC1/2 is degraded. Giving the space group (-S) resolves it from the data; a
reference MTZ (-z) or a model (--model, which needs -S here) resolves it against them.

Where something does resolve it, the run says so instead — Indexing ambiguity present (reindex operator(s): -h,-k,l); resolved against the supplied reference or ...; resolved from the data.

How to resolve it:

Situation What to do
Rotation, a reference dataset exists -z reference.mtz. Once the space group is settled, each candidate reindexing of the merged intensities is correlated with the reference and the best-correlating one is re-merged. Only the hkl labels change; the cell does not
Serial stills, a reference dataset exists -z reference.mtz. The crystals are made consistent with each other as in the rows below, and the reference fixes the indexing the merge is written in. A crystal is decided by its agreement with all the others and its own cell rather than by the reference, which reads a weak crystal less clearly than the merge of all the others does: AMBIGUITY_DATA_DISAGREES= counts the crystals put elsewhere than the reference alone would
Rotation, only a model --model model.pdb. The merged data are fitted to the model in each candidate indexing and the lowest R-free wins — provided the model first beats its random-orientation null (MODEL_FIT= ACCEPTED) and its lead over the runner-up beats the lead a random placement of the same model takes; the written reflections are then reindexed into it, so the file, the R-factors and the maps agree. Where either bar is missed the data keep the indexing they were merged in, and the report says by how much (MODEL_INDEXING_MARGIN_SIGMA). It is the data that are relabelled, never the model: every dataset of one crystal form processed against the same model comes out in that model's indexing, so the reflection files and maps of a screening campaign compare directly. The relabelling is a proper rotation of the lattice, so the merging statistics are unchanged and I(+)/I(-) keep their hand
Serial stills, only a model, space group given (-S) The crystals are made consistent with each other from the data alone, as in the row below - the model plays no part in the processing. Validation then fits the merge to the model in each candidate indexing, as for rotation data, and relabels the written reflections into the model's indexing where it wins
Serial stills, neither, space group given (-S) Nothing to do: the crystals are made consistent with each other from the data alone (INDEXING_AMBIGUITY_RESOLVED= data), in an indexing that is arbitrary against other data sets. A reference still settles the weakest crystals more reliably than the other crystals can, and puts the merge in its own indexing
Neither The run warns and merges in whichever indexing it found: for rotation data a usable dataset in an arbitrary frame; for stills whose space group the run determined, a merge of mixed indexings, which looks like a perfect twin and can pass for higher symmetry than the crystal has. Run again with -S

Two things to know about where the choice lands:

  • --mode scale resolves it as the full run does. On stills with no reference MTZ it makes the crystals consistent from the data alone before merging; with -z the reference fixes the indexing of the whole, as in a full run with the reference - so one reference puts several runs, or both arms of a pump-probe run, in the same indexing. On rotation data, where the ambiguity is one choice for the whole dataset, --mode scale --model model.pdb does resolve it.
  • The choice reaches the written reflections, not only the R-factors and the maps: the merged .mtz / .cif / .hkl (and _unmerged.mtz, where it is asked for) are written in the indexing the model or the reference settled on, so the file can be refined against that model as it stands.

Two things the indexing ambiguity is not:

  • Not the enantiomorph. P41212 versus P43212 (or P31 versus P32) leaves the merged intensities unchanged, so no amount of data can choose between them and Rugnux never tries — the run reports the pair it cannot separate. A model the data accept names it (MODEL_FIT= ACCEPTED in the report), and the naming is a label only: the written reflections take the model's space group, no reflection moves, and I(+)/I(-) stay exactly as measured — reindexing by the change of hand would flip every anomalous difference, so it is never done. Whether the model and the data really agree about the hand is answered afterwards by the anomalous difference map, which warns when the density at the model's atoms comes out inverted. The _process.h5, whose per-image reflections were written as they were integrated, keeps the group the run determined and is left alone.
  • Not twinning. The twin laws are the same operators, but twinning is a property of the crystal — two orientations diffracting at once — and is reported separately in the report's twinning section. A crystal can have an indexing ambiguity without being twinned, and usually is not.

The algorithms behind both are in CPU/GPU data analysis ▸ Reference data.

The setting the files are written in

The space-group search decides which axes carry the screws and the centring on the cell as it was indexed, whose axes are ordered by length. The files are then written in the standard setting, as XDS and POINTLESS write it (SETTING_SOURCE=STANDARD): P2221 and P21212 with the unique axis on c and a<b; the other orthorhombic groups a<=b<=c; C222 and C2221 with a<b; monoclinic b-unique, C-centred (never I2), least oblique with beta >= 90; triclinic keeps the reduced cell. So a crystal indexed as 52.51 87.87 137.72 in P 2 21 21 is written as 87.87 137.72 52.51 in P 21 21 2.

What the user gives takes precedence, in this order: a reference MTZ (-z, its own setting), a model that fits (--model, its setting), the axis order of a cell given with -C (SETTING_SOURCE=CELL), and the setting of a group given with -S by a non-standard symbol (-S "P 2 21 21", SETTING_SOURCE=SPACE_GROUP). A group given with -S is also placed on the axes its absences name before anything is merged, so -S 18 on a cell whose pure two-fold is its shortest axis puts the screws on the right rows.

The change is a relabelling made after every decision - nothing measured, and no decision, depends on it - and it is applied to everything the run writes: the merged .mtz/.cif/.hkl, _unmerged.mtz and the _process.h5 (whose per-image reflections carry the reindex matrix). SETTING_OPERATOR= gives it as a reindexing operator on the indices the space group was determined on, CCP4 style (k,l,h is h'=k, k'=l, l'=h); h,k,l where nothing moved.

Validating against a model (rugnux --model)

Which decisions a model can influence, and which it cannot, is set out decision by decision in Models and reference data.

Given an atomic model of the same structure, --model model.pdb scales the model structure factors to the merged amplitudes — fitting a flat bulk-solvent contribution and an overall anisotropic B — and reports R-work / R-free and the mean 2mFo−DFc density at the atom centres. Where the model is placed it also writes the map-coefficient MTZ <prefix>_maps.mtz next to the merged reflections (a model placed nowhere, MODEL_PLACEMENT=NOT_PLACED, gets no model or maps files): the σA-weighted 2mFo−DFc and mFo−DFc coefficients, which Coot and PyMOL open directly as maps. As phenix.refine and BUSTER write theirs, the coefficients have the data's overall anisotropy divided out and the 2mFo−DFc map FWT/PHWT is filled with DFc at the reflections the data do not have; FWT_no_fill/PHWT_no_fill is the same map without them, and the difference map DELFWT/PHDELWT is never filled. Where the merge kept the Bijvoet split (a rotation merge always does), an anomalous difference map is made too, its coefficients in the same MTZ (ANOM/PHANOM): the report names its strongest sites (ANOMALOUS_SITE_01…10), the map's mean height at the model's anomalous scatterers - every atom from phosphorus up - as one number for the anomalous signal (ANOMALOUS_SCATTERER_MEAN_SIGMA), and the map's peaks of 5 σ or more that no such atom of the model sits on (ANOMALOUS_UNEXPLAINED_PEAK_01…): an ion or a heavy atom the model leaves out, with its position and the model's nearest atom. The model is not refined for these numbers (a placed model is refined afterwards, on the side - see Refinement); it is re-fractionalized into the data cell and then placed as one rigid body, so a deposited model from a crystal that is not quite isomorphous still sits where the density is. The placement runs on the GPU where there is one and on the CPU otherwise, with nothing to set; the two agree to rounding, not bit for bit.

The rigid body only moves a model that already sits near its place, so its placement is checked: the model counts as placed where its fit beats the same model refitted from random orientations (the null behind MODEL_FIT, below), in the answer's merge or in the twin hypothesis' one. An experimental model the rigid body does not place — a deposited structure of another crystal form, a model of a subgroup the data were merged above, a file with no crystal cell — is then searched for by molecular replacement: as many copies as the cell holds, in every space group the merge cannot tell apart and in the twin hypothesis' subgroup (the search and its keys are in Molecular replacement). A predicted model — AlphaFold or ModelCIF, recognised from the file's content (pLDDT in the B column) — has no placement of its own and goes to molecular replacement straight away, trimmed to the residues of pLDDT 70 and above and, where the AlphaFold DB's predicted-aligned-error JSON sits beside it under its own name, cut into rigid domains. --mr <file> is --model with the rigid body skipped: molecular replacement straight away, whatever the model. The report says which way the model was placed, MODEL_PLACEMENT= RIGID_BODY, MR or NOT_PLACED; a model placed nowhere is a result, not a warning, and the reflection files are then what a run without a model writes. Where molecular replacement placed it, the R-factors, the maps and the placed model below are those of its placement. Molecular replacement is part of the full --mode mx run, rotation and serial stills alike; --mode scale (below) places the model by the rigid body alone.

A placed model changes two things in <prefix>.mtz/.cif/.hkl and nothing else: the enantiomorph label and, placed by the rigid body, the indexing ambiguity (molecular replacement relabels the hand, past the same anomalous check, and never reindexes). Where the model chooses another space group with the answer's rotations, or the twin hypothesis' subgroup, the answer's files stay the run's own and that merge is written beside them as <prefix>_mr.mtz/.cif — from the merge it was chosen on, with the twin law and fraction where it is the subgroup — together with the model as placed there, <prefix>_mr_model.pdb/.cif; the report names them (MODEL_CHOICE_FILE_PREFIX=, MODEL_CHOICE_SPACE_GROUP=).

Because the model moves, the input file no longer describes these maps, so the model as placed is written as <prefix>_model.cif — the input's chains, residues, ligands, waters, B-factors, occupancies and anisotropic Us, at the coordinates the maps were computed from, in the same unit cell and space group as <prefix>.mtz beside it. The same coordinates are written as <prefix>_model.pdb as well, because the fragment-screening tools this file exists to feed take a PDB: PanDDA's per-dataset input is <name>.pdb beside <name>.mtz, and dimple produces that same 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 <prefix>_refined_model.cif with <prefix>_refined_maps.mtz (Refinement). (<prefix>.cif is the merged reflections — hence the separate name.)

Where the run also wrote a twin hypothesis — <prefix>_twin_<SG>.mtz/.cif, the same data merged in a subgroup with a twin law, written when the adopted space group may have absorbed one (see the twin hypothesis) — the model is scored against that merge as well, plainly and as twinned by the law, and the maps and <prefix>_model.cif come from whichever of the two merges the model fits better on R-free. The report says which (MAPS_FROM=) and gives the R-free of both. <prefix>.mtz and the space group are the run's own either way; where the model also fits that merge against its null, it has chosen the subgroup, and the merge is written once more as <prefix>_mr.mtz/.cif (above). The maps and the model are written only for a model that was placed (MODEL_PLACEMENT= RIGID_BODY or MR): one the data rejected and molecular replacement did not place is no model of this crystal, and its coordinates and maps would read as a placement. Its R-factors stay in the report as the negative result.

The model may be PDB or mmCIF, gzipped or not, and the format is taken from the file's own content rather than from its name — a model downloaded as .cif, .pdb, .ent or with no useful extension at all is read the same way. A model that cannot be read, or that has no atoms, no unit cell or no usable space group, does not fail the run: it is logged, and the results report carries a WARNING: Model validation did not run: … line, so a run that silently produced no R-free and no maps cannot be mistaken for one that was never given --model.

Either way the results report carries a 5. MODEL VALIDATION section: R_WORK= / R_FREE= with their reflection counts, R_MODEL_SHELL_SCALED= and MODEL_RADIAL_MISFIT= beside them (the R that compares between two runs, and why the other two do not — see RUGNUX_REPORT), the bulk-solvent and overall scale parameters, the mean 2mFo−DFc density at the atom centres, the reindexing operators the written reflections were brought into the model's frame with, and MAPS_PREFIX=; or MODEL_VALIDATION= NOT_PERFORMED with MODEL_VALIDATION_REASON= when the model could not be used. A run given no --model has no such section at all.

It is a data-quality lens, independent of the internal statistics: R-free measures the merged intensities against external truth, where CC1/2 and Rmeas only measure them against themselves. It also settles the two things merged intensities alone cannot, in two different ways — though only where the data accept the model first: the same model is refitted, and re-placed, from random orientations about its own centroid, and the real fit has to beat that null (MODEL_FIT= in the report; §14.5). A model that fits no better than its own random placements decides nothing, and the reflection files are byte for byte what a run with no model would have written. The enantiomorph is a relabelling: data merged in P41212 against a P43212 model take the model's space group as the label they are written under, with no reflection moved and I(+)/I(-) exactly as measured. A merohedral indexing ambiguity — when no reference MTZ has already fixed it — is a reindexing: the candidate with the lowest R-free is kept — where its lead over the runner-up beats the lead a random placement of the same model takes — and applied to the written reflections as well as to the R-factors and the maps; otherwise the data keep the indexing they were merged in. This is distinct from a model written in another description of the lattice — other axes, a different unique axis, I-centred where the run indexed C-centred — or in another point group: there the model is first put into the data's description (MODEL_CHANGE_OF_BASIS=) to be scored. A model that asserts such a setting is then tested against its random placements like any other claim, and where it fits, the data move instead: the files are written in the model's setting (SETTING_SOURCE=MODEL), and the validation is made once more on those axes so the maps and _model.pdb match them. Where it does not fit, the files stay in the standard setting. Validation runs before the reflection files, so the .mtz / .cif / .hkl come out in the model's frame either way — reindexed where the ambiguity decided, and carrying the model's space group where the hand was adopted. The log names the operator in each case, and for the indexing choice gives the winning R-free together with the runner-up.

Re-scaling and re-merging (rugnux --mode scale)

The scale mode re-scales and merges the already-integrated reflections stored in a _process.h5 file, without re-running spot finding or integration. Use it to re-merge quickly with a different space group, resolution limit, anomalous setting or outlier rejection. It reuses the same -o/-N/-s/-e/-S/-A/-z/--scaling-* options as the full run, and (unlike the full pipeline) does not run a space-group search: it merges in the space group and unit cell the file records, and -S / -C override them. A _process.h5 written before the group was stored carries none, and merges in P1 unless -S says otherwise. Beside the reflection files and the report it writes <prefix>_plot.txt for its own merge - per image, the scale and whether the image's observations are in the merged data (the report's IMAGES_MERGED is the sum of that column).

A reference MTZ (-z) is accepted here on stills data, where it fixes the space group and cell, 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, --mr is refused, and the placed model is not refined. On rotation data, where 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. On stills the re-merge is the full run's own merge: the same frames (a given cell's population, as /entry/MX/stillsGivenUnitCell records it), the same rocking curve, the same data-only resolution of the indexing ambiguity and the same scaling, so a _process.h5 merged again with the options it was written with reproduces the full run's reflections (with a reference MTZ, the full run also lets the crystals' own cells overrule the reference's indexing before merging, which --mode scale does not).

Where the full run re-seated the lattice — the space group it settled on is in a different setting from the one each image was indexed in — the file records the change of basis as /entry/MX/reindexMatrix, and rugnux applies it on read, so the reflections and the stored cell describe the same frame. A file whose stored cell and reflections disagree stops with a message naming both cells and the exact -S/-C override to merge it in its own setting.

Several files

rugnux --mode scale -o combined run1_process.h5 run2_process.h5 run3_process.h5

The _process.h5 files of several stills runs of one crystal are merged as one run, as serial data from several collections usually are. Each frame keeps the geometry, wavelength and detector of its own file; the frames are taken file after file, in the order given, and numbered on from one file to the next, so the frames of different files stay distinct. The union is then merged exactly as one file is: the frames of the run's crystal form, each put on the run's cell, the indexing ambiguity resolved from the data over all the crystals together - so crystals of different files indexed in different alternative indexings, or on permuted axes of the same lattice, end up in one - and one scaling, post-refinement and merge. The cell, space group, given cell (/entry/MX/stillsGivenUnitCell) and rocking curve merged with are the first file's; the ice-ring gate pools the frames of all of them.

The files must be of one crystal: each file's cell the first's lattice (in its setting or another) and the same space group. A run stops with a message naming both cells, or both groups, where they are not - unless the cell is given (-C, or a reference -z) and, for the group, -S (or the group of a reference -z that states one): then everything is merged in what is given, and the crystals of a file not on that cell are left out. A mix of stills and rotation files is refused, and so are several rotation files (--mode scale merges one sweep at a time; several sweeps of one crystal are merged together from their masters by --mode mx). Under --force-still a rotation file counts as stills. -s/-e select images of one file and are refused with several. The log and the report (INPUT_nn) give each file's images, indexed crystals, merged crystals and those left out; the statistics are those of the merge of all of them.

The merged mmCIF (<prefix>.cif)

The .cif follows the PDBx/mmCIF dictionary and holds one data block, data_sample: the merged reflections (_refln: I, F and the Bijvoet mates, with the free set in _refln.status) and what describes them - the cell and space group; _software with Rugnux named twice, once for data reduction and once for data scaling; the experiment as the input file states it (_diffrn.ambient_temp from the sample temperature, the wavelength, the source's facility and 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, <I/σ(I)>, R_merge, R_meas, R_pim (? on a stills merge, where they mean nothing), 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 and the .hkl (both scaled on a rotation merge), not in the .cif.

Items PDBx does not define — ISa, the error model, the twinning and anisotropy diagnostics, the refined distance and beam centre — are written under the jfjoch_ local prefix, which a dictionary check reports as unknown and a deposition ignores.

Provenance

Every reflection file says where it came from, so that it can be traced back without the report beside it:

  • the .cif names the Rugnux version in _software.version and the commit it was built from in _software.description, and the command line, the input file (absolute path) and the input's identity under _jfjoch_provenance.command_line, .input_file and .input_identity;
  • the .mtz and the _unmerged.mtz carry the same in their HISTORY records (mtzdump prints them), each run on over further records where it is longer than the 80 characters of one.

The identity is the input file's size and modification time — for an HDF5 data set, the master file's — which tells two files of one name apart without reading the data. A collection followed from the broker is not a file here, and has none.

Command-line options

Every option, with what it does, is on its own page: Command-line options.