Merge branch 'rc188-f' into rc188-int (round 5)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HVeDQrPqZ52Tp6rzzZGxf3
This commit is contained in:
leonarski_fandClaude Opus 5.5 committed 2026-11-18 19:10:35 +01:00
commit f08c512266
3 files changed
+10 -8

No files matched your search

+1 -1
View File
@@ -706,7 +706,7 @@ resolution: E. A. Merritt, "To B or not to B: a question of resolution?" (2012),
with more displacement parameters and one with fewer, the R-factor ratio test of W. C. Hamilton, "Significance
tests on the crystallographic R factor" (1965), Acta Cryst. 18, 502-510 (DOI not verified), decides first,
over a range of restraint weights as Merritt (2012) applies it, with PDB-REDO's (Joosten et al. 2012, above)
95%/30% rule and its bound of 18 reflections per atom for a U per atom; its F point is from E. Paulson,
95%/30% rule; its F point is from E. Paulson,
"An approximate normalization of the analysis of variance distribution" (1942), Ann. Math. Statist. 13,
233-235 [doi:10.1214/aoms/1177731608](https://doi.org/10.1214/aoms/1177731608).
+1 -1
View File
@@ -449,7 +449,7 @@ listed first - on a ladder, the tighter geometry - is kept otherwise). The trial
reflections from where the weights ended; on 49 refinements of 33 structures neither the cuts' rule nor leaving
out the U weight $\times 4$ changed a choice taken. A
trial displaces the one before it (the first: where the weights ended) only where its geometry is within bounds
and the free set prefers it: the free set tests the parameters a model adds, so the choice is made on the evidence of each run, not at a resolution (Merritt 2012). Between a model with more displacement parameters (TLS over a B per atom, a U per atom over either) and one with fewer, Hamilton's R-ratio test decides first, as Merritt (2012) and PDB-REDO apply it: the larger passes where its R-work is below the smaller's by more than the ratio $\sqrt{b/(n-m)\,F_{b,n-m,0.05} + 1}$, $n$ the working reflections, $m$ its displacement parameters (the positions are held) and $b$ the extra ones (Hamilton 1965; the F point by Paulson's approximation). The restraints are credited as $wR$ observations, $w$ unknown: each model's is scanned from 0 to the bound at which its restraints take every parameter they restrain off its count (Merritt's $N_\mathrm{atoms}/R$ for a B per atom, $6N_\mathrm{atoms}/R$ for a U per atom), six values each, independently. The larger model is taken where it passes more than 95% of the 36 tests, the smaller where it passes fewer than 30%, and in between the free set decides as everywhere else (PDB-REDO falls back on Z(R-free) and the R-free - R-work gap at fixed cut-offs instead; the paired rule is the one every other free-set choice here uses). A U per atom is tried only above 18 working reflections per refinable atom, PDB-REDO's bound.
and the free set prefers it: the free set tests the parameters a model adds, so the choice is made on the evidence of each run, not at a resolution (Merritt 2012). Between a model with more displacement parameters (TLS over a B per atom, a U per atom over either) and one with fewer, Hamilton's R-ratio test decides first, as Merritt (2012) and PDB-REDO apply it: the larger passes where its R-work is below the smaller's by more than the ratio $\sqrt{b/(n-m)\,F_{b,n-m,0.05} + 1}$, $n$ the working reflections, $m$ its displacement parameters (the positions are held) and $b$ the extra ones (Hamilton 1965; the F point by Paulson's approximation). The restraints are credited as $wR$ observations, $w$ unknown: each model's is scanned from 0 to the bound at which its restraints take every parameter they restrain off its count (Merritt's $N_\mathrm{atoms}/R$ for a B per atom, $6N_\mathrm{atoms}/R$ for a U per atom), six values each, independently. The larger model is taken where it passes more than 95% of the 36 tests, the smaller where it passes fewer than 30%, and in between the free set decides as everywhere else, the larger model then with its R-free lower outright rather than within the tie (the burden of the evidence is on the parameters it adds; PDB-REDO falls back on Z(R-free) and the R-free - R-work gap at fixed cut-offs instead, and the paired rule is the one every other free-set choice here uses). A U per atom is tried wherever it is affordable: where the working reflections outnumber the parameters of the model with it counted unrestrained, nine per atom with the positions as Merritt counts them - the end of the range of weights at which Hamilton's test can be taken at all - rather than above a fixed number of reflections per atom.
The refined U are written as ANISOU and the TLS groups as `_pdbx_refine_tls*` and `REMARK 3` (`REFINE_ADP_MODEL`,
`REFINE_ANISO_ATOMS`, `REFINE_TLS_GROUPS`). It is decided after the solvent build (§15.10), on the model with its
solvent: a water a round put in refines a U of its own in the per-atom trial as every refinable atom does, and no
@@ -143,8 +143,6 @@ double HamiltonPassFraction(const RefinementWeightTrial &large, const Refinement
// tests (HamiltonPassFraction), the smaller where it passes fewer than the other, and the free set's choice between
// (as PDB-REDO; Joosten et al. 2012).
constexpr double HAMILTON_LARGER = 0.95, HAMILTON_SMALLER = 0.30;
// A U per atom is tried only above this many working reflections per refinable atom (as PDB-REDO; Joosten et al. 2012).
constexpr double U_MIN_REFLECTIONS_PER_ATOM = 18;
// Every other step is taken on the work-set target (WorkTarget) where it lowers it by more than this, relative.
constexpr double TARGET_TOLERANCE = 1e-4;
// The rounds of RefineOnce's weight and displacement-model choice (4b.): the first from the model as given, each
@@ -4314,11 +4312,14 @@ RefinementResult RefineOnce(const gemmi::Structure &placed, const std::vector<Me
state.trial.r_free, state.trial.nll_free);
std::vector<AdpHypothesis> hyps = AdpHypotheses(ctx, topo, own_tls);
const double w = state.trial.weight, adp = state.trial.adp_weight > 0 ? state.trial.adp_weight : adp_w0;
// a U per atom only where the data are many times its parameters
// a U per atom only where it is affordable: where the working reflections outnumber the parameters of the
// model with it, the positions and the six U of every atom, counted unrestrained (Merritt (2012) counts
// the positions with them) - the end of the range of restraint weights where Hamilton's test can be taken
// at all
int atoms_b = 0;
for (int i : refinable)
atoms_b += !ctx.atoms[i]->is_hydrogen();
const bool u_tried = result.n_work > U_MIN_REFLECTIONS_PER_ATOM * atoms_b;
const bool u_tried = result.n_work > 9 * atoms_b;
// the U weight balanced on the model with every refinable atom given a U
double u_w0 = adp;
if (u_tried) {
@@ -4430,12 +4431,13 @@ RefinementResult RefineOnce(const gemmi::Structure &placed, const std::vector<Me
logger.Info("Refinement, displacements: {}", outcomes[k].line);
result.adp_trials.push_back(t);
// the larger model where Hamilton's tests take it, the smaller where they refuse it, the free set's
// choice where they are inconclusive (or the two have as many parameters)
// choice where they are inconclusive (or the two have as many parameters) - a larger model then with
// its R-free lower, not within the tie: the burden of the evidence is on the parameters it adds
const RefinementWeightTrial &b = trial(best);
const bool larger = t.adp_parameters > b.adp_parameters;
const double pass = larger ? HamiltonPassFraction(t, b, result.n_work)
: HamiltonPassFraction(b, t, result.n_work);
bool takes = displaces(t, b);
bool takes = displaces(t, b) && (!larger || t.r_free < b.r_free);
if (t.adp_parameters != b.adp_parameters && (pass > HAMILTON_LARGER || pass < HAMILTON_SMALLER))
takes = t.within_bounds && (!b.within_bounds || (pass > HAMILTON_LARGER) == larger);
logger.Info("Refinement, displacements: {} against {}: the larger passes {:.0f}% of Hamilton's tests{}",