Fix min and max mz filtering in cut_mz_domain_noise #13
+8
−8
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.
I noticed that changing the min_mz_noise and max_mz_noise parameters did not effect the baseline noise calculation when the threshold method was 'signal_noise'.
This seems to be fixed by changing the indexing in the cut_mz_domain_noise method in the NoiseThresholdCalc class.
Because mz_exp_profile was ordered from high to low in my tests, the indexing in the following commands needed to be reversed.
So I changed
to:
I saw that there was an if statement at the end of the function which compares the low_mz_index and high_mz_index to determine the order of the slice. This implies that the order of mz_exp_profile is not always fixed, in which case a more flexible solution is required. Happy to implement this if this is the case, otherwise I think the current fix will be fine.
I also changed the if statement at the end of the function which had the low_mz_index and high_mz_index variables in the wrong order.
EDIT 07/03/23: Changed the first index to -1 for low_mz_index in case the mz_exp_profile is a 2D array