0
|
1 require("ChIPseeker", quietly = TRUE)
|
|
2 require("ChIPpeakAnno", quietly = TRUE)
|
1
|
3 require("org.Hs.eg.db", quietly = TRUE)
|
0
|
4 options(warn = -1)
|
|
5
|
|
6 args <- commandArgs(trailingOnly = TRUE)
|
|
7 DMR = args[1]
|
|
8 annoPeakTable = args[2]
|
|
9
|
|
10
|
|
11 DMRInfo = read.table(
|
|
12 DMR,
|
|
13 header = FALSE,
|
|
14 sep = "\t",
|
|
15 stringsAsFactors = FALSE,
|
|
16 quote = ""
|
|
17 )
|
|
18
|
|
19 DMRPeaks <- GRanges(seqnames = DMRInfo[, 1],
|
|
20 ranges = IRanges
|
|
21 (start = DMRInfo[, 2], end = DMRInfo[, 3]))
|
|
22
|
|
23 annotatePeak <-
|
|
24 as.data.frame(annotatePeak(DMRPeaks, level = "gene", annoDb = "org.Hs.eg.db"))
|
1
|
25 ??org.Hs.eg.db
|
0
|
26
|
|
27 write.csv(annotatePeak, annoPeakTable, row.names = FALSE)
|