# NOT RUN {
gr <- data.frame(seqnames = c("chr1", rep("chr2", 3), rep("chr1", 2), rep("chr3", 4)),
start = 1:10,
end = 11,
strand = c("-", rep("+", 2), rep("*", 2), rep("+", 3), rep("-", 2))) %>%
as_granges() %>%
set_genome_info(seqlengths = c(11,12,13))
# partition ranges into subranges of width 2, odd width ranges
# will have one subrange of width 1
tile_ranges(gr, width = 2)
# make sliding windows of width 3, moving window with step size of 2
slide_ranges(gr, width = 3, step = 2)
# }
Run the code above in your browser using DataLab