# HG changeset patch # User testtool # Date 1489695225 14400 # Node ID 982a0152411884f8a5b1e6503674eedf67cb77e5 # Parent ee3fc24b21082d769bae51998778796190ffd9de Uploaded diff -r ee3fc24b2108 -r 982a01524118 annotate_peak/annotatePeak.R --- a/annotate_peak/annotatePeak.R Thu Mar 16 11:23:38 2017 -0400 +++ b/annotate_peak/annotatePeak.R Thu Mar 16 16:13:45 2017 -0400 @@ -1,9 +1,10 @@ require("ChIPseeker", quietly = TRUE) require("ChIPpeakAnno", quietly = TRUE) require("EnsDb.Hsapiens.v75", quietly = TRUE) -require("GenomicRanges", quietly = TRUE) options(warn = -1) +options("download.file.method"="wget") + args <- commandArgs(trailingOnly = TRUE) DMR = args[1] annoPeakTable = args[2] @@ -20,16 +21,11 @@ peaks <- GRanges(seqnames = DMRInfo[, 1], ranges = IRanges (start = DMRInfo[, 2], end = DMRInfo[, 3])) -peaks[1:2] + annoData <- toGRanges(EnsDb.Hsapiens.v75) -annoData[1:2] - -## keep the seqnames in the same style seqlevelsStyle(peaks) <- seqlevelsStyle(annoData) -## do annotation by nearest TSS -anno <- annotatePeakInBatch(peaks, AnnotationData=annoData) -anno[1:2] + +anno <- annoPeaks(peaks, annoData=annoData,bindingType ="startSite") + #annoPeakTable <- ('test-data/ChIPPeak.csv') -write.csv(anno, annoPeakTable, row.names = FALSE) - - +write.csv(anno, annoPeakTable, row.names = FALSE) \ No newline at end of file