Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Above Averaging Algorithm Rework and Crash Fix #739

Merged
merged 6 commits into from
Nov 24, 2023

Conversation

nbollis
Copy link
Member

@nbollis nbollis commented Nov 15, 2023

Crash was caused by MS1 and MS2 scans being out of order. The previous algorithm mistakenly added duplicates of the same MS2 scan, leading to a crash on writing the mzML file as the scan numbers were not unique.

This PR changes how averaging DDA scans works by first removing the overlap parameter. The algorithm will iterate through all MS1 scans, adding the number to be averaged to a local collection. The collection will be averaged, the first scan removed, and the next scan inserted before restarting the loop. All unaveraged scans (leading or lagging MS1s or all MSn+) will then be added at the end.

Due to this change in the algorithm, the tests had to be reconsidered.
Test now ensure that the same number of MS1 and MS2 scans are present in the averaged spectrum, that they are in the same order, and that their retention times are correct after averaging.

Converting the averaged MzSpectrum into a MsDataScan was excised to a helper method to clean up the algorithmic methods.

This PR was packed and added to MetaMorpheus. The accompanying MetaMorpheus PR is #2318 and will need to be slightly amended once this version of Mzlib is released

@nbollis nbollis changed the title Averaging Algorithm Rework and CrashFix Averaging Algorithm Rework and Crash Fix Nov 15, 2023
Copy link

codecov bot commented Nov 15, 2023

Codecov Report

Merging #739 (699b515) into master (732c003) will decrease coverage by 1.68%.
The diff coverage is 100.00%.

❗ Current head 699b515 differs from pull request most recent head 6631a89. Consider uploading reports for the commit 6631a89 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #739      +/-   ##
==========================================
- Coverage   76.08%   74.40%   -1.68%     
==========================================
  Files         171      171              
  Lines       28876    28862      -14     
  Branches        0     2862    +2862     
==========================================
- Hits        21969    21474     -495     
+ Misses       6907     6902       -5     
- Partials        0      486     +486     
Files Coverage Δ
...ectralAveraging/Algorithms/SpectraFileAveraging.cs 97.64% <100.00%> (-1.35%) ⬇️

... and 78 files with indirect coverage changes

@nbollis nbollis changed the title Averaging Algorithm Rework and Crash Fix Above Averaging Algorithm Rework and Crash Fix Nov 15, 2023
@trishorts trishorts merged commit d147f54 into smith-chem-wisc:master Nov 24, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants