annotate annotatePeak/annotatePeak.R @ 0:5d70366e7c6f draft

Uploaded
author testtool
date Mon, 06 Feb 2017 10:53:57 -0500
parents
children 92387cb81962
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
1 require("ChIPseeker", quietly = TRUE)
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
2 require("ChIPpeakAnno", quietly = TRUE)
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
3 options(warn = -1)
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
4
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
5 args <- commandArgs(trailingOnly = TRUE)
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
6 DMR = args[1]
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
7 annoPeakTable = args[2]
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
8
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
9
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
10 DMRInfo = read.table(
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
11 DMR,
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
12 header = FALSE,
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
13 sep = "\t",
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
14 stringsAsFactors = FALSE,
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
15 quote = ""
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
16 )
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
17
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
18 DMRPeaks <- GRanges(seqnames = DMRInfo[, 1],
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
19 ranges = IRanges
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
20 (start = DMRInfo[, 2], end = DMRInfo[, 3]))
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
21
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
22 annotatePeak <-
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
23 as.data.frame(annotatePeak(DMRPeaks, level = "gene", annoDb = "org.Hs.eg.db"))
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
24
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
25
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
26 write.csv(annotatePeak, annoPeakTable, row.names = FALSE)