annotate annotatePeak/annotatePeak.R @ 2:be66730c5c3b draft

Uploaded
author testtool
date Sat, 25 Feb 2017 11:29:01 -0500
parents 92387cb81962
children e1c643f600d2
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
2
be66730c5c3b Uploaded
testtool
parents: 1
diff changeset
24 annotatePeak <- annotatePeak(DMRPeaks, level = "gene", annoDb = "org.Hs.eg.db")
0
5d70366e7c6f Uploaded
testtool
parents:
diff changeset
25
2
be66730c5c3b Uploaded
testtool
parents: 1
diff changeset
26
be66730c5c3b Uploaded
testtool
parents: 1
diff changeset
27 write.csv(as.data.frame(annotatePeak), annoPeakTable, row.names = FALSE)