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

Fix min and max mz filtering in cut_mz_domain_noise #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions corems/mass_spectrum/calc/NoiseCalc.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,20 +120,20 @@ def cut_mz_domain_noise(self):

if max_mz_noise > max_mz_whole_ms:
max_mz_noise = max_mz_whole_ms

#print(min_mz_noise, max_mz_noise)
low_mz_index = (where(self.mz_exp_profile >= min_mz_noise)[0][0])
#print(self.mz_exp_profile[low_mz_index])
# low_mz_index = (argmax(self.mz_exp_profile <= min_mz_noise))

high_mz_index = (where(self.mz_exp_profile <= max_mz_noise)[-1][-1])

#the following indexing relies on mz_exp_profile being ordered high mz to low mz
low_mz_index = (where(self.mz_exp_profile >= min_mz_noise)[-1][-1])
#print(self.mz_exp_profile[low_mz_index])
#low_mz_index = (argmax(self.mz_exp_profile <= min_mz_noise))

high_mz_index = (where(self.mz_exp_profile <= max_mz_noise)[0][0])
#print(self.mz_exp_profile[high_mz_index])
#high_mz_index = (argmax(self.mz_exp_profile <= max_mz_noise))

if high_mz_index > low_mz_index:
# pyplot.plot(self.mz_exp_profile[low_mz_index:high_mz_index], self.abundance_profile[low_mz_index:high_mz_index])
# pyplot.show()
return self.mz_exp_profile[high_mz_index:low_mz_index], self.abundance_profile[low_mz_index:high_mz_index]
return self.mz_exp_profile[low_mz_index:high_mz_index], self.abundance_profile[low_mz_index:high_mz_index]
else:
# pyplot.plot(self.mz_exp_profile[high_mz_index:low_mz_index], self.abundance_profile[high_mz_index:low_mz_index])
# pyplot.show()
Expand Down