Mercurial > repos > testtool > annotate_peak
comparison annotate_peak/annotatePeak.R @ 12:54e19bceff70 draft
Uploaded
author | testtool |
---|---|
date | Thu, 16 Mar 2017 07:21:37 -0400 |
parents | |
children | 77c0aee75ac6 |
comparison
equal
deleted
inserted
replaced
11:5e0ac671c613 | 12:54e19bceff70 |
---|---|
1 require("ChIPseeker", quietly = TRUE) | |
2 require("ChIPpeakAnno", quietly = TRUE) | |
3 require("org.Hs.eg.db", quietly = TRUE) | |
4 require("GenomicRanges", quietly = TRUE) | |
5 options(warn = -1) | |
6 | |
7 args <- commandArgs(trailingOnly = TRUE) | |
8 DMR = args[1] | |
9 annoPeakTable = args[2] | |
10 | |
11 | |
12 DMRInfo = read.table( | |
13 DMR, | |
14 header = FALSE, | |
15 sep = "\t", | |
16 stringsAsFactors = FALSE, | |
17 quote = "" | |
18 ) | |
19 | |
20 DMRPeaks <- GRanges(seqnames = DMRInfo[, 1], | |
21 ranges = IRanges | |
22 (start = DMRInfo[, 2], end = DMRInfo[, 3])) | |
23 | |
24 annotatePeak <- as.data.frame(annotatePeak(DMRPeaks, level = "gene", annoDb = "org.Hs.eg.db")) | |
25 | |
26 write.csv(annotatePeak, annoPeakTable, row.names = FALSE) |