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

[WIP] Fix issue when averaging spectra in aquired in profile mode #244

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 5 additions & 1 deletion pymzml/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,11 @@ def __add__(self, other_spec):
if self._peak_dict["reprofiled"] is None:
reprofiled = self._reprofile_Peaks()
self.set_peaks(reprofiled, "reprofiled")
for mz, i in other_spec.peaks("reprofiled"):
if other_spec._peak_dict['reprofiled'] is None:
reprofiled = other_spec._reprofile_Peaks()
other_spec.set_peaks(reprofiled, "reprofiled")
# access peak dict directly to avoid casting to array
for mz, i in other_spec._peak_dict['reprofiled'].items():
self._peak_dict["reprofiled"][mz] += i
return self

Expand Down