A restraint dictionary carried in the binary, so refinement reads nothing from disk and needs no CLIBD_MON: the 20 amino acids and MSE, the DNA/RNA nucleotides, ATP/ADP/AMP/GTP/GDP/GMP, DMSO, PEG fragments (PEG, PGE, PG4, 1PE), GOL, EDO, SO4, PO4, ACT, MPD, water and common ions - copied verbatim from the CCP4 Monomer Library (LGPL-3.0) - plus links_and_mods.cif cut down to the links and modifications those compounds can take (peptide, cis-peptide, proline, N-methyl, disulfide, nucleic-acid backbone, termini, metal-Cys/His) and ener_lib.cif cut to its atom-type table. monomers/update_monomers.py holds the compound list and regenerates the subset; CMake embeds every .cif of the directory as string pieces under MSVC's literal limit; EmbeddedMonomerLibrary() parses them from memory into a gemmi::MonLib once per process. About 0.7 MB of text in the binary. gemmi v0.7.5's monlib.cpp, topo.cpp and riding_h.cpp vendored verbatim (prepare_topology). Licence text in licenses/, rows and a note in THIRD_PARTY_NOTICES.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015CeEGgpKdfkCTJb3YNMJcu (cherry picked from commit 38034718052c4a300691393b5b817f476c83dfc2)
26 lines
950 B
C++
26 lines
950 B
C++
// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#pragma once
|
|
|
|
#include <cstddef>
|
|
#include <string>
|
|
|
|
#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, their links and
|
|
// modifications, a few common 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();
|
|
|
|
// 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;
|
|
};
|