Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Kzra
Copy link
Contributor

@Kzra Kzra commented May 13, 2021

Running this code:

from corems.transient.input.brukerSolarix import ReadBrukerSolarix
from corems.encapsulation.factory.parameters import MSParameters
MSParameters.mass_spectrum.threshold_method = 'signal_noise'
MSParameters.mass_spectrum.s2n_threshold = 4
file_path= 'Ezra MS 060532_000005.d srfa iii'
bruker_reader = ReadBrukerSolarix(file_path)
bruker_transient_obj = bruker_reader.get_transient()
mass_spectrum_obj = bruker_transient_obj.get_mass_spectrum(plot_result=False, auto_process=True)

gave the following error:
Screenshot 2021-05-13 163859

This was due to the list freq having a different length to mz and abundance in the PeakPicking.py class. I think this problem is due to the mz cut offs not being equally applied to self.freq_exp_profile in the cut_mz_domain_peak_picking(self) function which returns these lists.

I have come up with a possible fix for this by first applying the low mz cut off to self.freq_exp_profile to create a new variable freq_domain_low_Y_cutoff and then applying the high mz cut off. This gets rid of the error when running the above code, but I haven't tested the change in any other way. I'm also not 100 % sure about this, so definitely needs reviewing.

@corilo
Copy link
Member

corilo commented May 13, 2021

Erza, thanks! I tested and it looks like you solution is working; good catch!

@corilo corilo merged commit de8dabf into EMSL-Computing:master May 13, 2021
deweycw referenced this pull request in deweycw/CoreMS Aug 23, 2022
Fix for a bug causing an index error in mass_spectrum\calc\PeakPicking.py
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.

2 participants