Skip to content

Commit

Permalink
Merge pull request pymzml#318 from JB-Wolf/fix_sub
Browse files Browse the repository at this point in the history
fix error when subtracting two spectra
  • Loading branch information
MKoesters authored Feb 3, 2023
2 parents 70e5dd2 + 6a8e630 commit f601564
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pymzml/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,8 @@ def __sub__(self, other_spec):
assert isinstance(other_spec, Spectrum)
if self._peak_dict["reprofiled"] is None:
self.set_peaks(self._reprofile_Peaks(), "reprofiled")
if other_spec._peak_dict["reprofiled"] is None:
other_spec.set_peaks(other_spec._reprofile_Peaks(), "reprofiled")
for mz, i in other_spec.peaks("reprofiled"):
self._peak_dict["reprofiled"][mz] -= i
self.set_peaks(None, "centroided")
Expand Down

0 comments on commit f601564

Please sign in to comment.