From fa94f24777900c9bc3cc6749f79f053c28657ebe Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Wed, 11 Nov 2026 20:23:03 +0100 Subject: [PATCH] rugnux: no MODEL_FREE_SET warning A model placed as given on a free set drawn by the run was flagged on nearly every run with a model (an orange triage row on 238 of 262 battery rotation sets), although it says nothing about the data. The warning and its code are gone; the refinement still does not let the as-given model compete on such a free set. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HVeDQsU5a8AJUdJPgWevAK --- README.md | 4 ++-- docs/CPU_DATA_ANALYSIS_REFINEMENT.md | 2 +- docs/RUGNUX_MODEL_AND_REFERENCE.md | 3 +-- docs/RUGNUX_REPORT.md | 2 +- rugnux/ReportDocument.h | 1 - rugnux/RugnuxScaleMerge.cpp | 18 ++---------------- 6 files changed, 7 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index b801fbd25..e68e1741a 100644 --- a/README.md +++ b/README.md @@ -169,8 +169,8 @@ rugnux -o sacla236 -C 79.45,79.45,38.15,90,90,90 -S P43212 --model 9V3D.pdb sacl It takes about 35 s and ends with ``` - Result WARNINGS: Merged to 1.69 A in P 43 21 2. 2 conditions need - attention: MODEL_FREE_SET, OVERLOADS. + Result WARNINGS: Merged to 1.69 A in P 43 21 2. 1 condition needs + attention: OVERLOADS. Space group P 43 21 2 Unit cell 79.343 79.343 38.121 90.000 90.000 90.000 Resolution 1.69 A written; the CC1/2 fall-off is fitted at 1.72 A diff --git a/docs/CPU_DATA_ANALYSIS_REFINEMENT.md b/docs/CPU_DATA_ANALYSIS_REFINEMENT.md index 87585bcec..b0a12e309 100644 --- a/docs/CPU_DATA_ANALYSIS_REFINEMENT.md +++ b/docs/CPU_DATA_ANALYSIS_REFINEMENT.md @@ -331,7 +331,7 @@ are: rule every trial is held to (its geometry within bounds and R-free lower beyond the tie), the model is written as it came, scaled to the data, and the solvent build's edits are undone (`REFINE_AS_GIVEN`). What comes out is never worse on the free set than what went in. This holds only where the free set is free to the model as given: a model - placed as given on a free set drawn by the run (`MODEL_FREE_SET`; in `--mode refine`, a file without free flags) has + placed as given on a free set drawn by the run (in `--mode refine`, a file without free flags) has most likely been refined against those reflections, and its R-free as given does not compete. Where the model has copies (§15.5), the NCS restraints are one more weight: every rung of the first ladder is run diff --git a/docs/RUGNUX_MODEL_AND_REFERENCE.md b/docs/RUGNUX_MODEL_AND_REFERENCE.md index 603b69420..34915dea2 100644 --- a/docs/RUGNUX_MODEL_AND_REFERENCE.md +++ b/docs/RUGNUX_MODEL_AND_REFERENCE.md @@ -364,8 +364,7 @@ the reflections it was refined against (the deposited `-sf.cif`, or an MTZ) and `-z` it fixes no group, cell or frame and steers no processing. The flags are put on the merge once it is on the model's axes, where the merge matches the file's intensities as `-z` requires (CC at least 0.5 over at least half of its reflections); the validation is then made again on them, and the refinement and the merged files carry -them. `R_FREE_FLAGS=` says which set `R_FREE` and the refinement used: `DRAWN`, `REFERENCE` (`-z`) or `FILE`. A -model placed as given and scored on a set drawn here is warned about (`MODEL_FREE_SET`). +them. `R_FREE_FLAGS=` says which set `R_FREE` and the refinement used: `DRAWN`, `REFERENCE` (`-z`) or `FILE`. **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 diff --git a/docs/RUGNUX_REPORT.md b/docs/RUGNUX_REPORT.md index ac86760bc..8d6b794c6 100644 --- a/docs/RUGNUX_REPORT.md +++ b/docs/RUGNUX_REPORT.md @@ -287,7 +287,7 @@ hundred lines. consumer switches on a code rather than parsing a sentence: `NO_LATTICE`, `INDEXING_AMBIGUITY`, `SYMMETRY_AMBIGUITY`, `CENTERING_UNTESTED`, `UNUSABLE_MERGE`, `LOW_COMPLETENESS`, `SWEEP_GAPS`, `GONIO_SCALE`, `SPINDLE_CAP`, `ANISOTROPY`, `TWINNING`, `PSEUDO_TRANSLATION`, - `LATTICE_TRANSLATION`, `MODEL_HAND`, `MODEL_NOT_VALIDATED`, `MODEL_FREE_SET`, `MODEL_SPACE_GROUP`, `REFERENCE_MISMATCH`, `CANCELLED`, `RESOLUTION_FIT`, + `LATTICE_TRANSLATION`, `MODEL_HAND`, `MODEL_NOT_VALIDATED`, `MODEL_SPACE_GROUP`, `REFERENCE_MISMATCH`, `CANCELLED`, `RESOLUTION_FIT`, `FLIGHT_PATH`, `GEOMETRY_NOT_CONVERGED`, `SCALING_NOT_CONVERGED`, `HARMONIC_CONTAMINATION`, `SUPERCELL_POSSIBLE`, `MULTIPLE_LATTICES`, `LATTICE_EXPLAINS_FEW_SPOTS`, `CELL_FORMS`, `ICE_RINGS`, `POWDER_RINGS`, `BEAM_CENTRE_OFF`, `OVERLOADS`, `OVERLAPS`, `SWEEP_LEFT_OUT`. `NONE` when nothing fired. A code appears if and only if its warning fired, so the flags and the `WARNING:` lines are two renderings of one list. Thresholds are diff --git a/rugnux/ReportDocument.h b/rugnux/ReportDocument.h index 660a83dcd..3845c3a66 100644 --- a/rugnux/ReportDocument.h +++ b/rugnux/ReportDocument.h @@ -36,7 +36,6 @@ namespace PathologyCode { constexpr const char *TWINNING = "TWINNING"; // twinning indicated constexpr const char *MODEL_HAND = "MODEL_HAND"; // data and model in opposite hands constexpr const char *MODEL_NOT_VALIDATED = "MODEL_NOT_VALIDATED"; // a model was given, not usable - constexpr const char *MODEL_FREE_SET = "MODEL_FREE_SET"; // the model as given was scored on a free set drawn here constexpr const char *MODEL_SPACE_GROUP = "MODEL_SPACE_GROUP"; // the model's group replaced the one fixed with -S constexpr const char *REFERENCE_MISMATCH = "REFERENCE_MISMATCH"; // the reference MTZ does not match; free flags not inherited constexpr const char *CANCELLED = "CANCELLED"; // the run did not finish diff --git a/rugnux/RugnuxScaleMerge.cpp b/rugnux/RugnuxScaleMerge.cpp index b1646a36a..c1fab8bbb 100644 --- a/rugnux/RugnuxScaleMerge.cpp +++ b/rugnux/RugnuxScaleMerge.cpp @@ -5249,20 +5249,6 @@ bool Rugnux::ScaleMergeAndSymmetry(PipelineLocals &p) { } } placed_by_rigid_body = validation.ok && validation.model_fits; - // A model placed as given was refined, most likely, against reflections of this crystal - the deposited - // ones, or an earlier dataset's - and so has seen every reflection of a free set drawn here. - if (placed_by_rigid_body && result.free_flags_source == "DRAWN") { - std::string msg = "R-free may not be a free statistic: the free set was drawn by this run, and a model " - "refined against these reflections (a deposited model, or one refined against earlier " - "data of this crystal) has been fitted to all of them"; - msg += config_.free_flags.empty() - ? ". Give the reflections it was refined against with --free-flags to take their test set" - : fmt::format(". The --free-flags file does not match these data on the model's axes (CC {:.3f} " - "over {:.0f}% of the merged reflections), so its test set was not taken", - free_flags_match.cc, 100.0 * free_flags_match.matched_fraction); - logger.Warning("{}", msg); - result.warnings.push_back({PathologyCode::MODEL_FREE_SET, msg}); - } // The coordinates that go with the maps just written, in the frame the reflection files // beside them carry. Written whenever the validation ran, not only where the rigid-body // step moved the model: it is also re-fractionalized into the data cell and may be @@ -5633,8 +5619,8 @@ bool Rugnux::ScaleMergeAndSymmetry(PipelineLocals &p) { // refinement takes a law at a smaller lead over its null (AdoptTwinLaw). settings.twin_data_indicated = TwinningVerdictKey(result) == "INDICATED" && result.twinning.twin_fraction_source == TwinFractionSource::LTest; - // a model placed as given on a free set drawn here has seen those reflections (MODEL_FREE_SET): its R-free - // as given is no free statistic to keep it by + // a model placed as given on a free set drawn here was most likely refined against those reflections: its + // R-free as given is no free statistic to keep it by settings.as_given_competes = !(result.model_placement == "RIGID_BODY" && result.free_flags_source == "DRAWN"); const PlacedModelOutput p = *placed_model_out; // a copy: a rival taken below replaces *placed_model_out // In the group RefinableIn chose: the model's own where it has the rotations of the group written -