annotate annotatePeak/annotatePeak.R @ 1:92387cb81962 draft

Uploaded
author testtool
date Sat, 25 Feb 2017 11:18:27 -0500
parents 5d70366e7c6f
children be66730c5c3b
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)
1
92387cb81962 Uploaded
testtool
parents: 0
diff changeset
3 require("org.Hs.eg.db", quietly = TRUE)
0
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
4 options(warn = -1)
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
5
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
6 args <- commandArgs(trailingOnly = TRUE)
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
7 DMR = args[1]
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
8 annoPeakTable = args[2]
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
9
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
10
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
11 DMRInfo = read.table(
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
12 DMR,
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
13 header = FALSE,
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
14 sep = "\t",
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
15 stringsAsFactors = FALSE,
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
16 quote = ""
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
17 )
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
18
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
19 DMRPeaks <- GRanges(seqnames = DMRInfo[, 1],
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
20 ranges = IRanges
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
21 (start = DMRInfo[, 2], end = DMRInfo[, 3]))
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
22
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
23 annotatePeak <-
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
24 as.data.frame(annotatePeak(DMRPeaks, level = "gene", annoDb = "org.Hs.eg.db"))
1
92387cb81962 Uploaded
testtool
parents: 0
diff changeset
25 ??org.Hs.eg.db
0
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
26
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
27 write.csv(annotatePeak, annoPeakTable, row.names = FALSE)