From eae7ea90dcc80178d4193fe0924ccf2b03571dca Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Thu, 16 Jul 2026 10:45:08 +0200 Subject: [PATCH] rugnux: always write both MTZ and CIF; drop --scaling-output The merged reflections were written in one of mtz/cif/txt selected by --scaling-output. Write both an MTZ and an mmCIF unconditionally instead - each has its uses downstream (MTZ for the CCP4/phenix tools, mmCIF for deposition) - and remove the format selector, the plain-text .hkl writer, and the now-unused IntensityFormat enum / ScalingSettings::FileFormat plumbing. Co-Authored-By: Claude Opus 4.8 (1M context) --- common/ScalingSettings.cpp | 9 --------- common/ScalingSettings.h | 5 ----- docs/CHANGELOG.md | 1 + docs/RUGNUX.md | 5 ++--- image_analysis/WriteReflections.cpp | 30 ++++------------------------- image_analysis/WriteReflections.h | 3 --- rugnux/rugnux_cli.cpp | 21 -------------------- 7 files changed, 7 insertions(+), 67 deletions(-) diff --git a/common/ScalingSettings.cpp b/common/ScalingSettings.cpp index c57ff626..52ca4d79 100644 --- a/common/ScalingSettings.cpp +++ b/common/ScalingSettings.cpp @@ -212,15 +212,6 @@ double ScalingSettings::GetMinCapturedFraction() const { return min_captured_fraction; } -ScalingSettings &ScalingSettings::FileFormat(IntensityFormat input) { - intensity_format = input; - return *this; -} - -IntensityFormat ScalingSettings::GetFileFormat() const { - return intensity_format; -} - ScalingSettings &ScalingSettings::RfreeFraction(double input) { if (input < 0.0 || input > 1.0) throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "R-free fraction must be between 0 and 1"); diff --git a/common/ScalingSettings.h b/common/ScalingSettings.h index 9995ecf2..958f6e31 100644 --- a/common/ScalingSettings.h +++ b/common/ScalingSettings.h @@ -6,8 +6,6 @@ #include #include "JFJochException.h" -enum class IntensityFormat { Text, mmCIF, MTZ}; - // How the high-resolution cutoff for the written reflections and the reported shell table is chosen // when no explicit --scaling-high-resolution is given. Off = keep the full (detector-edge) range; // CCHalfLogistic = fit the CC1/2 fall-off and cut one shell past cc_target (DIALS-style, generous). @@ -56,7 +54,6 @@ class ScalingSettings { double smooth_g_deg = 0.0; double rfree_fraction = 0.05; - IntensityFormat intensity_format = IntensityFormat::mmCIF; // Automatic high-resolution cutoff for the written reflections + reported shells (not the scaling // or the error model, and not the per-image _process.h5). Applied only when no explicit @@ -86,7 +83,6 @@ public: ScalingSettings& SmoothGDegrees(double input); ScalingSettings& RfreeFraction(double input); - ScalingSettings& FileFormat(IntensityFormat input); ScalingSettings& ScalingRegularize(bool input); ScalingSettings& ResolutionCutoff(ResolutionCutoffMethod input); @@ -124,7 +120,6 @@ public: [[nodiscard]] double GetSmoothGDegrees() const; [[nodiscard]] double GetRfreeFraction() const; - [[nodiscard]] IntensityFormat GetFileFormat() const; [[nodiscard]] bool GetScalingRegularize() const; [[nodiscard]] ResolutionCutoffMethod GetResolutionCutoff() const; diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 1f71828d..10b0d0a9 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -21,6 +21,7 @@ This is an UNSTABLE release. It includes many experimental features, as well as * Reader: Treat a negative `total_flux` in a stored dataset as unknown/absent rather than a real (invalid) flux. * Packaging: Build the self-contained Linux viewer against a static libdbus with glib disabled, so the `.tgz` no longer drags a tail of system `.so` dependencies; add parallel image-build and in-container viewer-verification scripts. * rugnux: Write anomalous data as a standard CCP4 anomalous MTZ - one row per reflection with `IMEAN`, `I(+)`/`I(-)` (and the matching `F`/`F(+)`/`F(-)` amplitudes) - instead of two `IMEAN` rows per Bijvoet pair, so `aimless`/`mtz2sca`/ANODE read it directly. The non-anomalous MTZ output is unchanged. +* rugnux: Always write the merged reflections as both `.mtz` and `.cif` (each has its uses downstream - MTZ for the CCP4/phenix tools, mmCIF for deposition). The `--scaling-output` format selector and the plain-text `.hkl` output are removed. ### 1.0.0-rc.159 This is an UNSTABLE release. It includes many experimental features, as well as many AI generated fixes. We recommend using rc.152 for production use. diff --git a/docs/RUGNUX.md b/docs/RUGNUX.md index 0fc635f0..cd2e0ac7 100644 --- a/docs/RUGNUX.md +++ b/docs/RUGNUX.md @@ -45,8 +45,8 @@ the first pass. [HDF5 / NeXus data format](HDF5.md) for the layout. Written by default only when **not** merging (i.e. under `--no-merge`); add `--write-process-h5` to also write it when merging. - Merging is **on by default** (`--no-merge` disables it). The merged reflections are written as - `.cif` (mmCIF — the default), or `.mtz` / `.hkl` depending on - `--scaling-output`. Both the mmCIF and the MTZ carry the **refined unit cell** (from rotation + **both** `.mtz` and `.cif` (mmCIF) — each has its uses downstream (MTZ for the + CCP4 / phenix tools, mmCIF for deposition). Both carry the **refined unit cell** (from rotation indexing) and the **space group determined from systematic absences** (constrained to the indexed lattice symmetry). No-reference scaling additionally emits per-iteration `_iterN_scale.dat`. @@ -212,7 +212,6 @@ Scaling and merging: | `--min-image-cc ` | Per-image CC limit, percent (default: no limit) | | `--mosaicity ` | Diagnostic: fix the scaling mosaicity (°) instead of using the per-image seed | | `--scaling-iterations ` | Scaling iterations with no reference data (default: 3) | -| `--scaling-output ` | Reflection output format: `cif` (mmCIF, default) \| `mtz` \| `txt` | | `-z, --reference-mtz ` | Reference MTZ (enables reference-driven scaling) | | `--reference-column