set.seed(1)
st <- round(rnorm(1000,500,100))
strand <- rep(c('+','-'),each=500)
space <- rep('chr1',length(st))
sample1 <- RangedData(IRanges(st,st+38),strand=strand,space=space)
st <- round(rnorm(1000,1000,100))
sample2 <- RangedData(IRanges(st,st+38),strand=strand,space=space)
regions <- islandCounts(RangedDataList(sample1,sample2),minReads=50)
regions
#Plot coverage
plot(coverage(sample1)[[1]],type='l',xlim=c(0,2000))
lines(coverage(sample2)[[1]],col=2)
Run the code above in your browser using DataLab