-
Notifications
You must be signed in to change notification settings - Fork 34
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
IsoDec Deconvolution Algorithm #791
Open
nbollis
wants to merge
45
commits into
smith-chem-wisc:master
Choose a base branch
from
nbollis:JohnnyDeconv
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #791 +/- ##
==========================================
+ Coverage 77.26% 77.36% +0.09%
==========================================
Files 218 220 +2
Lines 33027 33187 +160
Branches 3426 3441 +15
==========================================
+ Hits 25519 25674 +155
- Misses 6938 6940 +2
- Partials 570 573 +3
|
maybe we can add something for each new decon method about which of the two camps it falls into. |
…testing environment
trishorts
reviewed
Aug 6, 2024
trishorts
reviewed
Aug 6, 2024
mzLib/MassSpectrometry/Deconvolution/Algorithms/IsoDecAlgorithm.cs
Outdated
Show resolved
Hide resolved
…y correct charge states
…ect charge at least.
What mass range and resolution will this method apply to? |
nbollis
commented
Oct 4, 2024
mzLib/Development/DeconvolutionDevelopment/StandardDeconvolutionTest.cs
Outdated
Show resolved
Hide resolved
Patch coverage will need to be >= 90% |
Changed `ClassicDeconvolutionAlgorithm`, `DeconvolutionAlgorithm`, and `ExampleNewDeconvolutionAlgorithmTemplate` classes and their members from `public` to `internal` to restrict visibility within the assembly. Added summary comment to `DeconvolutionAlgorithm` class. Refactored `Deconvoluter` class to remove unnecessary `using` directives and simplify the `Deconvolute` method by removing switch-case logic. Updated `IsotopicEnvelope` class by removing `MassIndex` and `StDev` properties, and modified constructor and `ScoreIsotopeEnvelope` method accordingly. Updated `MzSpectrum` class to use `StandardDeviation` extension method from `Easy.Common.Extensions`. Removed various unnecessary `using` directives from multiple files.
- Added `InternalsVisibleTo` entries for "Development" and "Test" in `MassSpectrometry.csproj`. - Changed `MostAbundantObservedIsotopicMass` to `internal` in `IsotopicEnvelope.cs`. - Added a new constructor to `IsotopicEnvelope` with monoisotopic mass, intensity, and charge. - Added XML documentation and changed `GeneratePeak` to `protected virtual` in `MzSpectrum.cs`. - Removed unused `using` directives in `MzSpectrum.cs` and `NeutralMzSpectrum.cs`. - Modified `NeutralMzSpectrum` constructor to validate array lengths. - Added `Charges` property to `NeutralMzSpectrum` and initialized it in the constructor. - Overrode `GeneratePeak` in `NeutralMzSpectrum` to convert to a charged spectrum using `Charges`.
Added necessary using directives in Deconvoluter.cs. Modified Deconvoluter class for short-circuit deconvolution. Removed redundant lines in Deconvoluter.cs. Renamed NeutralMzSpectrum to NeutralMassSpectrum. Updated constructor and references accordingly.
Updated IsoDecAlgorithm to use generic DeconvolutionParameters. Enhanced IsoDecDeconvolutionParameters with new properties. Refactored constructor to use camelCase parameter names. Removed unused using directives from IsoDecAlgorithm.cs. Ensured correct casting in IsoDecAlgorithm. Renamed Css_Threshold to CssThreshold for consistency.
Updated the `MassSpectrometry` namespace in `IsoDecAlgorithm.cs` and `IsoDecDeconvolutionParameters.cs`. In `IsoDecAlgorithm.cs`, added a type check for `DeconvolutionParameters` and replaced redundant type casting with `deconParams`. In `IsoDecDeconvolutionParameters.cs`, removed unnecessary `using` directives, moved the class under the `MassSpectrometry` namespace, added user-accessible and hard-coded parameters with comments, updated the constructor to initialize new parameters, and removed the nested class declaration.
- Change `_phaseModelPath` to readonly static string to prevent modification after initial set. - Remove `process_spectrum` method declaration from the class. - Add `try-finally` block in `Deconvolute` to ensure `matchedPeaksPtr` memory is freed even if an exception occurs. - Move allocation of `matchedPeaksPtr` inside `try` block to allocate only if needed. - Invert check for `process_spectrum` result to return empty enumerable if result is <= 0. - Reformat loop processing matched peaks for better readability. - Ensure `Marshal.FreeHGlobal` is called in `finally` block to free `matchedPeaksPtr` if not zero.
Removed unused using directives from IsoDecAlgorithm.cs and Deconvoluter.cs. Updated IsoSettings namespace in IsoDecAlgorithm.cs. Simplified NUnit assertions in TestDeconvolution.cs. Updated MassSpectrometry.csproj with HintPath and PackagePath for DLLs. Replaced phase_model.bin with isogenmass.dll. Incremented version number in mzLib.nuspec to 5.2.35. Added isogenmass.dll to mzLib.nuspec for net8.0 and net8.0-windows7.0 targets.
nbollis
requested review from
trishorts,
Alexander-Sol,
jgpavek,
zhuoxinshi and
RayMSMS
January 8, 2025 01:22
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.
Added Isodec to mzlib and incorporated into existing deconvolution structure. Isodec has the capability to return up to
IsoDecDeconvolutionParameters.MaxShift
missed monoisotopic results that pass the envelope quality thresholds if theIsoDecDeconvolutionParameters.ReportMultipleMonoisos
is set to true.Isodec Deconvolution Algorithm:
Introduced
IsoDecAlgorithm
class inmzLib/MassSpectrometry/Deconvolution/Algorithms/IsoDecAlgorithm.cs
to support a new deconvolution methodAdded four new dlls to support isodec. They must be located in the main MassSpectrometery directory or else we run into a nightmare of nuget packing issues and dll reference mismatches when using mzlib as a nuget package
isodeclib.dll
,isogenmass.dll
,libmmd.dll
,svml_dispmd.dll
Code cleanup:
using
directives inDeconvolutionAlgorithm.cs
.DeconvolutionType
enum fromDeconvoluter.cs
and moved it toDeconvolutionType.cs
Deconvoluter.Deconvoluter()
had a clean IEnumerable return by breaking out private method for neutral mass case and returning the IEnumerable instead of using yield return directly.Development test case developments:
StandardDeconvolutionTest
inmzLib/Development/DeconvolutionDevelopment/StandardDeconvolutionTest.cs
to include test cases for the new IsoDec deconvolution parameters and refactored the test setup to iterate over multiple deconvolution parameters.DeconvolutionParameters
property initialization in theSinglePeakDeconvolutionTestCase
constructor inSinglePeakDeconvolutionTestCase.cs
.StandardDeconvolutionTest.cs
andDevelopment.csproj
to reflect the new directory structure (DeconvolutionDevelopment
). [1] [2]