Skip to content

docs: starting a DDA slice on an MS1 frame does not keep its first MS/MS frames - #104

Merged
pgarrett-scripps merged 1 commit into
mainfrom
docs/slice-ms1-start-claim
Nov 27, 2026
Merged

pgarrett-scripps merged 1 commit into
mainfrom
docs/slice-ms1-start-claim

Conversation

@pgarrett-scripps

Copy link
Copy Markdown
Collaborator

The false sentence

docs/utilities.md ended its DDA-slice paragraph with "Start the range at an MS1 frame to
keep them."
It is false, and not just in edge cases — it is false for every range I measured
except the one that starts at frame 1.

Range Starts on an MS1 frame MS/MS frames in range Dropped
18..40 yes 20 5 — 19-23, whose precursors' parent is MS1 frame 7
29..62 yes 30 5 — 30-34, parent MS1 frame 18
7..40 yes 30 5 — 8-12, parent MS1 frame 1
1..40 yes 35 0
19..40 no 20 15

Measured on tests/data/example_dda.d by slicing into a temporary directory and reading the
output's Frames table, with the dropped set cross-checked against an independent prediction
from PasefFrameMsMsInfo joined to Precursors.Parent — the two agreed on all five ranges.

Why

The MS/MS frames that follow an MS1 frame are not all its own. Across the whole fixture, 64 of
the 65 MS1 frames are followed by ten PASEF MS/MS frames, and the first five of those ten carry
precursors detected in the previous MS1 frame.
Frame 1 is the only exception: five MS/MS
frames, all its own. So a range starting at MS1 frame m always loses the five belonging to the
MS1 frame before m, and starting on an MS1 frame is simply not the lever the sentence claimed.

MS1   1: block 2..6   (5)  | previous-MS1 frames []              | own [2, 3, 4, 5, 6]
MS1   7: block 8..17  (10) | previous-MS1 frames [8..12]         | own [13..17]
MS1  18: block 19..28 (10) | previous-MS1 frames [19..23]        | own [24..28]
MS1  29: block 30..39 (10) | previous-MS1 frames [30..34]        | own [35..39]
MS1 700: block 701..710(10)| previous-MS1 frames [701..705]      | own [706..710]
lead-in length across all 65 blocks: 5 for 64 of them, 0 for the first

What it says now

The actual rule first — a PASEF MS/MS frame is dropped whenever every one of its precursors
was detected in an MS1 frame outside the range — then that starting on an MS1 frame does not
avoid it, with the three ranges above as evidence, then what does work: include the frame's
precursors' parent MS1 frame.

Everywhere else the claim could have been

Place State Action
docs/utilities.md:36 the false sentence replaced
llms-full.txt, docs/llms-full.txt carried it, being generated from the docs regenerated, --check passes
src/tdfpy/slicer.py:48-53 (docstring) already true: a frame whose precursors were all detected in an earlier MS1 frame "would be left without PasefFrameMsMsInfo rows; such frames are dropped" — no claim about where to start left alone
src/tdfpy/slicer.py:160-161 (the TdfpyError message) already true: "Widen the range to include those MS1 frames" left alone
CHANGELOG entry for #101 already true, same wording as the docstring left alone

grep for the sentence across docs/, src/, llms-full.txt and CHANGELOG.md now returns
nothing.

Two corrections I made to my own first draft

Both caught by re-reading the code and the measurement rather than the draft:

  1. I wrote that "each of the 65 MS1 frames is followed by ten PASEF MS/MS frames". Frame 1 is
    followed by five. Now stated as 64 of 65, with frame 1 named as the exception.
  2. I wrote that the slicer "logs how many frames this removed, and which". It logs the count and
    orphaned[:10] (slicer.py:297-302), so the text now says it lists up to the first ten.

Gate

just check tdfpy from the workspace root through ajs, job 3502, exit 0:
ruff=ok format=ok ty=ok pytest=ok [878 passed, 11 skipped, 7 subtests passed].

Docs and docstrings only — no behaviour change, no test change, no version, heading, tag or
publish, and no other package touched.

🤖 Generated with Claude Code

…/MS frames

`docs/utilities.md` said "Start the range at an MS1 frame to keep them." That is
false, and measured on `tests/data/example_dda.d` it is false for every range:

    range     starts on MS1   MS/MS in range   dropped
    18..40    yes             20               5  (19-23, parent MS1 7)
    29..62    yes             30               5  (30-34, parent MS1 18)
    7..40     yes             30               5  (8-12,  parent MS1 1)
    1..40     yes             35               0
    19..40    no              20               15

The cause: the MS/MS frames after an MS1 frame are not all its own. 64 of the
65 MS1 frames are followed by ten PASEF MS/MS frames, and the first five of
those ten carry precursors detected in the *previous* MS1 frame; only frame 1
is different, with five MS/MS frames and all of them its own. So a range
starting at MS1 frame m always loses the five that belong to the MS1 frame
before m, m = 1 excepted.

The replacement states the actual rule - a PASEF MS/MS frame is dropped when
every one of its precursors was detected in an MS1 frame outside the range -
then that starting on an MS1 frame does not avoid it, with the three ranges
above, and that keeping a given MS/MS frame means including its precursors'
parent MS1 frame.

Checked and left alone: `slicer.py`'s docstring (:48-53) and warning (:160-161)
and the #101 CHANGELOG entry already say only the true thing, that a frame whose
precursors' MS1 frames are outside the slice is dropped and the range must be
widened to include them. Nothing else in the repo carried the false sentence.

Docs only, no behaviour change; both `llms-full.txt` copies regenerated.
ajs 3502 just check tdfpy: ruff=ok format=ok ty=ok pytest=ok, 878 passed, 11 skipped.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@pgarrett-scripps
pgarrett-scripps merged commit 57974e7 into main Nov 27, 2026
18 checks passed
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