Feat b y intensity ratio#184
Open
JemmaLDaniel wants to merge 3 commits intofix-fragment-match-double-countingfrom
Open
Feat b y intensity ratio#184JemmaLDaniel wants to merge 3 commits intofix-fragment-match-double-countingfrom
JemmaLDaniel wants to merge 3 commits intofix-fragment-match-double-countingfrom
Conversation
8e9a314 to
f49db77
Compare
c96c4e8 to
73bd392
Compare
73bd392 to
eb04976
Compare
f49db77 to
7b2daac
Compare
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.
Add b-ion/y-ion intensity ratio feature
Summary
Adds a new
b_y_intensity_ratiofeature toFragmentMatchFeatures(and its chimeric counterpartchimeric_b_y_intensity_ratiotoChimericFeatures). This feature captures the ratio of total matched b-ion intensity to total matched y-ion intensity in the observed spectrum, providing the calibrator with information about fragmentation directionality — a useful discriminator since correctly identified peptides tend to exhibit characteristic b/y intensity patterns depending on fragmentation type, enzyme, charge state, and sequence properties.Changes
winnow/calibration/features/utils.py:find_matching_ionsnow returns per-ion matched intensities (including isotopic envelope contributions) as a fifth return value.compute_ion_identificationsaggregates matched ion intensities by ion type (b vs y) and computes their ratio, returningb_y_intensity_ratioas a new output.compute_b_y_intensity_ratiohelper that sums intensities for b-ions and y-ions from the matched annotations and computes their ratio (returns 0.0 when no y-ion intensity is observed).winnow/calibration/features/fragment_match.py— addsb_y_intensity_ratiotocolumns()and stores the computed value indataset.metadata.winnow/calibration/features/chimeric.py— addschimeric_b_y_intensity_ratiocolumn; removes unused commented-out code for an earlier spectrum match quality approach.docs/api/features/fragment_match.md,docs/api/features/chimeric.md— document the new feature.tests/calibration/features/test_utils.py— tests forcompute_b_y_intensity_ratiocovering standard cases, edge cases (no y-ions, no b-ions, empty input), and integration withfind_matching_ions.tests/calibration/features/test_fragment_match.py,test_chimeric.py— assert new columns are present in computed outputs.