v1.0.0-rc.179 (#90)
Build Packages / Create release (push) Successful in 8s
Build Packages / build:portable:macos-arm64:nocuda (push) Successful in 5m11s
Build Packages / build:rugnux:linux-aarch64:cuda (push) Successful in 10m32s
Build Packages / build:portable:linux-x86_64:nocuda (push) Successful in 18m26s
Build Packages / build:portable:linux-x86_64:cuda (push) Successful in 22m11s
Build Packages / build:jfjoch:ubuntu2204:nocuda (push) Successful in 23m32s
Build Packages / build:portable:windows-x86_64:nocuda (push) Successful in 25m36s
Build Packages / build:jfjoch:rocky8:nocuda (push) Successful in 27m28s
Build Packages / HDF5 consumer tests (DIALS, XDS) (push) Successful in 28m10s
Build Packages / build:jfjoch:rocky9:nocuda (push) Successful in 28m10s
Build Packages / build:portable:windows-x86_64:cuda (push) Successful in 29m24s
Build Packages / build:jfjoch:ubuntu2404:nocuda (push) Successful in 21m45s
Build Packages / Generate python client (push) Successful in 31s
Build Packages / Build documentation (push) Successful in 1m21s
Build Packages / build:jfjoch:rocky8:cuda-sls9 (push) Successful in 24m2s
Build Packages / build:jfjoch:rocky9:cuda-sls9 (push) Successful in 29m25s
Build Packages / build:jfjoch:rocky8:cuda (push) Successful in 30m27s
Build Packages / build:jfjoch:ubuntu2204:cuda (push) Successful in 27m12s
Build Packages / build:jfjoch:ubuntu2404:cuda (push) Successful in 32m20s
Build Packages / build:jfjoch:rocky9:cuda (push) Successful in 33m36s
Build Packages / Unit tests (push) Successful in 2h7m18s
Build Packages / Validation Battery (push) Successful in 33m19s

* Rugnux: Stills processing needs only the unit cell and space group beyond what the file records - detector distance, beam centre, tilt, panel placement, saturation level, gain and polarisation plane are found from the images - and is up to twice as fast.
* Rugnux: Stills can be indexed without a GPU, with a CPU implementation of the fast-feedback indexer (macOS, computers without a GPU).
* Rugnux: Rotation and stills data are integrated in the detector's own units with one gain model, improving data from CCD detectors.
* Web frontend: The Rugnux live page shows the placed model with its electron density and anomalous difference map in a Mol* viewer.

Reviewed-on: #90
Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>
This commit was merged in pull request #90.
This commit is contained in:
leonarski_f authored and leonarski_f committed 2026-10-24 14:52:29 +02:00
1 parent afbe844b20
commit b00c668e3a
394 files changed
+57778 -2178

No files matched your search

+37 -17
View File
@@ -5,6 +5,7 @@
#include <algorithm>
#include <fstream>
#include <sstream>
#include <gemmi/to_mmcif.hpp> // make_mmcif_document
#include <gemmi/to_cif.hpp> // write_cif_to_stream
@@ -27,20 +28,10 @@ bool coordinates_obey(const gemmi::SpaceGroup &coordinates_group, const gemmi::S
label_ops.begin(), label_ops.end());
}
} // namespace
void WritePlacedModel(const gemmi::Structure &placed,
const UnitCell &cell,
const gemmi::SpaceGroup &space_group,
const std::string &output_prefix,
Logger &logger) {
const std::string cif_path = output_prefix + "_model.cif";
// PDB as well as mmCIF, because the fragment-screening tools this file exists for take a PDB:
// PanDDA's per-dataset input is <name>.pdb beside <name>.mtz, and dimple produces the same pair.
// Same coordinates, same frame, both formats - a PDB cannot hold every cell, so it is written
// when it can be and skipped, with a line saying so, when it cannot.
const std::string pdb_path = output_prefix + "_model.pdb";
// `placed` in `cell`, labelled with `space_group` wherever its coordinates obey it (see WritePlacedModel).
// takes_model_group: the model's own group was kept instead.
gemmi::Structure LabelledModel(const gemmi::Structure &placed, const UnitCell &cell,
const gemmi::SpaceGroup &space_group, bool &takes_model_group) {
gemmi::Structure st = placed;
// The cell is the data's, taken from the same value the reflection files are written from: the
// coordinates were re-fractionalized into it and genuinely sit there.
@@ -55,11 +46,30 @@ void WritePlacedModel(const gemmi::Structure &placed,
// structure it refines is not the model, and it says so nowhere. A pair whose two files disagree
// is worth a warning; a coordinate file that is quietly wrong on its own is not worth writing.
const gemmi::SpaceGroup *model_group = st.find_spacegroup();
const bool takes_model_group = model_group != nullptr && !coordinates_obey(*model_group, space_group);
const gemmi::SpaceGroup &label = takes_model_group ? *model_group : space_group;
takes_model_group = model_group != nullptr && !coordinates_obey(*model_group, space_group);
st.cell = cell;
st.spacegroup_hm = label.xhm();
st.spacegroup_hm = (takes_model_group ? *model_group : space_group).xhm();
st.setup_cell_images();
return st;
}
} // namespace
void WritePlacedModel(const gemmi::Structure &placed,
const UnitCell &cell,
const gemmi::SpaceGroup &space_group,
const std::string &output_prefix,
Logger &logger) {
const std::string cif_path = output_prefix + "_model.cif";
// PDB as well as mmCIF, because the fragment-screening tools this file exists for take a PDB:
// PanDDA's per-dataset input is <name>.pdb beside <name>.mtz, and dimple produces the same pair.
// Same coordinates, same frame, both formats - a PDB cannot hold every cell, so it is written
// when it can be and skipped, with a line saying so, when it cannot.
const std::string pdb_path = output_prefix + "_model.pdb";
bool takes_model_group = false;
gemmi::Structure st = LabelledModel(placed, cell, space_group, takes_model_group);
const gemmi::SpaceGroup &label = takes_model_group ? *st.find_spacegroup() : space_group;
// Fills in entity types and label_asym_id for a model read from a PDB, which carries neither.
// Both are no-ops where the input already had them, i.e. for an mmCIF input.
// setup_entities and make_mmcif_document can both throw, and this runs BEFORE the reflection files
@@ -100,3 +110,13 @@ void WritePlacedModel(const gemmi::Structure &placed,
label.short_name(), space_group.short_name(), space_group.short_name());
}
}
std::string PlacedModelMmcif(const gemmi::Structure &placed, const UnitCell &cell,
const gemmi::SpaceGroup &space_group) {
bool takes_model_group = false;
gemmi::Structure st = LabelledModel(placed, cell, space_group, takes_model_group);
gemmi::setup_entities(st);
std::ostringstream os;
gemmi::cif::write_cif_to_stream(os, gemmi::make_mmcif_document(st));
return os.str();
}