A new page, RUGNUX_MODEL_AND_REFERENCE.md, beside the other rugnux pages in the toctree and
linked from RUGNUX.md and the --model section of RUGNUX_ADVANCED.md. It lists every option that
brings in a model or reference data (--model, --mr, the PAE file beside a prediction, -z and
--reference-column, -S, -C, --force-rotation-lattice, --report-resolution), sorts every decision
into data-only, model-informed label in <prefix>.mtz (hand past the anomalous veto, indexing
ambiguity, setting), model-driven separate files (<prefix>_mr) and report-only statistics, walks a
--model run step by step, says exactly where a model can touch the space group and what guards it
(the null, the anomalous veto, the indexing margin, the MR rules, the wrong-model battery step),
and describes the free set and model bias (a deposited model's R-free on rugnux's own test set is
not cross-validated; -z with the PDB's structure factors inherits the depositor's set). Includes the
one pre-merge use of a model: serial stills with -C/-S, where it breaks the per-image indexing
ambiguity. Documentation only; behaviour as merged in rc175 (7ed970503).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EizBKhTqrAYago9KJG3dA3
## Every option that brings in a model or reference data
| Option | What you give | What Rugnux uses it for | Can it change `<prefix>.mtz`? |
|---|---|---|---|
| *(none)* | — | Everything from the data | — |
| `--model <file>` | An atomic model, PDB or mmCIF, gzipped or not, recognised by content: an experimental structure or a prediction | Validation after the merge (R-work/R-free, CC(model, data), maps, the placed model); a rigid-body placement checked against a null, with molecular replacement where the rigid body does not place it, and straight away for a prediction | Labels only (hand, indexing, axes), and only where the model fits. Other space groups → `<prefix>_mr.*` |
| `--mr <file>` | The same kinds of model | As `--model`, but molecular replacement straight away, without the rigid body. `--mode mx` only, not together with `--model` | Hand label only. Other space groups → `<prefix>_mr.*` |
| PAE file beside a prediction | `AF-<id>-F1-predicted_aligned_error_v<n>.json` next to `AF-<id>-F1-model_v<n>.cif` (read automatically, no option) | Cuts the prediction into rigid domains for molecular replacement | No (a domain alone can only confirm the answer's group) |
| `-z, --reference <file>` (`--reference-mtz`) | Merged data of the same crystal form: an MTZ, or a PDB structure-factor mmCIF (`-sf.cif`) | Fixes the space group (in its own setting) and the cell (softly), puts the merge on its axes, resolves the indexing ambiguity, hands over its R-free set, reports CC<sub>ref</sub> on stills. Never a scale anchor | **Yes**: the space group, the axes, the indexing and the free set are the reference's |
| `--reference-column <label>` | An MTZ column label | Which column of the reference is read | Through `-z` only |
| `-S, --space-group` | A space group | Fixes it: no space-group search | **Yes**: the group is yours (a fitting model may still relabel its hand) |
| `-C, --unit-cell` | A cell | Indexing looks for this cell (within tolerance); the FFT search range is widened to cover it; on stills it turns on the shared-geometry refinement and, with `-S` and `--model`, the per-image use of the model | **Yes**: the cell, and the axis order the files are written in |
| `--force-rotation-lattice` | Nine numbers: a lattice | Skips the first-pass indexing and uses this lattice | **Yes**: the lattice |
| `--report-resolution <dmin>[,<dmax>]` | Another program's resolution range | A second statistics table at that range (`REFRES_*`) | No — report only |
`-S`, `-C`, `-z` and `--force-rotation-lattice` are *assertions*: Rugnux takes them as true and
does not test them against a null. Use them when you know; leave them out to let the data decide
(a de-novo run is the recommended default — see [Running Rugnux](RUGNUX_TUTORIAL.md#rotation-data)).
`--model` and `--mr` are *hypotheses*: Rugnux tests them, and what it lets them change is limited
and stated below. In `--mode calibration` a cell given with `-C` names the calibrant instead
([Detector calibration](RUGNUX_CALIBRATION.md)); nothing on this page applies there.
## Four kinds of influence
Every decision and every output of a run falls in one of four classes. The decision table below uses
these letters.
- **(a) Data only.** Never influenced by any model. The same with and without `--model`/`--mr`.
- **(b) Model-informed label in `<prefix>.mtz`.** A choice between alternatives the data *cannot*
separate and that are all equally valid descriptions of the same measurement: the hand of an
enantiomorphic pair, an indexing ambiguity, the setting (axes). The model may make it only after it
has passed its null; the intensities do not change. Reported as `SPACE_GROUP_ENANTIOMORPH=
| Resolution cut | data (CC1/2 fall-off) | — | — | — (`CC_MODEL_CONFIRMED_TO_D_MIN` is reported, never used) | (a) |
| Point group, Laue class, centring | data (space-group search) | `-S` fixes it | the reference's | — | (a) |
| Screw axes (space group within the point group) | data | `-S` | the reference's | a different choice → `<prefix>_mr.*` only | (a) in `p.mtz`, (c) beside it |
| Hand (enantiomorph) | not decidable: `SPACE_GROUP_ENANTIOMORPH= UNDETERMINED` | `GIVEN` | `GIVEN` | relabelled to the model's where it fits, past the anomalous veto: `ASSUMED_FROM_MODEL` | (b) |
| Indexing ambiguity (merohedral reindex) | arbitrary on rotation (`INDEXING_AMBIGUITY_OPERATORS=`); mixed on stills (warning) | — | resolved against the reference | resolved by the rigid-body model where its lead beats its null, rotation; per image on stills with `-C`/`-S`. Never by molecular replacement | (b) |
| Setting (which axis is a, b, c) | standard setting | `-C`'s axis order; `-S`'s symbol | the reference's | the model's, where it fits and there is no `-z` (`SETTING_SOURCE= MODEL`) | (b) |
| Twin hypothesis `<prefix>_twin_<SG>.*` | data (when the group may have absorbed a twin law) | — | — | the model may also *ask* for this merge; written then only where the model chooses it | (a) / (c) |
| Anomalous signal, Friedel handling | data (`-A`) | — | — | — (the anomalous map is report-only, and the veto on the hand) | (a) |
| R-free test set | hash of the index | — | the reference's flags, where it matches | — (drawn again on the model's axes if the setting moved; never chosen by the model) | (a) |
| Merged intensities and sigmas in `p.mtz` | data | — | — | — | (a) |
| `p.mtz` space-group label | data | yours | the reference's | hand relabel only | (b) |
| `<prefix>_mr.mtz`/`.cif`, `<prefix>_mr_model.*` | not written | — | — | another group or the twin subgroup the model chose | (c) |
| Maps, `<prefix>_model.*`, section 5 of the report | not written | — | — | always, whatever the verdict | (d) |
## A run with `--model`, step by step
1. **The file is read and classified.** PDB or mmCIF, by content. A **prediction** — ModelCIF's
quality metrics, or no cell and one B value per residue between 0 and 100 (an AlphaFold file) —
is told apart from an **experimental structure** (`MR_MODEL_KIND=`). A model that cannot be read
does not fail the run; the report says `MODEL_VALIDATION= NOT_PERFORMED` and carries a warning.
2. **The data are processed without the model.** Indexing, integration, scaling, the space-group
search, the resolution cut, the error model, outlier rejection: none of them reads the model
(on serial stills with `-C`/`-S`, see the next section). The only thing the model asks for here is
one extra merge: the merge in a subgroup (the twin hypothesis) where the indexed lattice's group
was promoted by a metric re-ask, or where the model's own group has fewer rotations than the
adopted one — so that the model can be scored there. That merge is written only if the model
chooses it.
3. **Rigid-body placement** (experimental structures, not with `--mr`). The model is put into the
data's cell and refined as one rigid body on the working reflections; the step is kept only if
it lowers R-free. A model written in another description of the lattice (other axes, other
centring) is first put into the data's (`MODEL_CHANGE_OF_BASIS=`).
4. **The null.** The same model is turned to nine random orientations about its own centroid and
placed the same way. The real fit has to beat them by 4.51 of their standard deviations on
R-work (3σ allowing for the null being nine draws): `MODEL_FIT= ACCEPTED`, `MODEL_FIT_SIGMA=`.
Otherwise `REJECTED`, and the model decides nothing. There is no fixed threshold on R
- **The wrong-model test.** Rugnux's validation battery runs a set of datasets once without a model
and once with each of five models of *unrelated* proteins (similar size, unrelated sequence and
fold, and for the enantiomorphic sets a model in the other hand), and requires the reflection data
and every report key outside section 5 to be identical, `MODEL_FIT` not accepted, molecular
replacement not placing the model and no model decision taken
("The wrong-model null" in `tools/battery/README.md`; see also [Tests](TESTS.md)).
## Free set and model bias
**How the free set is made.** Rugnux draws its own test set (5 %, raised towards about 500 reflections on small data but never above 10 %):
each reflection's flag is a hash of its index, taken over its orbit under the lattice's metric
symmetry, so symmetry mates, Friedel mates and twin-law mates share a flag, every dataset of one
crystal form written on the same axes gets the same set, and the set does not depend on the space
group a file is merged in
([R-free test-set flags](CPU_DATA_ANALYSIS_INTEGRATION.md#107-r-free-test-set-flags)). The model
plays no part in it. Where a fitting model moves the files to its setting, the set is drawn again on
the new axes by the same rule; an indexing-ambiguity reindex leaves it unchanged, since twin-law
mates share a flag. With `-z`, the reference's flags are inherited where the merge matches it
(`REFERENCE_FREE_FLAGS_INHERITED=`).
**What is fitted on which reflections.** Everything fitted to place and scale the model — the
overall scale, the anisotropic *B*, the bulk solvent, the rigid body — is fitted on the working
reflections only. The free set is then used for a few discrete *selections*: whether the rigid-body
step is kept, which indexing wins, and in molecular replacement which placement and which group.
Each of those leaves R-free very slightly optimistic where it fires. The coordinates, B-factors and
occupancies of the model are never refined.
**What `R_FREE` means here — and what it does not.** It is the model as placed, scored on Rugnux's
free set: a check that the model fits these data, and a trend number between datasets of one
campaign. It is **not** a refinement R-free, and it is not cross-validated against the model's own
history:
- A **deposited model** was refined by its depositor against *their* working set. Rugnux's free set
is a different 5 %, so about 95 % of Rugnux's free reflections were in the working set the model
was refined on. R-free here therefore reads close to R-work (the two differ by a median 0.001
over our corpus), and it is optimistic in the usual model-bias sense.
- To score a deposited model on its own test set, give its structure factors as the reference
(`-z 1abc-sf.cif`): the depositor's free flags are then inherited. But `-z` is an assertion — it
also fixes the space group and the cell — so that is no longer a de-novo run.
- A **predicted model** has not been refined against any diffraction data, so it carries no such
memory; what remains is the selection effect above.
- For comparing two runs against one model, read `R_MODEL_SHELL_SCALED`, not `R_FREE`
([Comparing two runs](RUGNUX_REPORT.md#comparing-two-runs-r_model_shell_scaled)).
**What cannot leak, and what can.** The model never enters the merged intensities, their sigmas, the
choice of reflections, the resolution cut or the weights, so `<prefix>.mtz` carries no model bias in
its numbers — only the class-(b) labels. The **maps** are model-phased, and carry the model bias any
model-phased map carries: read the mFo−DFc map, and treat density that only the 2mFo−DFc map shows
with the usual care. CC(model, data) is read in one direction only: a confirmed shell is evidence for
the data, a weak shell says nothing about them, and nothing acts on it.
## Practical guidance
**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
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.
- **You have a structure of the same protein in another crystal form**: `--model` too. The rigid
body will not place it, and molecular replacement is tried automatically.
- **You have only a prediction** (AlphaFold, ModelCIF): `--model` (or `--mr`). Download the PAE JSON
with it and keep its AlphaFold DB file name, so it is cut into domains when the whole model does
not place. A prediction is good for: confirming the space group, naming the hand where the data
cannot, offering a twinned or lower-symmetry alternative where the data are ambiguous, and a
first set of maps. It is not a refined model, and its R-factors read accordingly.
- **You have a previous dataset of the same crystal form** and want the same indexing and free set:
`-z`, not `--model`. It is the stronger tool for the indexing ambiguity and the only one that
carries a free set over, but it pins the space group and cell.
- **You want to compare with another program's statistics**: `--report-resolution`, which changes
nothing else.
**Which file to use for what.**
| File | What it is | Use it for |
|---|---|---|
| `<prefix>.mtz` / `.cif` / `.hkl` | The answer: the data's space group, with only the class-(b) labels from the model | Refinement, deposition, everything by default |
| `<prefix>_model.cif` / `.pdb`, `<prefix>_2fofc.ccp4`, `_fofc.ccp4`, `_anom.ccp4`, `_maps.mtz` | The model as placed, in the frame of `<prefix>.mtz`, and its maps | Starting refinement (REFMAC5, phenix.refine), PanDDA, Coot |
| `<prefix>_twin_<SG>.mtz` / `.cif` | The same data merged in a subgroup with a twin law — written from the data, model or not | Twin refinement, where you suspect the higher group absorbed a twin law |
| `<prefix>_mr.mtz` / `.cif`, `<prefix>_mr_model.pdb` / `.cif`, `<prefix>_mr_*` maps | The merge in the space group the model chose (`MODEL_CHOICE_SPACE_GROUP=`), and the model placed there | Refinement *if* you accept the model's choice; compare R-free against the answer's |
`<prefix>_mr` and `<prefix>_twin_<SG>` can describe the same subgroup; the `_mr` file then also
carries the model placed in it.
**Reading section 5 of the report**, in order:
1. `MODEL_VALIDATION=` — did it run? If `NOT_PERFORMED`, `MODEL_VALIDATION_REASON=` says why.
2. `MODEL_PLACEMENT=` — how the model was placed: `RIGID_BODY`, `MR` or `NOT_PLACED`.
3. `MODEL_FIT=`, `MODEL_FIT_SIGMA=` — the rigid body's verdict against its null. Absent where the
rigid body was not tried (a prediction, `--mr`).
4. `MODEL_DECISIONS_TAKEN=` — `NONE` means the reflection files are what a run without a model
writes. Otherwise `ENANTIOMORPH`, `INDEXING`, both, or `MR_ENANTIOMORPH`, with
`MODEL_ENANTIOMORPH_ADOPTED=` and `MODEL_INDEXING_OPERATOR=`.
5. `MODEL_CHOICE_FILE_PREFIX=`, `MODEL_CHOICE_SPACE_GROUP=`, `MR_DECISION=` — whether a
`<prefix>_mr` file was written, and in which group.
6. `R_WORK=`, `R_FREE=`, `CC_MODEL_CONFIRMED_TO_D_MIN=`, the anomalous sites — how well the placed
model describes the data (class d).
Outside section 5, `SPACE_GROUP_ENANTIOMORPH=` (`UNDETERMINED`, `GIVEN` or `ASSUMED_FROM_MODEL`),
`SETTING_SOURCE=` and the presence or absence of `INDEXING_AMBIGUITY_OPERATORS=` say what the model
did to the answer's labels. Every key is described in [The results report](RUGNUX_REPORT.md#model-validation).
## Related pages
- [Advanced Rugnux](RUGNUX_ADVANCED.md#reference-data-and-the-indexing-ambiguity) — what `-z` does,
the indexing ambiguity, the setting the files are written in, and
[validating against a model](RUGNUX_ADVANCED.md#validating-against-a-model-rugnux---model).
@@ -26,6 +26,7 @@ Jungfraujoch is distributed under the GPLv3 license.
RUGNUX_INTEGRATION
RUGNUX_REPORT
RUGNUX_ADVANCED
RUGNUX_MODEL_AND_REFERENCE
RUGNUX_CALIBRATION
CPU_DATA_ANALYSIS
CPU_DATA_ANALYSIS_IMAGE
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.