Possbility bug#1
Open
trishorts wants to merge 17 commits into
Open
Conversation
* Fix the bug by capping the p to 1 * add a tester to reach the line * finish my unit test
* Added fragment params to common params * Created UI control and view model for fragmentation parameters * Updated Mzlib * Update to fix toml read/write * Update Mod parsing * Fixed how ambiguity handles refragmentation * mzlib update * fixed mion loss annotations * MetaDraw: DeconExploration Range Update * MetaDraw: DeconExploration Range Update * Custom M Ions: UI * tempMzLib * Obo update * Updated obo and PtmListLoader * Added M-Ion stuff in to metadraw * mzlib * Update test * updated mzlib * test changes * Split M Ions * MetaDraw: PlotModel Stat splitting by grouping property. * Agent: GItignore * Secondary axis * grouping better * fixed redundant addition * fix bad test * test * MetaDrawSettingsTests * Reduce grouping options * remove unnecessary change * plot model stat tests * decon testing * decon plot testing * Expand test coverage * feat(FragmentationParams): add chemical formula column to M-Ion loss table - Add ChemicalFormula property to MIonLossViewModel to expose formula string - Add Chemical Formula column to the M-Ion losses DataGrid - Rearrange FragmentationParamsControl layout: - Left column: Max Fragment Mass only - Right column: All checkboxes (Complementary, N/C Terminal, Internal, M-Ions) - Bottom section: GroupBox with evenly spaced buttons, DataGrid, and notes * fix(FragmentationReanalysisViewModel): correct constructor parameter logic Swap the parameter initialization blocks so that: - When isProtein=true, use DigestionParams and SearchParameters (protein) - When isProtein=false, use RnaDigestionParams and RnaSearchParameters (RNA) Previously these were inverted, causing wrong fragmentation parameters to be loaded based on the analyte type. * fix(FragmentationReanalysis): include NeutralLoss in ion equality comparer Add NeutralLoss to both Equals() and GetHashCode() methods so that ions with different neutral losses (e.g., b5 with -80 Da loss vs b5 without loss) are treated as distinct. This preserves neutral loss fragment ions from the original PSM during refragmentation. * fix(FragmentationParamsControl): correct N/C-terminal checkbox bindings Swap the XAML bindings so that: - N-Terminal Ions checkbox binds to LeftSideFragmentIons (not RightSide) - C-Terminal Ions checkbox binds to RightSideFragmentIons (not LeftSide) This fixes the crossed bindings issue where selecting 'N-Terminal Ions' was silently enabling C-terminal ion search and vice versa. * fix(FragmentationParamsViewModel): preserve terminus flags in ReloadMIonLosses - Capture current LeftSideFragmentIons/RightSideFragmentIons state and reconstruct the proper FragmentationTerminus to pass to DigestionParams - Remove redundant selection restoration loop - LoadAvailableMIonLosses already restores selections from FragmentationParameters.MIonLosses - This prevents silently resetting N/C-terminal ion flags to defaults when user reloads custom M-Ion losses * fix(FragmentationReanalysisViewModel): add thread safety for static dictionary mutation Add a static lock object and wrap the DissociationTypeCollection dictionary writes and subsequent Fragment() calls to ensure thread safety when multiple refragmentation operations run concurrently. This prevents race conditions where concurrent calls could corrupt the shared static dictionary state. * fix(FragmentationParamsViewModel): branch on IsRnaMode for ReloadMIonLosses CommonParameters constructor checks 'if (digestionParams is RnaDigestionParams)' to select RNA vs protein defaults. Passing a protein DigestionParams in RNA mode causes it to override the passed fragmentationParams with new FragmentationParams(). - Branch on IsRnaMode when constructing digestion params - Add test ReloadMIonLosses_InRnaMode_PreservesRnaFragmentationParams to verify that ToFragmentationParams() returns RnaFragmentationParams after reload * fix(locking products): custom products are now locked properly * fix(mode change popup)
…orpheus into ChildScanTolerance
…r by scan's mass analyzer to determind the resolution
* redesign calibrate task window to mimic search task window * allow modern search style calibration * fasd * some xaml stuff not sure this works * internal review * calibration task coverage * response to review comments * eliminate reflection from calibration tests * Add .editorconfig with insert_final_newline = true * Remove launchSettings.json (unrelated to this PR) * Normalize trailing newlines per .editorconfig * unit test coverage for exceptions in calibration task * replace exception with messagebox --------- Co-authored-by: MICHAEL SHORTREED <mrshortreed@wisc.edu>
* enable spectrum library calculation in non-specific search * this test don't work * ok i think this test work * a better unit test * major complaints dealt with * Change PSM count assertion to check for greater than 30 --------- Co-authored-by: pcruzparri <43578034+pcruzparri@users.noreply.github.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.
PR Changes Overview — ChildScanTolerance Fixes
Date: 2026-04-08
Branch:
ChildScanToleranceBased on: fixes_report.md review (fixes 001-031)
Scope: Critical and select maintenance fixes only
Summary
These changes fix several critical bugs in the low-resolution (ion trap) product mass tolerance feature introduced in PR smith-chem-wisc#2635. The core issues were:
ProductMassTolerance_LowResdefaulted to a hardcodedAbsoluteTolerance(0.35)instead of inheriting fromProductMassTolerance, silently applying Da tolerance where ppm was expected.isLowRes: true, and most didn't, causing ion trap scans to use the wrong (narrow) tolerance.pvalue for glycopeptide scoring used the wrong tolerance window for ion trap scans, inflating statistical confidence.Files Changed
1.
MetaMorpheus/EngineLayer/CommonParameters.csFix 001 (Critical) — Wrong default fallback for
ProductMassTolerance_LowResproductMassTolerance_LowRes ?? new AbsoluteTolerance(0.35)changed toproductMassTolerance_LowRes ?? ProductMassToleranceWhen no explicit low-res tolerance is provided, it now inherits the resolved
ProductMassTolerancevalue (default 20 ppm) instead of hardcoding 0.35 Da. This ensures backward compatibility — existing configs without a low-res setting behave identically to before the PR.2.
MetaMorpheus/EngineLayer/MetaMorpheusEngine.csFix 002 (Critical) — Auto-detect low-res scans from analyzer metadata
MatchFragmentIonssignaturebool isLowRes = falseparameterMatchFragmentIonsbodybool isLowRes = IsLowResolutionScan(scan)auto-detectionMatchFragmentIonsOfAllChargessignaturebool isLowRes = falseparameterMatchFragmentIonsOfAllChargesbodybool isLowRes = IsLowResolutionScan(scan)auto-detectionIsLowResolutionScaninternal statichelper that checksscan.TheScan.MzAnalyzerforIonTrap2D/IonTrap3DThis centralizes the low-res determination so every call site automatically gets the correct tolerance without needing to independently determine the scan type. The helper is
internal staticso it can be reused byGlycoSearchEngineand tests.3.
MetaMorpheus/EngineLayer/GlycoSearch/GlycoSearchEngine.csFix 002 (Critical) — Remove manual
isLowRespassing at child scan call sitebool isIonTrapData = ...andisLowRes: isIonTrapDatafromMatchFragmentIonscall (now auto-detected)Fix 008 (Critical) — Parent scan
pcalculation uses wrong tolerancevar parentProductTolerance = IsLowResolutionScan(theScan) ? ...LowRes : ...beforepcalculationBug fix (build error from fix 002) — Stale
isIonTrapDatareference in child scanpcalculationisIonTrapDatatoIsLowResolutionScan(childScan)4.
MetaMorpheus/GUI/TaskWindows/GlycoSearchTaskWindow.xaml.csFix 013 (Critical) — UI combo box defaults to ppm when tolerance is null
When null, the combo box now defaults to "Da" (index 0), consistent with the save fallback behavior.
Fix 014 (Critical) — Save button hardcodes 0.35 Da fallback
new AbsoluteTolerance(0.35)changed toProductMassToleranceThe save fallback now inherits the user's configured product tolerance instead of hardcoding a Da value.
Fix 019 (Maintenance) — Updated
CheckTaskSettingsValiditycall siteproductMassTolerance_LowResTextBox.Textfrom positional arg smith-chem-wisc#3; added it as named argproductMassTolerance_LowRes:at end of callRequired by the signature change in
TaskValidator.cs.5.
MetaMorpheus/GUI/Util/TaskValidator.csFix 019 (Maintenance) — Remove dead overload, clean up signature
using Org.BouncyCastle.TlsnullproductMassTolerance_LowResto end of signature= nulldefaultExisting 22-arg callers (XLSearch, Search, Calibrate, GPTMD task windows) continue to compile unchanged. The single caller that passes the low-res value (GlycoSearchTaskWindow) now uses a named argument.
6.
MetaMorpheus/Test/GlycoSearchEngineTest.csTest updates — Aligned assertions with new default behavior
TestLowResToleranceConstruction_Default(line 83)PpmTolerance(20)instead ofAbsoluteTolerance(0.35)TestLowResToleranceConstruction_Default2(line 103)PpmTolerance(20)— TOML deserialization constructs with defaults before setting propertiesTestLowResToleranceConstruction_Default2(line 125)PpmTolerance(20)LowRes_CalibrateAndSearch(line 330)isLowRes: true/isLowRes: falseargsFixes Applied vs. Skipped
puses wrong toleranceBuild & Test Status