Skip to content

Instantly share code, notes, and snippets.

@crazyhottommy
Created March 6, 2018 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crazyhottommy/57dd1348419590ebb34e3ee7783ee8ce to your computer and use it in GitHub Desktop.
Save crazyhottommy/57dd1348419590ebb34e3ee7783ee8ce to your computer and use it in GitHub Desktop.

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")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment