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