fix(scan-event): decode Exploris coefficients + MS2 precursor#4
Open
oskarsari wants to merge 1 commit into
Open
fix(scan-event): decode Exploris coefficients + MS2 precursor#4oskarsari wants to merge 1 commit into
oskarsari wants to merge 1 commit into
Conversation
The v66 parser read the nparam/coefficients block at a fixed body_size - 64 and the MS2 reaction record at body offset 8. Both hold for Q Exactive (body_size 144) but not Orbitrap Exploris (body_size 136), where the profile m/z came out mis-converted (no coefficients) and the precursor m/z was lost. - Coefficients: read the nparam block immediately after the located scan-window FractionCollector. For the offset-64 FC family (Q Exactive / Exploris / Astral) that is offset 80; on body_size 144 this equals the legacy body_size - 64 (no change), while Exploris (136) now finds its A/B/C. - Precursor: when an MS2+/dependent non-tribrid scan yields no reaction from the offset-8 parse, fall back to the Exploris layout where the reaction record begins at body offset 4 (precursor f64 at body[4..12]). Validated against the vendor reader: Exploris profile m/z is now correctly converted, and MS2 precursor + activation energy match exactly. Q Exactive Plus file reads are unchanged.
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.
Closes #2 .
What
Decodes two scan-event-derived values that were missing for Orbitrap Exploris files (v66, body_size 136): the frequency->m/z calibration coefficients (so the profile m/z converts correctly) and the MS2 precursor m/z (so dependent scans report their precursor and the rendered filter includes it).
Why
The v66 parser read the nparam/coefficients block at a fixed
body_size - 64and the MS2 reaction record at body offset 8. Both hold for Q Exactive (body_size 144) but not Exploris (136):body_size - 64landed on a zero word, socoefficientscame back empty andProfile::to_mz_intensitypassed the raw frequency through unconverted (profile m/z was wrong, e.g. ~600-2050 instead of ~40-470).How
FractionCollector(offset 80 for the offset-64 FC family) instead of a fixedbody_size - 64. On body_size 144 (Q Exactive) this is the same offset 80, so that path is unchanged; Exploris (136) now finds its A/B/C.body[4..12]).Both changes are additive/guarded; other instrument families take the existing paths.
Testing
cargo fmt --check,cargo clippy --all-targets -- -D warnings, andcargo test --allpass. Validated against the vendor reader on Orbitrap Exploris 120 acquisitions:build_filternow renders e.g.... ms2 100.0757@hcd3.00 ....No regression on Q Exactive Plus files (identical coefficients/profile before and after). All format knowledge is from public-corpus files and my own analysis.
Checklist
[Unreleased]updatedcargo fmt/cargo clippy -D warnings/cargo test --allpass