Skip to content
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

New feature: group and summarised Spectra #295

Open
lgatto opened this issue Jun 13, 2023 · 2 comments
Open

New feature: group and summarised Spectra #295

lgatto opened this issue Jun 13, 2023 · 2 comments

Comments

@lgatto
Copy link
Member

lgatto commented Jun 13, 2023

The filterPrecursorMaxIntensity() (see #290) conceptually works as follows:

  1. Group spectra based on a given criterion, here those that have the same precursor MZ,
  2. Group these or filter one of them, here the one with the highest precursor intensity.

This could be generalised with groupSpectra() and summarizedSpectra() functions. But before embarking on something like this, we should rework the documentation (see #288) to clarify which functions would fall under this paradigm.

@jorainer
Copy link
Member

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.

@lgatto
Copy link
Member Author

lgatto commented Jun 15, 2023

Yes. The typical usage/paradigm would be

sp |>
  groupSpectraByPrecursorMz(...) |>
  summarizeSpectraByMaxPrecursorInt(...)

or

sp |>
  groupSpectra(fun = groupByPrecursorMz, ...) |>
  summarizeSpectra(fun = summarizeByMaxPrecursotIn, ...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants