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

Function to merge/reduce overlapping ranges #73

Open
jorainer opened this issue Oct 17, 2023 · 0 comments
Open

Function to merge/reduce overlapping ranges #73

jorainer opened this issue Oct 17, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@jorainer
Copy link
Member

Definition of the IRanges::reduce function:

       ‘reduce’ first orders the ranges in ‘x’ from left to right, then
       merges the overlapping or adjacent ones.

The reduce function works however only on IRanges (i.e. integer values) while we have real values.

Use case: have m/z ranges (e.g. for chromatographic peaks) and want to get a unique set of non-overlapping ranges. This is some functionality that is also used/needed in e.g. xcms.

Definition:

reduceRanges <- function(x, ...) 

Input: two column matrix, each row being one range and columns being the lower and upper m/z.
Output: two column matrix with the non-overlapping ranges (increasingly ordered by m/z).

@jorainer jorainer added the enhancement New feature or request label Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant