Read an uncomputed annotation score from either Console notation - #11
Open
htsugawa wants to merge 1 commit into
Open
Read an uncomputed annotation score from either Console notation#11htsugawa wants to merge 1 commit into
htsugawa wants to merge 1 commit into
Conversation
MS-DIAL is changing how it writes an annotation score that was never computed. Both text exports now write null for such a score, where .mdpeak previously wrote 0.000 for the three dot products and both exports wrote -1 into Matched peaks count and Matched peaks percentage. parse_mdpeak and parse_mdscan depended on that -1. They counted a row as a candidate when all five score cells were present, and as scored when all five were also non-negative, so a precursor-only row was a candidate but not scored. Read against the new notation those cells are null, both counts collapse to the same number, and the tuning panel loses the distinction it shows as "MSP reference candidates" versus "MS/MS-scored candidates". The candidate count now comes from the annotated name instead, which is independent of the score notation: any name other than Unknown or empty is a reference candidate, including the no MS2:, w/o MS2: and low score: prefixes. The scored count keeps its meaning, rows with a spectral comparison, and both parsers now share one _annotation_score_row helper so they agree. A row whose comparison genuinely produced zero still counts as scored, because those zeros are measurements. Both notations now yield the same numbers, so the app works against an older official Console package and a newer local source build alike. The .mdscan candidate count changes from 2 to 1 in the test fixture, and that is a correction. GcmsAnalysisMetadataAccessor writes -1 into every score column when there is no match result at all, so the old rule counted an Unknown GC-MS row as a reference candidate. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Consumer-side counterpart to systemsomicslab/MsdialWorkbench#785, which changes how MS-DIAL Console writes an annotation score that was never computed.
Problem
parse_mdpeakandparse_mdscandepended on the-1sentinel:So a precursor-only row was a candidate but not scored — which is what the tuning panel shows as MSP reference candidates versus MS/MS-scored candidates.
A Console that includes the shared
AnnotationScoreFormatwritesnullinto every score column of such a row instead of0.000dot products plus-1matched-peak values. Read with the old rule those cells areNone, the row drops out of both counts, and the two numbers collapse to the same value.Change
Unknownor empty is a reference candidate, including theno MS2:,w/o MS2:andlow score:prefixes. This reproduces today's number against both an older and a newer Console, so the app works with an official Console package and a local source build alike._annotation_score_rowhelper, so they agree.One corrected number
The
.mdscanfixture's candidate count changes from 2 to 1, and that is a fix.GcmsAnalysisMetadataAccessorwrites-1into every score column when there is no match result at all, so the old rule counted anUnknownGC-MS row as a reference candidate.Tests
python -m unittest discover -s tests— 66 pass.test_parse_ascii_mdpeakkeeps its assertions, with the fixture given theNamecolumn that a real.mdpeakalways carries.test_parse_ascii_mdpeak_reports_same_counts_for_null_uncomputed_scoresis new: the same counts from the new notation.test_parse_ascii_mdpeak_keeps_a_comparison_that_scored_zerois new: an all-zero row that a real comparison produced still counts as scored.🤖 Generated with Claude Code