ranges-reduce: Reduce then aggregate a Ranges object

Description Usage Arguments Value Examples

Description

Reduce then aggregate a Ranges object

Usage

1
2
3

Arguments

.data

a Ranges object to reduce

...

Name-value pairs of summary functions.

Value

a Ranges object with the

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
set.seed(10)
df <- data.frame(start = sample(1:10), 
                 width = 5,  
                 seqnames = "seq1",
                 strand = sample(c("+", "-", "*"), 10, replace = TRUE), 
                 gc = runif(10))
                 
rng <- as_granges(df)
rng %>% reduce_ranges()
rng %>% reduce_ranges(gc = mean(gc))
rng %>% reduce_ranges_directed(gc = mean(gc))

x <- data.frame(start = c(11:13, 2, 7:6), 
               width=3, 
               id=sample(letters[1:3], 6, replace = TRUE),
               score= sample(1:6))
x <- as_iranges(x)
x %>% reduce_ranges()
x %>% reduce_ranges(score = sum(score))
x %>% group_by(id) %>% reduce_ranges(score = sum(score))

plyranges documentation built on Nov. 8, 2020, 7:36 p.m.