From e7b72cfb4b5adae63053a7c256834c1b34b59a35 Mon Sep 17 00:00:00 2001
From: Venkat Malladi <venkat.malladi@utsouthwestern.edu>
Date: Wed, 26 Dec 2018 19:23:34 -0600
Subject: [PATCH] Change R version and output.

---
 workflow/conf/biohpc.config       |  2 +-
 workflow/scripts/annotate_peaks.R | 14 +++++---------
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/workflow/conf/biohpc.config b/workflow/conf/biohpc.config
index c6d3953..6c9806f 100644
--- a/workflow/conf/biohpc.config
+++ b/workflow/conf/biohpc.config
@@ -49,7 +49,7 @@ process {
     executor = 'local'
   }
   withName: peakAnnotation {
-    module = ['R/3.4.1-gccmkl']
+    module = ['R/3.3.2-gccmkl']
     executor = 'local'
   }
   withName: diffPeaks {
diff --git a/workflow/scripts/annotate_peaks.R b/workflow/scripts/annotate_peaks.R
index 63fa051..3661bc0 100644
--- a/workflow/scripts/annotate_peaks.R
+++ b/workflow/scripts/annotate_peaks.R
@@ -8,11 +8,8 @@ library("ChIPseeker")
 library("TxDb.Hsapiens.UCSC.hg19.knownGene")
 library("TxDb.Mmusculus.UCSC.mm10.knownGene")
 library("TxDb.Hsapiens.UCSC.hg38.knownGene")
-
-source("http://bioconductor.org/biocLite.R")
-if(!require("ChIPseeker")){
-    biocLite("ChIPseeker")
-}
+library("org.Hs.eg.db")
+library("org.Mm.eg.db")
 
 
 # Create parser object
@@ -29,13 +26,13 @@ genome <-args[2]
 # Load UCSC Known Genes
 if(genome=='GRCh37') {
     txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene
-    annodb <- org.Hs.eg.db
+    annodb <- 'org.Hs.eg.db'
 } else if(genome=='GRCm38')  {
     txdb <- TxDb.Mmusculus.UCSC.mm10.knownGene
-    annodb <- org.Mm.eg.db
+    annodb <- 'org.Mm.eg.db'
 } else if(genome=='GRCh38')  {
     txdb <- TxDb.Hsapiens.UCSC.hg38.knownGene
-    annodb <- org.Hs.eg.db
+    annodb <- 'org.Hs.eg.db'
 }
 
 # Load design file
@@ -45,7 +42,6 @@ names(files) <- design$Condition
 
 
 peakAnnoList <- lapply(files, annotatePeak, TxDb=txdb, annoDb=annodb, tssRegion=c(-3000, 3000), verbose=FALSE)
-
 for(index in c(1:length(peakAnnoList))) {
   filename <- paste(names(files)[index],".chipseeker_annotation.csv",sep="")
   write.table(as.data.frame(peakAnnoList[[index]]),filename,sep=",",quote=F)
-- 
GitLab