diff --git a/workflow/main.nf b/workflow/main.nf
index d7b7829dcd1bed9de3798052ff59895c24db61f0..276672255016fba1a07e86a3bb62c571d56d38f4 100644
--- a/workflow/main.nf
+++ b/workflow/main.nf
@@ -24,6 +24,8 @@ process peakanno {
      script:
      """
      module load R/3.2.1-intel
+     module load deeptools/2.5.3
+     module load python/2.7.x-anaconda
      python $baseDir/scripts/process.py
      #Rscript /project/BICF/BICF_Core/bchen4/chipseq_analysis/workflow/scripts/runchipseeker.R     
 """
diff --git a/workflow/scripts/runDeepTools.py b/workflow/scripts/runDeepTools.py
index dad0cec7c3282fb2005afd1bb22a9f3d51e0b5f3..164b0b7d9d976d0fd5f485f37ddfc1a323490244 100644
--- a/workflow/scripts/runDeepTools.py
+++ b/workflow/scripts/runDeepTools.py
@@ -57,9 +57,9 @@ def run_signal(files, labels, genome):
   #work_pool.join()
   
   cm_command = "computeMatrix scale-regions -R "+gene_bed+" -a 3000 -b 3000 --regionBodyLength 5000 --skipZeros -S *.bw -o samples.deeptools_generegionscalematrix.gz"
-  p = subprocess.Popen(cm_command, shell=True)
-  p.communicate()
-  hm_command = "plotHeatmap -m samples.deeptools_generetionscalematrix.gz -out samples.deeptools_readsHeatmap.png"
+  #p = subprocess.Popen(cm_command, shell=True)
+  #p.communicate()
+  hm_command = "plotHeatmap -m samples.deeptools_generegionscalematrix.gz -out samples.deeptools_readsHeatmap.png"
   p = subprocess.Popen(hm_command, shell=True)
   p.communicate()  
 
diff --git a/workflow/scripts/runDiffBind.R b/workflow/scripts/runDiffBind.R
index c4cffa0d0ee4b65b63b0751c7570c8c196a0df3f..266fea72f3b16b595f98d08405244569babdb471 100644
--- a/workflow/scripts/runDiffBind.R
+++ b/workflow/scripts/runDiffBind.R
@@ -1,7 +1,8 @@
 library("DiffBind")
 
 #build dba object from sample sheet and do analysis
-data <- dba(sampleSheet="samplesheet.csv")
+args <- commandArgs(TRUE)
+data <- dba(sampleSheet=args[1])
 data <- dba.count(data)
 data <- dba.contrast(data, minMembers = 2, categories=DBA_CONDITION)
 data <- dba.analyze(data)
@@ -23,8 +24,11 @@ write.table(as.data.frame(normcount),"diffbind.normcount.txt",sep="\t",quote=F,r
 for (i in c(1:length(data$contrasts)))
 {
  contrast_name = paste(data$contrasts[[i]]$name1,"vs",
-                      data$contrasts[[i]]$name2,"diffbind.xls",sep="_")
+ contrast_bed_name = paste(data$contrasts[[i]]$name1,"vs",
+                      data$contrasts[[i]]$name2,"diffbind.bed",sep="_")
  report <- dba.report(data, contrast=i, th=1, bCount=TRUE)
  write.table(as.data.frame(report),contrast_name,sep="\t",quote=F,row.names=F)
+ write.table(as.data.frame(report),contrast_bed_name,sep="\t",quote=F,row.names=F, col.names=F)
+
 }