Description Usage Arguments Details Value Examples
Cast a Ranges to a RangesList
1 2 3 4 5 6 7 8 9 10 | split_ranges(x, ...)
## S4 method for signature 'Ranges'
split_ranges(x, ...)
## S4 method for signature 'GroupedGenomicRanges'
split_ranges(x, ...)
## S4 method for signature 'GroupedIntegerRanges'
split_ranges(x, ...)
|
x |
a Ranges object |
... |
grouping variables to split by (passed to |
If x
is already grouped, then passing ...
are ignored. If x
is not grouped and variable names are provided to ...
these are forwarded
to [plyranges::group_by()]
, if no variables are provided then x is returned.
a RangesList object
1 2 3 4 5 6 7 8 9 10 11 12 13 | suppressPackageStartupMessages(library("GenomicRanges"))
suppressPackageStartupMessages(library("plyranges"))
lvls <- paste0("chr",c(1:23))
gr <- GRanges(
seqnames = factor(sample(lvls, 1000, replace = TRUE), levels = lvls),
ranges = IRanges(start = rpois(1000, 10000), width = rpois(1000, 100)),
grp = sample(letters[1:4], 1000, replace = TRUE),
gc = runif(1000)
)
split_ranges(gr, seqnames)
gr_by_grp <- group_by(gr, grp)
split_ranges(gr_by_grp)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.