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
optimize function names (removePeaks, clean) #89
Comments
Related to discussions here at the RFMF workshop (see rformassspectrometry#89 ) Yours, Steffen
Indeed, very confusing, and I take the blame for this many years ago. I am not convinced about renaming I would suggest the following changes, including in the signature of
These names are a bit longer but avoid any ambiguity. |
Do we need both functions? What are the use cases for them? I used them only in combinations, i.e. first |
filterIntensities(object,
threshold = minIntensity(),
all = TRUE,
msLevel. = unique(msLevel(object))) that filters (i.e. completely remove) peaks and setIntsToZero(object,
threshold = minIntensity(),
msLevel. = unique(msLevel(object))) that sets them to zero. |
I like the For replaceIntensityBelow(object,
threshold = min,
value = 0,
msLevel. = unique(msLevel(object)) with In addition (don't know if that's too much then) we could also have a filterIntensity(object,
intensity = c(min, Inf),
msLevel. = unique(msLevel(object))) This function would then match the |
|
the And yes, |
|
I could see plausible use cases for filtering max I as well (e.g. signal suppression / saturation was encountered, or you already analysed the Top X peaks and want to look at the middle ground) and would be pro leaving this in for enhanced flexibility. One could always design the function so that if only one value is given it is implicitly |
Hmm can you do it so that it asks for both parameters officially, but provides the implicit shortcut of setting max=Inf if only one value is provided, for those that don't want to type? |
I am in favour of the second option. |
+1 for the latter |
OK, summarizing: we agreed on:
|
- Rename/replace `removePeaks` to `replaceIntensitiesBelow` (issue #89). - Update respective unit tests and documentation.
- Remove the `clean` method. - Add the `filterIntensity` method.
Replace the `clean` method with `filterIntensity` (issue #89)
Discussion at metaRbolomics, these two functions are a bit of a misnoma:
https://github.com/rformassspectrometry/Spectra/blob/master/R/Spectra.R#L401
"removePeaks" is rather "markPeaks" or something (it doesn't actually remove peaks)
Whereas "clean" is not really clean but more analogous to trim
https://github.com/rformassspectrometry/Spectra/blob/master/R/Spectra.R#L412
The text was updated successfully, but these errors were encountered: