annotate annotatePeak/annotatePeak.R @ 4:e1c643f600d2 draft

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