v1.0.0-rc.170 (#80)
Build Packages / Create release (push) Successful in 23s
Build Packages / build:rugnux-tgz (x86_64) (push) Successful in 10m6s
Build Packages / build:rugnux:aarch64 (cross) (push) Successful in 9m6s
Build Packages / build:viewer-tgz:cpu (push) Successful in 11m15s
Build Packages / build:viewer-tgz:cuda (push) Successful in 12m21s
Build Packages / build:windows:nocuda (push) Successful in 17m9s
Build Packages / build:windows:cuda (push) Successful in 19m49s
Build Packages / HDF5 consumer tests (DIALS, XDS) (push) Successful in 25m42s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 16m0s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 14m54s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 17m7s
Build Packages / build:rugnux:windows (push) Successful in 10m47s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 17m4s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 17m8s
Build Packages / Generate python client (push) Successful in 45s
Build Packages / Build documentation (push) Successful in 1m45s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 19m23s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 19m20s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 18m43s
Build Packages / build:rpm (rocky8) (push) Successful in 19m31s
Build Packages / build:rpm (rocky9) (push) Successful in 20m16s
Build Packages / Unit tests (push) Successful in 1h41m19s
Build Packages / Create release (push) Successful in 23s
Build Packages / build:rugnux-tgz (x86_64) (push) Successful in 10m6s
Build Packages / build:rugnux:aarch64 (cross) (push) Successful in 9m6s
Build Packages / build:viewer-tgz:cpu (push) Successful in 11m15s
Build Packages / build:viewer-tgz:cuda (push) Successful in 12m21s
Build Packages / build:windows:nocuda (push) Successful in 17m9s
Build Packages / build:windows:cuda (push) Successful in 19m49s
Build Packages / HDF5 consumer tests (DIALS, XDS) (push) Successful in 25m42s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 16m0s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 14m54s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 17m7s
Build Packages / build:rugnux:windows (push) Successful in 10m47s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 17m4s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 17m8s
Build Packages / Generate python client (push) Successful in 45s
Build Packages / Build documentation (push) Successful in 1m45s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 19m23s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 19m20s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 18m43s
Build Packages / build:rpm (rocky8) (push) Successful in 19m31s
Build Packages / build:rpm (rocky9) (push) Successful in 20m16s
Build Packages / Unit tests (push) Successful in 1h41m19s
* Fixed a `jfjoch_broker` crash during indexing: sorting no longer misbehaves on non-finite values, and GPU FFT indexer kernel launches are now error-checked. * rugnux needs about a third less peak memory to scale, merge and post-refine rotation data, with identical results. * `rugnux --model`: the placed coordinate file carries the space group its own coordinates obey, and says so when that is not the group the reflection files beside it carry. * `jfjoch_viewer`: fixes in the dataset plots, inspector and layout; spot markers lose their black outline by default (a checkbox under "Image features" restores it) and the highest-pixel markers are white boxes around the pixel. Reviewed-on: #80 Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>
This commit was merged in pull request #80.
This commit is contained in:
1 parent
9aae0c2ba7
commit
cb5a2f032a
185 files changed
+1151
-469
No files matched your search
+45
-9
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "WriteModel.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
|
||||
#include <gemmi/to_mmcif.hpp> // make_mmcif_document
|
||||
@@ -12,6 +13,22 @@
|
||||
|
||||
#include "../common/Logger.h"
|
||||
|
||||
namespace {
|
||||
|
||||
// Do the coordinates of a model built in `coordinates_group` obey `label` as well? They do when every
|
||||
// operation of `label` is one of theirs, i.e. when `label` is a subgroup: the file then holds more
|
||||
// than one asymmetric unit of it, which is allowed and is what a model always does in P1. They do not
|
||||
// when `label` has an operation of its own, and then the label is a lie a reader acts on - it
|
||||
// generates atoms from that operation, and the crystal it builds is not the one in the file.
|
||||
bool coordinates_obey(const gemmi::SpaceGroup &coordinates_group, const gemmi::SpaceGroup &label) {
|
||||
const std::vector<gemmi::Op> coordinate_ops = coordinates_group.operations().all_ops_sorted();
|
||||
const std::vector<gemmi::Op> label_ops = label.operations().all_ops_sorted();
|
||||
return std::includes(coordinate_ops.begin(), coordinate_ops.end(),
|
||||
label_ops.begin(), label_ops.end());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void WritePlacedModel(const gemmi::Structure &placed,
|
||||
const UnitCell &cell,
|
||||
const gemmi::SpaceGroup &space_group,
|
||||
@@ -25,13 +42,23 @@ void WritePlacedModel(const gemmi::Structure &placed,
|
||||
const std::string pdb_path = output_prefix + "_model.pdb";
|
||||
|
||||
gemmi::Structure st = placed;
|
||||
// Not the model's own cell and group but the data's, taken from the same two values the reflection
|
||||
// files are written from. The coordinates already sit in this cell; what is set here is the label
|
||||
// the file carries, which must match the .mtz beside it - the enantiomorph in particular, since
|
||||
// --model can adopt the model's and that is neither the data's original label nor, necessarily,
|
||||
// the one the input model arrived with.
|
||||
// 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.
|
||||
//
|
||||
// The group is the data's too wherever the coordinates obey it, which is the ordinary case and the
|
||||
// one that matters - the label then matches the .mtz beside it, the enantiomorph in particular,
|
||||
// since --model can adopt the model's and that is neither the data's original label nor,
|
||||
// necessarily, the one the input model arrived with. Where they do not obey it the model's own
|
||||
// group is written instead. Data merged in a supergroup of the model's - a run that over-merged
|
||||
// across a pseudo-symmetry twofold, or a hand the model's fit did not earn - would otherwise put
|
||||
// operations on the file that its contents contradict, and a refinement program expands them: the
|
||||
// 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;
|
||||
st.cell = cell;
|
||||
st.spacegroup_hm = space_group.xhm();
|
||||
st.spacegroup_hm = label.xhm();
|
||||
st.setup_cell_images();
|
||||
// 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.
|
||||
@@ -60,7 +87,16 @@ void WritePlacedModel(const gemmi::Structure &placed,
|
||||
logger.Warning("Model validation: the placed model could not also be written as PDB ({}); "
|
||||
"{} has it", e.what(), cif_path);
|
||||
}
|
||||
logger.Info("Model validation: the model as placed against these data written to {}{} "
|
||||
"(cell and space group {} as in the reflection files)",
|
||||
cif_path, pdb_written ? " and " + pdb_path : "", space_group.short_name());
|
||||
if (!takes_model_group) {
|
||||
logger.Info("Model validation: the model as placed against these data written to {}{} "
|
||||
"(cell and space group {} as in the reflection files)",
|
||||
cif_path, pdb_written ? " and " + pdb_path : "", space_group.short_name());
|
||||
} else {
|
||||
logger.Warning("Model validation: the model as placed written to {}{} in ITS OWN space group "
|
||||
"{}, not the {} the reflection files carry - its coordinates do not obey {}, so "
|
||||
"the two files describe the same crystal in different symmetry and cannot be "
|
||||
"refined against each other as they stand",
|
||||
cif_path, pdb_written ? " and " + pdb_path : "",
|
||||
label.short_name(), space_group.short_name(), space_group.short_name());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user