When call chromHMM with a bin size of say 1000 bp, if the consecutive bins are of the same state, it will be merged.
I want to tile the segment file before merging. https://support.bioconductor.org/p/102775/#102777
library(GenomicRanges)
library(rtracklayer)
chromHMM_seg<- import("data/chromHMM/SKCM-M852-P008_18_segments.bed", format = "BED")
chromHMM_seg_tile<- tile(chromHMM_seg, width = 1000)
names(chromHMM_seg_tile)<- chromHMM_seg$name
stack(chromHMM_seg_tile, "state")