Repository navigation
slicer: keep Segments and PASEF MS/MS frames consistent with the slice (#101) - #103
Merged
pgarrett-scripps merged 6 commits intoNov 27, 2026
Merged
Conversation
tacular-omics#101) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014d8j19vQx1tPzM6NkYxknS
tacular-omics#101) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014d8j19vQx1tPzM6NkYxknS
tacular-omics#101) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014d8j19vQx1tPzM6NkYxknS
tacular-omics#101) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014d8j19vQx1tPzM6NkYxknS
tacular-omics#101) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014d8j19vQx1tPzM6NkYxknS
tacular-omics#101) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014d8j19vQx1tPzM6NkYxknS
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Collaborator
|
Thanks @ritanjay. I sliced the DDA fixture at 21..40, 1..20, 700..710 and 23..23 on main and on this branch. On the branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
slice_d_foldernow keepsSegmentsand the PASEF MS/MS frames in step with the frames it keeps. Fixes #101.Segments.FirstFrameandLastFrameare clipped to the kept frames, and segments outside them are deleted.PasefFrameMsMsInforows.TdfpyErrorand removes the partial destination.Why
Slicing frames 21..40 of
tests/data/example_dda.dused to leave two problems:Segmentsstill said(1, 1, 710, 0).PasefFrameMsMsInforows. Their precursors had been removed because the parent MS1 frame was outside the slice, so the DDA reader could no longer reach those frames.With this change, the same slice keeps frames 29..40,
Segmentsis(1, 29, 40, 0), no MS/MS frame is orphaned, andDDAopens it.How it was tested
just checkpasses locally:RUN_SLOW=1: 889 passed, also with--resolution lowest-direct;src/stashed, 5 tests intests/test_slicer.pyfail.slice_d_folderdocstring (including Raises), and the table and a new paragraph indocs/utilities.md, withllms-full.txtregenerated.CHANGELOG.mdhas an entry under## [Unreleased].New tests:
test_slice_not_starting_at_frame_1_keeps_tables_in_step(DDA 21..40) checksSegments, that every kept MS/MS frame keeps its rows, that no precursor has a missing parent, and thatmerged_peaksis unchanged for precursors whose windows all lie in the slice.test_slice_whose_frames_are_all_orphaned_msms_raises_and_cleans_up(21..28).test_slice_clips_segments, run on:[(1, 101, 200, 0)];[(1, 200, 254, 1), (2, 255, 300, 1)].Notes for the maintainer
Precursors.Parentpointing at a frame that is not in the slice.DDAreads the parent frame's retention time and mobility calibration, so it cannot open that. The frames are logged at INFO level when dropped. The docs suggest starting the range at an MS1 frame to keep them.test_slice_middle_rangenow expects the frames that can still be read in 100..110, computed from the source by_source_frames_kept, instead of all of 100..110.test_slice_null_tims_id_removes_partial_destslices 1..2 instead of 4..5 for its "range that still works". Frames 2..5 there are MS/MS frames of precursors from frame 1, so 4..5 now leaves nothing and raises.🤖 Generated with Claude Code
https://claude.ai/code/session_014d8j19vQx1tPzM6NkYxknS