annotate annoPeakFigure/annoPeakFigure.R @ 0:88964c4b12a0 draft

Uploaded
author testtool
date Mon, 06 Feb 2017 10:58:35 -0500
parents
children 6278004aa9b2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
1 require("ChIPseeker", quietly = TRUE)
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
2 require("ChIPpeakAnno", quietly = TRUE)
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
3
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
4 options(warn = -1)
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
5
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
6 args <- commandArgs(trailingOnly = TRUE)
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
7 DMR = args[1]
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
8 annoPeakFigure = args[2]
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
9
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
10 #DMR <- ("test-data/DMR.bed")
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
11 DMRInfo = read.table(
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
12 DMR,
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
13 header = FALSE,
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
14 sep = "\t",
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
15 stringsAsFactors = FALSE,
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
16 quote = ""
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
17 )
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
18
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
19 DMRPeaks <- GRanges(seqnames = DMRInfo[, 1],
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
20 ranges = IRanges
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
21 (start = DMRInfo[, 2], end = DMRInfo[, 3]))
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
22
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
23 annotatePeak <- (annotatePeak(DMRPeaks, level = "gene", annoDb = "org.Hs.eg.db"))
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
24
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
25 #annoPeakFigure <- ('test-data/annoPeakFigure.png')
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
26
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
27 png(file = annoPeakFigure,
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
28 width = 1200,
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
29 height = 600)
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
30
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
31 upsetplot(annotatePeak, vennpie = TRUE)
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
32
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
33 dev.off()