From 9e72b796c4325420216179ab2ab3e7d0b1a1757c Mon Sep 17 00:00:00 2001 From: theGreatHerrLebert Date: Wed, 20 May 2026 19:09:41 +0200 Subject: [PATCH] dda: drop hardcoded scan 0..1000 in extract_precursor_ms1_signals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The MS1 XIC/mobilogram filter in extract_precursor_ms1_signals hardcoded the scan range to 0..1000. The inv_mobility window (im_min/im_max) was already doing the actual mobility selection, so the scan cap only served to silently truncate signal on acquisitions that use more than 1000 scans per frame (high mobility-resolution / wide IM range methods — common in HLA immunopeptidomics). Symptom: for affected datasets, sample precursors whose target mobility maps to scan indices >= 1000 extract to all-zero MS1 (iso = [0,0,0,0,0], rt_r2 = 0, im_r2 = 0) even when the m/z calibration is correct. Confirmed on PXD026463 (10/10 precursors zero) and PXD020509 (5/10 zero, 5/10 fine) with the SDK-derived m/z fix applied — the latter's per-precursor binary on/off pattern is the giveaway. Fix: change the scan range to 0..i32::MAX. The inv_mobility filter still constrains to the requested mobility window. --- rustdf/src/data/dda.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rustdf/src/data/dda.rs b/rustdf/src/data/dda.rs index 926f41fa..73dc1adf 100644 --- a/rustdf/src/data/dda.rs +++ b/rustdf/src/data/dda.rs @@ -550,9 +550,13 @@ impl TimsDatasetDDA { let frame = &frames[idx]; // === XIC and Mobilogram: Extract from isotope range (or single m/z if no mono_mz) === + // Scan range is unbounded; the inv_mobility window (im_min/im_max) does + // the mobility selection. A hardcoded scan cap (e.g. 0..1000) silently + // drops signal on methods configured with more than that many scans + // per frame (high mobility-resolution / wide IM range acquisitions). let xic_filtered = frame.filter_ranged( xic_mz_min, xic_mz_max, - 0, 1000, + 0, i32::MAX, im_min, im_max, 0.0, 1e9, 0, i32::MAX,