Skip to content

Commit

Permalink
fix: recalculate_peaks setting bug
Browse files Browse the repository at this point in the history
bug where if set recalculatePeaks on MRMTransitionGroupPicker get error
because it wants a boolean string rather than boolean. Fix this so can
now accept boolean
  • Loading branch information
jcharkow committed Apr 4, 2024
1 parent 6e4b2ba commit 100a00b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion massdash/peakPickers/MRMTransitionGroupPicker.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,19 @@ def setGeneralParameters(self, **kwargs):

valid_params = ['stop_after_feature', 'stop_after_intensity_ratio', 'min_peak_width', 'recalculate_peaks_max_z', 'resample_boundary', 'recalculate_peaks', 'background_subtraction', 'use_precursors']
mrmParams = ['signal_to_noise']
valid_params = valid_params + mrmParams
bools_to_str = ['recalculate_peaks'] # these parameters require a "true" or "false" string
valid_params = valid_params + mrmParams + bools_to_str
for k, val in kwargs.items():
if k not in valid_params:
raise ValueError(f"Parameter {k} is not valid or is not currently supported")
else:
if k in mrmParams:
self.params.setValue(bytes('PeakPickerMRM:'+k, encoding='utf-8'), val)
elif k in bools_to_str:
if k:
self.params.setValue(bytes(k, encoding='utf-8'), 'true')
else:
self.params.setValue(bytes(k, encoding='utf-8'), 'false')
else:
self.params.setValue(bytes(k, encoding='utf-8'), val)
self.picker.setParameters(self.params)
Expand Down

0 comments on commit 100a00b

Please sign in to comment.