Skip to content

Instantly share code, notes, and snippets.

@al2na
Last active August 29, 2015 14:23
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 al2na/8433238fc4ca61ace5a3 to your computer and use it in GitHub Desktop.
Save al2na/8433238fc4ca61ace5a3 to your computer and use it in GitHub Desktop.
methseg usage and installation
download.file("https://dl.dropboxusercontent.com/u/1373164/H1.chr21.chr22.rds",destfile="H1.chr21.chr22.rds",method="curl")
mbw=readRDS("H1.chr21.chr22.rds")
# it finds the optimal number of componets as 6
res=methSeg(mbw,diagnostic.plot=TRUE,maxInt=100,minSeg=10)
# however the BIC stabilizes after 4, we can also try 4 componets
res=methSeg(mbw,diagnostic.plot=TRUE,maxInt=100,minSeg=10,G=1:4)
# get segments to BED file
methSeg2bed(res,filename="H1.chr21.chr22.trial.seg.bed")
install.packages( c("data.table","devtools"))
source("http://bioconductor.org/biocLite.R")
biocLite(c("fastseg","rtracklayer"))
# install the package from github
library(devtools)
install_github("al2na/methylKit",ref="methSeg",build_vignettes=FALSE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment