Stills: --model no longer changes the processing - its intensities are not the per-image reference
Since rc164 a serial-stills run given --model with -C/-S computed structure factors from the model and handed them to the image pass as the reference intensities (ReferenceIntensities), the same path a reference MTZ takes. That reference also feeds the per-image scale and CC, so the frames dropped as collapsed, the radial scale, the indexing-ambiguity choice and from there the whole merge differed with and without the model: on a PAL CCD set CC1/2 0.976 without it, 0.893 with it, at the same code. A model is placed and validated after the merge; only a reference MTZ (-z) is a processing input now. The data-only ambiguity resolution (space group given) runs as without a model, and validation still relabels the finished merge into the model's indexing where it wins. With and without --model the merged reflections of that set are now identical, bit for bit. Docs updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HVeDQqN9qRD57vnShzTC37
This commit is contained in:
1 parent
9082280311
commit
da641c603a
5 files changed
+19
-35
No files matched your search
@@ -46,10 +46,10 @@ 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 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.
|
||||
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](#validating-against-a-model-rugnux---model)) - by relabelling it, never by re-merging.
|
||||
|
||||
### The indexing ambiguity
|
||||
|
||||
@@ -102,15 +102,15 @@ How to resolve it:
|
||||
| **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`. Resolved **per image**, at integration time, by correlating each crystal's intensities with the reference — so the merge never mixes hands in the first place. Where the crystals' own cells tell the indexings apart (pseudo-merohedry), a crystal its cell decides keeps that indexing and the reference decides the rest. The data-only resolution below runs as a check: `AMBIGUITY_DATA_DISAGREES=` |
|
||||
| **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 | `--model model.pdb`, with the cell and space group given (`-C` / `-S`). Structure factors are computed from the model up front and used as the reference for the per-image test, exactly as a reference MTZ would be, the crystals their own cell decides again excepted. The data-only resolution below is then run only as a check: `AMBIGUITY_DATA_DISAGREES=` counts the crystals on which it would have chosen otherwise |
|
||||
| **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 model or reference still settles the weakest crystals more reliably than the other crystals can, and puts the merge in its own indexing |
|
||||
| **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` cannot repair a stills run after the fact.** The per-image test happens at
|
||||
integration time, so a `_process.h5` whose images were integrated without a reference — an MTZ or a
|
||||
model — has already lost the distinction, and no re-merge brings it back; the data-only resolution
|
||||
integration time, so a `_process.h5` whose images were integrated without a reference MTZ has
|
||||
already lost the distinction, and no re-merge brings it back; the data-only resolution
|
||||
runs in the full pipeline, not in `--mode scale`. 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
|
||||
|
||||
+1
-1
@@ -304,7 +304,7 @@ serial stills; `fft` (GPU) / `fftw` (CPU) index **de novo** and suit strong rota
|
||||
| `-z, --reference <file>` | Reference data of the same crystal form — an MTZ or a PDB structure-factor mmCIF (`-sf.cif`), gzipped or not, recognised by content; `--reference-mtz` is the same option: fixes the space group, its setting and the cell, resolves the [indexing ambiguity](RUGNUX_ADVANCED.md#the-indexing-ambiguity), hands over the R-free set and reports CC<sub>ref</sub>. Not a scale anchor |
|
||||
| `--free-flags <file>` | Take only the R-free test set of this MTZ or structure-factor mmCIF - e.g. the deposited reflections of the `--model` - for the validation, the refinement and the merged files; nothing else of the file is used, so unlike `-z` it fixes no space group, cell or frame. Taken on the model's axes where the merge matches the file's intensities (`R_FREE_FLAGS=`, see [Free set and model bias](RUGNUX_MODEL_AND_REFERENCE.md#free-set-and-model-bias)) |
|
||||
| `--reference-column <label>` | Reference column to use, by MTZ label — an mmCIF under the labels `gemmi cif2mtz` gives it (default: auto — F-model, else IMEAN/I/…, else FP/FOBS/F) |
|
||||
| `--model <file>` | Validate the merged intensities against this atomic model (PDB or mmCIF, gzipped or not; the format is taken from the file's content) — R-work / R-free and maps (see [Validating against a model](RUGNUX_ADVANCED.md#validating-against-a-model-rugnux---model)). An experimental model is placed as a rigid body, and by molecular replacement where the rigid body does not place it; a prediction (AlphaFold or ModelCIF) goes to molecular replacement straight away (`MODEL_PLACEMENT=`). It also settles the frame the reflections are written in: the enantiomorph, and the [indexing ambiguity](RUGNUX_ADVANCED.md#the-indexing-ambiguity) where no `-z` did; another space group or the twin hypothesis' subgroup it chooses is written beside the answer as `<prefix>_mr.mtz`/`.cif`. For serial stills given `-C` / `-S`, the model's structure factors become the per-image reference. A placed model is then [refined](RUGNUX_MODEL_AND_REFERENCE.md#refinement) against the merge it was placed on (`<prefix>_refined_model.cif`, `<prefix>_refined_maps.mtz`, `<prefix>_blobs.json`, `REFINE_` keys) - seconds on a GPU, typically 2-15 minutes on the CPU - which decides nothing about the processing |
|
||||
| `--model <file>` | Validate the merged intensities against this atomic model (PDB or mmCIF, gzipped or not; the format is taken from the file's content) — R-work / R-free and maps (see [Validating against a model](RUGNUX_ADVANCED.md#validating-against-a-model-rugnux---model)). An experimental model is placed as a rigid body, and by molecular replacement where the rigid body does not place it; a prediction (AlphaFold or ModelCIF) goes to molecular replacement straight away (`MODEL_PLACEMENT=`). It also settles the frame the reflections are written in: the enantiomorph, and the [indexing ambiguity](RUGNUX_ADVANCED.md#the-indexing-ambiguity) where no `-z` did; another space group or the twin hypothesis' subgroup it chooses is written beside the answer as `<prefix>_mr.mtz`/`.cif`. It does not change the processing: the merge is the same with and without it. A placed model is then [refined](RUGNUX_MODEL_AND_REFERENCE.md#refinement) against the merge it was placed on (`<prefix>_refined_model.cif`, `<prefix>_refined_maps.mtz`, `<prefix>_blobs.json`, `REFINE_` keys) - seconds on a GPU, typically 2-15 minutes on the CPU - which decides nothing about the processing |
|
||||
| `--mr <file>` | As `--model`, but placed by molecular replacement straight away, without trying the rigid body first: as many copies as the cell holds, in every space group the merge cannot tell apart and in the twin hypothesis' subgroup. A prediction is 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 it is cut into rigid domains; any other PDB or mmCIF is taken as an experimental structure, its polymer only (no waters, ligands, hydrogens or alternative conformers). It may relabel the enantiomorph of the answer, and a different space group it chooses is written beside the answer as `<prefix>_mr.mtz`/`.cif` with the placed model `<prefix>_mr_model.pdb`. `--mode mx` only; not with `--model` |
|
||||
| `--no-refine` | Do not refine the placed model (for debugging): by default a model that `--model` or `--mr` places is refined |
|
||||
| `--no-refine-solvent` | Refine the placed model with its solvent as given: no waters built or removed, no ion relabelled (the solvent audit - the `REFINE_SOLVENT_` keys and `<prefix>_solvent.json` - is still made). Also with `--mode refine` |
|
||||
|
||||
@@ -189,9 +189,9 @@ A crystal form with an [indexing ambiguity](RUGNUX_ADVANCED.md#the-indexing-ambi
|
||||
relatives — needs the space group on the run that integrates: every crystal is indexed in one of the
|
||||
alternative indexings at random, and they are averaged together in the merge unless the crystals are put
|
||||
into one first. With `-S` given, the run does that from the data alone, making the crystals consistent
|
||||
with each other (`INDEXING_AMBIGUITY_RESOLVED= data`); a reference (`-z`), or `--model model.pdb`
|
||||
together with `-C` and `-S`, puts each image into the reference's indexing instead, so that the merge
|
||||
also comes out in it. Without `-S` and without either, the mixed merge can look more symmetric than the
|
||||
with each other (`INDEXING_AMBIGUITY_RESOLVED= data`); a reference (`-z`) puts each image into the
|
||||
reference's indexing instead, so that the merge also comes out in it (a `--model` relabels the finished
|
||||
merge into its indexing and changes nothing else). Without `-S` and without a reference, the mixed merge can look more symmetric than the
|
||||
crystal is, and the run warns.
|
||||
|
||||
`ffbidx` requires a known cell (`-C`) and is the indexer of choice for sparse serial stills; the
|
||||
|
||||
+5
-20
@@ -1079,7 +1079,7 @@ ProcessResult Rugnux::RunPipeline(RugnuxObserver *observer, bool write_output, b
|
||||
if (result.outputs && !sink)
|
||||
scan_result.emplace(experiment_);
|
||||
// Whether anything is in place to break the indexing ambiguity, for the warning further down: a
|
||||
// reference MTZ, or (serial stills) the reference computed from a model just below.
|
||||
// reference MTZ.
|
||||
bool ambiguity_reference = !config_.reference_data.empty();
|
||||
if (sink) {
|
||||
fill_writer_maps();
|
||||
@@ -1137,26 +1137,11 @@ ProcessResult Rugnux::RunPipeline(RugnuxObserver *observer, bool write_output, b
|
||||
// geometry pre-pass, which measures the spots against it (SpotFootprint.h).
|
||||
if (!writer_queue && !(geometry_prepass && prescan_footprint_))
|
||||
indexer->KeepReflectionsInMessage(false);
|
||||
// The reference that breaks the per-image indexing ambiguity: a reference MTZ where there is
|
||||
// one, otherwise intensities computed from the model, which carry the same information. Serial
|
||||
// stills need it here or not at all - each crystal is indexed in its own hand, so by the time
|
||||
// there is a merge for --model to fit, the hands have already been averaged together. Rotation
|
||||
// data have one lattice and one hand, so their ambiguity is settled at the merge instead.
|
||||
std::vector<MergedReflection> model_reference;
|
||||
if (!config_.reference_data.empty()) {
|
||||
// The reference that breaks the per-image indexing ambiguity, where there is a reference MTZ. Never
|
||||
// intensities computed from --model: a model is placed and validated after the merge and does not
|
||||
// change the processing, so a run with one merges exactly what a run without one does.
|
||||
if (!config_.reference_data.empty())
|
||||
indexer->ReferenceIntensities(config_.reference_data);
|
||||
} else if (config_.model && !experiment_.IsRotationIndexing()
|
||||
&& experiment_.GetUnitCell().has_value() && experiment_.GetGemmiSpaceGroup().has_value()) {
|
||||
const auto d_min = experiment_.GetScalingSettings().GetHighResolutionLimit_A()
|
||||
.value_or(experiment_.GetDetectorMaxResolution_A());
|
||||
model_reference = ModelReferenceIntensities(
|
||||
*config_.model, experiment_.GetUnitCell(),
|
||||
&experiment_.GetSpaceGroupOrP1(), d_min, logger);
|
||||
if (!model_reference.empty()) {
|
||||
indexer->ReferenceIntensities(model_reference);
|
||||
ambiguity_reference = true;
|
||||
}
|
||||
}
|
||||
// Second pass of the rotation two-pass: predict with the smoothed mosaicity fitted in the pre-pass.
|
||||
if (!geometry_prepass && !prepass_mosaicity_.empty())
|
||||
indexer->SetPredictionMosaicityOverride(prepass_mosaicity_);
|
||||
|
||||
@@ -4474,7 +4474,6 @@ bool Rugnux::ScaleMergeAndSymmetry(PipelineLocals &p) {
|
||||
// A model can resolve it too, but whether it does is only known once the model has
|
||||
// been fitted (validation step below), so the warning stands here exactly as in a run
|
||||
// without a model, and is withdrawn there if the model's indexing probe decided it.
|
||||
// On serial stills with -C and -S the model is already in `ambiguity_reference`.
|
||||
if (!ambiguity_reference && experiment_.IsRotationIndexing()) {
|
||||
// One sweep has one orientation matrix, so every frame is in the same hand and the
|
||||
// merge mixes nothing. The hand is arbitrary, which matters only against other
|
||||
@@ -4489,8 +4488,8 @@ bool Rugnux::ScaleMergeAndSymmetry(PipelineLocals &p) {
|
||||
"(reindex operator(s): {}). 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 -C and -S here) resolves it against them.", laws);
|
||||
"Giving the space group (-S) resolves it from the data; a reference MTZ (-z) resolves it "
|
||||
"against that.", laws);
|
||||
logger.Warning("{}", msg);
|
||||
ambiguity_warning_text = " !! " + msg + "\n\n";
|
||||
stats_text << ambiguity_warning_text;
|
||||
|
||||
Reference in new issue
Block a user