annotate annoPeakFigure/annoPeakFigure.R @ 5:1de0d1429a3c draft default tip

Uploaded
author testtool
date Mon, 20 Mar 2017 06:49:22 -0400
parents 57082662d2e5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
6bcf1f0bff41 Uploaded
testtool
parents: 2
diff changeset
1 require("ChIPseeker", quietly = TRUE)
6bcf1f0bff41 Uploaded
testtool
parents: 2
diff changeset
2 require("ChIPpeakAnno", quietly = TRUE)
6bcf1f0bff41 Uploaded
testtool
parents: 2
diff changeset
3 require("EnsDb.Hsapiens.v75", quietly = TRUE)
5
1de0d1429a3c Uploaded
testtool
parents: 4
diff changeset
4 require("data.table", quietly = TRUE)
3
6bcf1f0bff41 Uploaded
testtool
parents: 2
diff changeset
5
0
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
6 options(warn = -1)
3
6bcf1f0bff41 Uploaded
testtool
parents: 2
diff changeset
7 options("download.file.method"="wget")
0
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
8
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
9 args <- commandArgs(trailingOnly = TRUE)
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
10 DMR = args[1]
4
57082662d2e5 Uploaded
testtool
parents: 3
diff changeset
11 annoPeakFigure = args[2]
0
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
12
5
1de0d1429a3c Uploaded
testtool
parents: 4
diff changeset
13 DMRInfo = fread(
0
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
14 DMR,
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
15 header = FALSE,
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
16 sep = "\t",
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
17 stringsAsFactors = FALSE,
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
18 quote = ""
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
19 )
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
20
3
6bcf1f0bff41 Uploaded
testtool
parents: 2
diff changeset
21 peaks <- GRanges(seqnames = DMRInfo[, 1],
6bcf1f0bff41 Uploaded
testtool
parents: 2
diff changeset
22 ranges = IRanges
6bcf1f0bff41 Uploaded
testtool
parents: 2
diff changeset
23 (start = DMRInfo[, 2], end = DMRInfo[, 3]))
0
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
24
3
6bcf1f0bff41 Uploaded
testtool
parents: 2
diff changeset
25 annoData <- toGRanges(EnsDb.Hsapiens.v75)
6bcf1f0bff41 Uploaded
testtool
parents: 2
diff changeset
26 seqlevelsStyle(peaks) <- seqlevelsStyle(annoData)
0
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
27
5
1de0d1429a3c Uploaded
testtool
parents: 4
diff changeset
28
3
6bcf1f0bff41 Uploaded
testtool
parents: 2
diff changeset
29 anno <- annoPeaks(peaks, annoData=annoData,bindingType ="startSite")
0
88964c4b12a0 Uploaded
testtool
parents:
diff changeset
30
3
6bcf1f0bff41 Uploaded
testtool
parents: 2
diff changeset
31
6bcf1f0bff41 Uploaded
testtool
parents: 2
diff changeset
32 png(file = annoPeakFigure,
1
6278004aa9b2 Uploaded
testtool
parents: 0
diff changeset
33 width = 1200,
6278004aa9b2 Uploaded
testtool
parents: 0
diff changeset
34 height = 600)
6278004aa9b2 Uploaded
testtool
parents: 0
diff changeset
35
3
6bcf1f0bff41 Uploaded
testtool
parents: 2
diff changeset
36 pie1(table(anno$insideFeature))
1
6278004aa9b2 Uploaded
testtool
parents: 0
diff changeset
37
6278004aa9b2 Uploaded
testtool
parents: 0
diff changeset
38 dev.off()
6278004aa9b2 Uploaded
testtool
parents: 0
diff changeset
39