simplifyHMM | R Documentation |
convenience function for adding simplified names & colors to a ChromHMM track
simplifyHMM(HMM, cols = NULL, how = c("MNEMONIC", "STATE", "NUMBER"))
HMM |
a GRanges containing a ChromHMM track |
cols |
color table (will be loaded if not provided) |
how |
one of 'MNEMONIC' (default), 'STATE', or 'NUMBER' |
if simplifying further than 5-6 states, fix the map first
the same ChromHMM track, but simplified and colored simply
http://compbio.mit.edu/ChromHMM/
colorHMM
# simpler even than the defaults:
data(remc18state, package="chromophobe")
simpler <- remc18state
simpler$SIMPLE <- sub("(Promoter|Enhancer)", "Active", simpler$SIMPLE)
simpler$SIMPLE <- sub("(Transcribed|Het_Rpt_Qui)", "Other", simpler$SIMPLE)
simpler[simpler$SIMPLE == "Other", "RGBSIMPLE"] <- "255,255,255"
data(chr19_HMM, package="chromophobe")
simplerHMM <- simplifyHMM(chr19_HMM, cols=simpler)
with(simplerHMM, table(name))
# blueprint HMM simplification (better to use hg38, though)
## Not run:
data(FDFT1)
bpHMMfiles <- list.files(patt="BlueprintChromHMM.*hg19.bed.gz$")
names(bpHMMfiles) <- sapply(strsplit(bpHMMfiles,"\\."),`[`,1)
bpHMMs <- GRangesList(lapply(bpHMMfiles, import, which=FDFT1))
data(blueprint12state)
simplified <- GRangesList(lapply(bpHMMs, simplifyHMM,
cols=blueprint12state, how="NUMBER"))
genome(simplified) <- "hg19"
for (i in names(simplified)) compressAndExportHMM(simplified[[i]], i)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.