// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute // SPDX-License-Identifier: GPL-3.0-only #pragma once #include #include #include "gemmi/monlib.hpp" // The restraint dictionary refinement uses: the subset of the CCP4 Monomer Library (Vagin et al. 2004, // LGPL-3.0) carried in the binary - the standard amino acids and nucleotides, the common modified RNA nucleotides, // their links and modifications, the common cofactors (NAD(P)(H), FAD, FMN, hemes, SAM/SAH), a few other ligands // and additives, water and ions; monomers/update_monomers.py holds the list. Parsed from memory once per process; // no file is read. const gemmi::MonLib &EmbeddedMonomerLibrary(); // The ideal distance and its sigma of a bond from a metal ion to a donor atom (O, N, S) at a site of `coordination` // donors, from the library's statistics of metal sites (metals.json, embedded as monomers/metals.cif). Only rows // resting on at least METAL_MIN_SITES sites count: the row of that coordination number, else the two nearest // below and above it interpolated linearly, else the nearest one; the sigma is the row's standard deviation, at // least METAL_MIN_SIGMA. False where the pair has no such row. constexpr int METAL_MIN_SITES = 20; constexpr double METAL_MIN_SIGMA = 0.02; // A bool EmbeddedMetalDistance(gemmi::El metal, gemmi::El ligand, int coordination, double &distance, double &sigma); // Whether `code` (a residue name) has a description in it. bool InEmbeddedMonomerLibrary(const std::string &code); // One .cif of monomers/, as CMakeLists.txt embeds it: its name and its text in pieces. struct EmbeddedMonomerFile { const char *name; const char *const *pieces; size_t n_pieces; };