Skip to content

0.5.0: port to timsrust 0.6.6 via a 0.4.2-compatible adapter - #10

Merged
pgarrett-scripps merged 9 commits into
mainfrom
try/deps-upgrade
Sep 25, 2026
Merged

pgarrett-scripps merged 9 commits into
mainfrom
try/deps-upgrade

Conversation

@pgarrett-scripps

@pgarrett-scripps pgarrett-scripps commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Draft, targeted at 0.5.0 (not 0.4.x). Opened for CI.

Replaces timsrust 0.4.2 with timsrust-tdf 0.6.6 behind a local adapter (src/tsr.rs) that keeps 0.4.2's converters and frame shapes, so the rest of the crate is unchanged. rusqlite 0.32 -> 0.35 (forced by timsrust's pin).

Checked locally:

  • cargo test --workspace: all pass (136 tests, 2 ignored).
  • Dry run matches v0.4.0 exactly: DDA 111,722,871 points kept, DIA 755,841,088.

Not yet done: full-denoise byte comparison against v0.4.0 (steps in PORT_NOTES.md). Expect analysis.tdf to differ only in the SQLite version stamp (bytes 97-100).

Cost: dependency count roughly doubles (CLI 170 -> 318 crates) from timsrust's required cloud I/O stack; options in PORT_NOTES.md.

🤖 Generated with Claude Code

pgarrett-scripps and others added 3 commits September 23, 2026 20:47
Depend on timsrust-tdf 0.6.6 (TDF reader only) and rusqlite 0.35. New
src/tsr.rs keeps 0.4.2's positional frame order, fractional Tof2Mz and
Scan2Im converters, and GlobalMetadata parsing; call sites, examples and
tests switch to crate::tsr. tests/targeted.rs casts unsigned SQL params.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@pgarrett-scripps pgarrett-scripps changed the title Port to timsrust 0.6.6 via a 0.4.2-compatible adapter 0.5.0: port to timsrust 0.6.6 via a 0.4.2-compatible adapter Sep 24, 2026
pgarrett-scripps and others added 6 commits September 24, 2026 17:49
…property tests

PolygonGate::build with im_pad > 0 sampled only the scan-lines at y0 - im_pad,
y0 and y0 + im_pad, so a spike or sharp vertex lying between those lines was
dropped from the padded gate. It now takes the exact m/z projection of the
polygon over the whole band [y0 - im_pad, y0 + im_pad] (slabs between vertex
and edge-crossing levels; span ends are linear inside a slab), i.e. the
Minkowski sum with the pad rectangle at each scan. im_pad = 0 keeps the single
scan-line path unchanged (byte-identical output with the paper config).

writer: after building, check every scan's unpadded polygon interval lies in
the padded gate (check_contains_unpadded) and fail with a clear message if not.

tests/polygon_props.rs: containment, full padding (within one scan / TOF
index), over-inclusion and pad-0 equality on a dense grid for convex, concave,
thin-spike, notch, staircase, triangle, charge-band and two-ring shapes at six
pads. Full padding failed on the old 3-line sampling (thin spike, triangle and
hexagon vertices). examples/polygon_check.rs runs the same checks on real runs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…property tests

examples/polygon_check.rs: timsrust imports switched to dnoise::tsr for the
0.6.6 port.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Feature-level gating (on by default) now keeps a feature that touches the
polygon or a DIA MS1 window over its whole extent. overlap_reach is removed
from Ms1PolygonParams and DiaMs1WindowParams, from overlap::extend_to_features
and from the gates (overlap is now a bool). The 0.4.0 config keys
ms1_polygon_overlap_reach / dia_ms1_overlap_reach and the matching CLI flags
are still accepted (flags hidden) but ignored with a deprecation warning, so
0.4.0 configs still load; they are never written into the recipe.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Ms1PolygonParams and DiaMs1WindowParams default to mz_pad = 3.0 Th and
im_pad = 0.015 1/K0 (were 0). MS1 gates only; the MS/MS isolation gates are
unchanged. Pad docs now say Th (m/z units), not Da.

The DIA MS1 window is a rectangle in (m/z, scan), so its padded box already
covers every scan within +-im_pad with the full padded m/z band; the box
construction moves into dia_ms1_box and a new test checks, over several
windows and pads, that every window point and every point within the pads is
kept and that over-inclusion stays within one scan / one TOF index.

Warn when analysis.tdf has more than one GroupProperties row for the
selection polygon (the gate uses the first).

ALGORITHM.md's gate paragraph (which still said 5 Da / 0.05 1/K0), dnoise.toml,
docs/reference.md and the defaults test are updated; CHANGELOG gains a 0.5.0
(unreleased) section.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
At the start of each (non crop-only) run, log one info line per active
raw-unit parameter with its physical equivalent for the run's calibration:
TOF half-widths in ppm at m/z 400, 800 and 1200, scan counts in 1/K0 at the
mid scan (configured mobility scale, linear fallback). The same values are
recorded in dnoise.provenance.json as unit_equivalents (null when the
calibration cannot be read). The parameters stay in raw units. New module
dnoise::units with tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Box sweep on the JASMS revision data: at matched removal the box is within
about 1k ID points of a trained kernel; 0.10 removes less of the isotope
envelope. User decision 2026-09-24.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@pgarrett-scripps pgarrett-scripps mentioned this pull request Sep 25, 2026
@pgarrett-scripps
pgarrett-scripps merged commit b0ca43c into main Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant