reduceSegment {nullranges} | R Documentation |
Combine nearby regions with same state
reduceSegment(x, col = "state")
x |
the input GRanges |
col |
the name of the column for the segment states |
a GRanges with metadata column state
giving the segmentation state
n <- 10000 library(GenomicRanges) gr <- GRanges("chr1", IRanges(round( c(runif(n/4,1,991), runif(n/4,1001,3991), runif(n/4,4001,4991), runif(n/4,7001,9991))), width=10), seqlengths=c(chr1=10000)) gr$name <- rep(1:4,each=10) gr <- sort(gr) seg <- reduceSegment(gr, col="name")