1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| library(ChIPseeker) library(GenomicFeatures) library(tidyverse)
hg38 <- loadDb("gencode.v44.sqlite")
peak1 <- readPeakFile('sample1_seacr_peak.stringent.bed') peak2 <- readPeakFile('sample2_seacr_peak.stringent.bed')
peaks <- list(sample1 = peak1, sample2 = peak2)
plotPeakProf2(peaks, upstream = 3000, downstream = 3000, conf = 0.95, by = "gene", type = "start_site", TxDb = hg38, facet="row")
plotPeakProf2(peaks, upstream = rel(0.2), downstream = rel(0.2), conf = 0.95, by = "gene", type = "body", nbin = 800, TxDb = hg38, facet="row")
peakAnnoList <- lapply(peaks, annotatePeak, TxDb=hg38, tssRegion=c(-3000, 3000), annoDb="org.Hs.eg.db") write.table(peakAnnoList[1], file = 'sample1_peak.txt', sep = '\t', quote = FALSE, row.names = FALSE) write.table(peakAnnoList[2], file = 'sample2_peak.txt', sep = '\t', quote = FALSE, row.names = FALSE)
plotAnnoBar(peakAnnoList) plotDistToTSS(peakAnnoList)
|