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