There are two different use cases of filtering a spectrum by m/z:
filter by an m/z range (that's what the MSnbase::filterMz is doing): keep only peaks that are within the provided m/z range.
filter a spectrum keeping only peaks that match the provided m/z value(s). This is something I need at present: given a spectrum, find/filter to the peaks that match a set of m/z values (from different ions of a compound).
We could now either:
1) implement two separate filter methods filterMzRange for the first and filterMz for the latter use case.
2) implement a single filterMz with a parameter range = TRUE to switch between range- or match-based filtering.
There are two different use cases of filtering a spectrum by m/z:
MSnbase::filterMz
is doing): keep only peaks that are within the provided m/z range.We could now either: 1) implement two separate filter methods
filterMzRange
for the first andfilterMz
for the latter use case. 2) implement a singlefilterMz
with a parameterrange = TRUE
to switch between range- or match-based filtering.@sgibb @lgatto any comments, ideas?