Skip to content

Instantly share code, notes, and snippets.

@al2na
Last active August 14, 2016 10:10
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/58f7856503dae62d5597cd6163c2068b to your computer and use it in GitHub Desktop.
Save al2na/58f7856503dae62d5597cd6163c2068b to your computer and use it in GitHub Desktop.
p300.url="http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeAwgTfbsUniform/wgEncodeAwgTfbsHaibH1hescP300V0416102UniPk.narrowPeak.gz"
Nanog.url="http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeAwgTfbsUniform/wgEncodeAwgTfbsHaibH1hescNanogsc33759V0416102UniPk.narrowPeak.gz"
SP1.url="http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeAwgTfbsUniform/wgEncodeAwgTfbsHaibH1hescSp1Pcr1xUniPk.narrowPeak.gz"
chrHMM.url="http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeBroadHmm/wgEncodeBroadHmmH1hescHMM.bed.gz"
#http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeAwgSegmentation/wgEncodeAwgSegmentationChromhmmH1hesc.bed.gz"
# get chromHMM annotation and make a list out of it
library(genomation)
chrHMM=readBed(chrHMM.url)
chrHMM.list=GenomicRanges::split(chrHMM, chrHMM$name,drop=TRUE)
# get peaks
p300=readBed(p300.url)
SP1=readBed(SP1.url)
NANOG=readBed(Nanog.url)
heatTargetAnnotation(peak2ann.l)
mat=heatTargetAnnotation(peak2ann.l,plot=FALSE)
library(gplots)
heatmap.2(mat,col="topo.colors",cellnote=round(mat),
notecol="black",trace="none",cexCol=0.5,cexRow=0.8)
# install the package from github
library(devtools)
install_github("BIMSBbioinfo/genomation",build_vignettes=FALSE)
peak2ann=annotateWithFeatures(p300,chrHMM.list)
peak2ann
peak.list=GenomicRanges::GRangesList(p300=p300,SP1=SP1,NANOG=NANOG)
peak2ann.l=annotateWithFeatures(peak.list,chrHMM.list)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment