Files
leonarski_f 63f5f96132
Build Packages / Create release (push) Successful in 9s
Build Packages / build:portable:macos-arm64:nocuda (push) Successful in 5m19s
Build Packages / build:rugnux:linux-aarch64:cuda (push) Successful in 10m26s
Build Packages / build:portable:linux-x86_64:nocuda (push) Successful in 19m33s
Build Packages / build:portable:windows-x86_64:nocuda (push) Successful in 23m17s
Build Packages / build:portable:linux-x86_64:cuda (push) Successful in 23m28s
Build Packages / build:jfjoch:ubuntu2204:nocuda (push) Successful in 24m38s
Build Packages / build:portable:windows-x86_64:cuda (push) Successful in 27m30s
Build Packages / HDF5 consumer tests (DIALS, XDS) (push) Successful in 29m4s
Build Packages / build:jfjoch:rocky8:nocuda (push) Successful in 29m19s
Build Packages / build:jfjoch:rocky9:nocuda (push) Successful in 29m31s
Build Packages / build:jfjoch:ubuntu2404:nocuda (push) Successful in 23m19s
Build Packages / Generate python client (push) Successful in 28s
Build Packages / Build documentation (push) Successful in 1m22s
Build Packages / build:jfjoch:rocky8:cuda-sls9 (push) Successful in 24m39s
Build Packages / build:jfjoch:rocky9:cuda-sls9 (push) Successful in 29m40s
Build Packages / build:jfjoch:rocky8:cuda (push) Successful in 28m31s
Build Packages / build:jfjoch:ubuntu2204:cuda (push) Successful in 24m33s
Build Packages / build:jfjoch:ubuntu2404:cuda (push) Successful in 27m45s
Build Packages / build:jfjoch:rocky9:cuda (push) Successful in 29m25s
Build Packages / Unit tests (push) Successful in 1h35m24s
Build Packages / Validation Battery (push) Successful in 35m45s
v1.0.0-rc.180 (#91)
* Rugnux: A placed model is refined by default - restrained maximum-likelihood refinement on the GPU (CPU without one), writing `<prefix>_refined_model.cif`, `<prefix>_refined_maps.mtz` and the difference-map blobs in `<prefix>_blobs.json`; `--no-refine` skips it.
* Rugnux: `--mode refine` refines a model against merged structure factors from an MTZ or mmCIF file.
* Rugnux: The embedded restraint dictionary covers amino acids, nucleotides including common modified RNA nucleotides, common cofactors, crystallisation additives, waters and ions, with metal sites restrained from the model's LINK records.
* Rugnux: A model or reference file can be given among the inputs in any order, recognised by its contents.
* Rugnux: The geometry refinement algorithm option is now `-r, --geom-refine` (was `--refine`).
* Rugnux: Serial stills resolve the indexing ambiguity from the data when no model or reference is given, reject merge outliers by default, follow the run's measured rocking curve in prediction and partiality (also in `--mode scale`), and index reproducibly on the GPU.
* Rugnux: Reflections touching the beam-stop shadow are not integrated, reflections coarser than the low-resolution limit are merged and written (but kept out of the scale fit), and the polarisation plane is measured more reliably.
* Rugnux: Small-molecule runs report unit-cell e.s.d.s, in a SHELX `.ins` beside the `.hkl` and in the mmCIF.
* jfjoch_broker: Live Rugnux refines the uploaded model after placement; the web frontend's Rugnux live page has a hero panel with resolution, ISa, space group, placement and refined R-work/R-free, and its Mol* viewer shows the refined model and maps.
* Documentation: A new front page with download pages for Rugnux and the viewer, and the technical reference reorganised below it.
* Build: The fast-feedback indexer is part of the source tree instead of being downloaded at build time.

Reviewed-on: #91
Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>
2026-10-27 13:18:42 +01:00

47 lines
2.5 KiB
C++

// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include <string>
#include <vector>
#include "gemmi/grid.hpp"
#include "gemmi/model.hpp"
#include "../../common/JFJochMessages.h"
// What a model leaves unexplained: the connected regions of positive mFo-DFc density above a cutoff ("blobs"),
// each placed beside the model, measured and given a likely reading - a water, an ion, something ligand-sized,
// or an error of the model itself (a misplaced or missing atom, an alternative conformation).
//
// The readings are rules on what is measured, meant to point a person at the density, not to identify a
// compound: a blob called LIGAND is density of ligand size and shape where the model has nothing, which a
// buffer molecule or an unmodelled side chain can be as well as the compound that was soaked.
struct DensityBlob {
enum class Kind { Water, Ion, Ligand, ModelError, Unassigned };
Kind kind = Kind::Unassigned;
gemmi::Position centroid; // the copy nearest the model
double peak_sigma = 0; // the highest point, in the map's rms
double volume = 0; // A^3 above the cutoff
double score = 0; // the density above the cutoff integrated, sigma A^3
double nearest_atom_distance = 0;
std::string nearest_atom; // e.g. "OG1 THR A42"
int polar_contacts = 0; // N or O of the model at 2.4-3.4 A
int metal_contacts = 0; // N, O or S of the model at 1.8-2.6 A
double anomalous_sigma = 0; // the anomalous difference map at the peak, 0 where there is none
};
const char *DensityBlobKindName(DensityBlob::Kind kind);
// The blobs as the end message carries them to the writer, for <prefix>_blobs.json.
DensityBlobsMessage DensityBlobsToMessage(const std::vector<DensityBlob> &blobs);
// The blobs of `difference` (an mFo-DFc map of the whole cell, rms `rms`) above 3 sigma that peak above 4 sigma,
// strongest (by score) first. `model`: what the map was made from, in the map's cell. `anomalous`: the anomalous
// difference map on any grid of the same cell, or null. Following the flood fill of Coot's unmodelled blobs as
// gemmi implements it (find_blobs_by_flood_fill).
std::vector<DensityBlob> FindDensityBlobs(const gemmi::Grid<float> &difference, double rms, const gemmi::Structure &model,
double d_min, const gemmi::Grid<float> *anomalous = nullptr,
double anomalous_rms = 0);