Open lgatto opened 1 year ago
If I understood correctly, the idea of the grouping function would that it adds a special spectra variable to the input object with the spectra groups (e.g. a factor
). The summarize spectra will then use that grouping to summarize the spectra in each group to a single spectrum.
So, summarizeSpectra
could thus be defined as
summarizeSpectra <- function(x, f = spectraGroups(x), ...)
which would allow to either use predefined spectra groups or allow the user to define their own factor
.
Yes. The typical usage/paradigm would be
sp |>
groupSpectraByPrecursorMz(...) |>
summarizeSpectraByMaxPrecursorInt(...)
or
sp |>
groupSpectra(fun = groupByPrecursorMz, ...) |>
summarizeSpectra(fun = summarizeByMaxPrecursotIn, ...)
The
filterPrecursorMaxIntensity()
(see #290) conceptually works as follows:This could be generalised with
groupSpectra()
andsummarizedSpectra()
functions. But before embarking on something like this, we should rework the documentation (see #288) to clarify which functions would fall under this paradigm.