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

Implemented SpectrumTree Class #678

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Alexander-Sol
Copy link
Contributor

The spectrum tree is a basic Binary Search Tree storing mz, intensity pairs. The nodes are ordered by m.z.

This data structure will allow for efficient search and deletion. It will be used for efficiently aligning two spectra, as is required by spectral similarity.

@codecov
Copy link

codecov bot commented Dec 16, 2022

Codecov Report

Merging #678 (41bde48) into master (ec1c965) will decrease coverage by 0.31%.
The diff coverage is 91.13%.

❗ Current head 41bde48 differs from pull request most recent head cf9b8c2. Consider uploading reports for the commit cf9b8c2 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #678      +/-   ##
==========================================
- Coverage   81.30%   80.99%   -0.31%     
==========================================
  Files         153      142      -11     
  Lines       25970    25576     -394     
==========================================
- Hits        21115    20716     -399     
- Misses       4855     4860       +5     
Impacted Files Coverage Δ
mzLib/MzLibUtil/TreeDictionary.cs 91.13% <91.13%> (ø)
mzLib/FlashLFQ/ChromatographicPeak.cs 90.97% <0.00%> (-1.09%) ⬇️
mzLib/FlashLFQ/FlashLfqEngine.cs 88.92% <0.00%> (-0.06%) ⬇️
...ectrometry/Deconvolution/DeconvoluterExtensions.cs 75.00% <0.00%> (ø)
...lution/Algorithms/ClassicDeconvolutionAlgorithm.cs 97.18% <0.00%> (ø)
...ution/Parameters/ClassicDeconvolutionParameters.cs 100.00% <0.00%> (ø)
mzLib/SpectralAveraging/Util/SpectraFileHandler.cs
...b/SpectralAveraging/Algorithms/OutlierRejection.cs
...ctralAveraging/Util/SpectralAveragingParameters.cs
.../SpectralAveraging/Algorithms/SpectralWeighting.cs
... and 20 more

{
_currentNode = null;
_nextNode = SpectrumTree.GetMinNode(_rootNode);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be easy to add tests for Reset() method and .Current field

Copy link
Collaborator

@acesnik acesnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

{
node.parent.leftChild = node.leftChild;
node.leftChild.parent = node.parent;
return;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there are some adjacent node cases that aren't tested

@acesnik
Copy link
Collaborator

acesnik commented Feb 7, 2023

There are a few small places where you could add tests, but no need to do that before merging unless you feel like it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants