// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute // SPDX-License-Identifier: GPL-3.0-only #pragma once #include #include #include // A side chain placed through another residue - a copy's or a symmetry mate's - as a predicted model's // rotamer lands when molecular replacement packs the copies: two atoms within an angstrom or so of each other. // The refinement's repulsion only pushes the atoms apart along the line that joins them, so such a side chain // leaves the clash in whatever direction that line points and settles in a rotamer the density does not hold. // Before the refinement, each such side chain is turned about its chi angles to the staggered rotamer (the // terminal planar group in steps of 30 degrees) with the least overlap against the rest of the model; the // main chain, the beta carbon and the B factors stay as given. constexpr double CLASH_RELIEF_OVERLAP = 2.0; // A: a pair of heavy atoms this far inside their contact distance (within ~1.3 A of each other) struct SideChainTurn { std::string name; // "GLN A17" std::vector chi_before; // degrees std::vector chi_after; double overlap_before = 0; // A: the deepest overlap of the side chain's atoms with another residue double overlap_after = 0; }; // The side chains of the first model of `st` with an overlap beyond CLASH_RELIEF_OVERLAP, turned in place to // their least-overlapping rotamer; what was turned, in model order. std::vector RelieveSideChainClashes(gemmi::Structure &st);