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