diff --git a/image_analysis/structure_refinement/Refinement.cpp b/image_analysis/structure_refinement/Refinement.cpp index 7e8c81502..9db12da54 100644 --- a/image_analysis/structure_refinement/Refinement.cpp +++ b/image_analysis/structure_refinement/Refinement.cpp @@ -2563,7 +2563,8 @@ RefinementResult RefineOnce(const gemmi::Structure &placed, const std::vector(std::chrono::steady_clock::now() - start).count(); + return result; + } finish(); logger.Info("Refinement: done in {:.1f} s, {} target evaluations{}", result.seconds, ctx.evaluations, @@ -3350,12 +3357,14 @@ RefinementResult RefineRounds(const gemmi::Structure &placed, const std::vector< null_first, held); RefinementSettings again = settings; again.solvent = false; + again.placement = false; // the chains and the B per residue were placed by the first round for (int round = 2; round <= REFINEMENT_ROUNDS; round++) { if (!result.ok || !result.restrained || result.as_given || result.cancelled || settings.score_only || result.model == nullptr) break; logger.Info("Refinement, round {}: from the model the round before ended with (R-free {:.4f})", round, result.r_free); + again.keep_below = result.r_free - R_FREE_TIE; RefinementResult next = RefineOnce(*result.model, merged, cell, sg, wavelength_A, logger, again, twin_laws, null_first); if (!next.ok || !next.restrained || next.as_given || !(next.r_free < result.r_free - R_FREE_TIE)) { diff --git a/image_analysis/structure_refinement/Refinement.h b/image_analysis/structure_refinement/Refinement.h index c10e6dd84..c5b46c787 100644 --- a/image_analysis/structure_refinement/Refinement.h +++ b/image_analysis/structure_refinement/Refinement.h @@ -84,6 +84,10 @@ struct RefinementSettings { // statistic - false where the model has most likely been refined against the free reflections too (a deposited // model of this crystal scored on a free set drawn here). bool as_given_competes = true; + // For a further round of the refinement (RefineRounds): the placement stage skipped, and the maps, the twin null + // and the blobs made only where R-free ends below keep_below - the round is not kept otherwise. + bool placement = true; + double keep_below = INFINITY; bool gpu = true; size_t nthreads = 1; size_t gpu_resident_bytes = 0; // held on the card by what runs beside