changeset 17:982a01524118 draft

Uploaded
author testtool
date Thu, 16 Mar 2017 16:13:45 -0400
parents ee3fc24b2108
children 6a9b9694acbf
files annotate_peak/annotatePeak.R
diffstat 1 files changed, 7 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- 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