diff --git a/workflow/main.nf b/workflow/main.nf
index 762cdef93f32a8e8634fbe47be6f1b65cd044576..2095ec62868fc71d24c8b56dd12a60b9f554110e 100644
--- a/workflow/main.nf
+++ b/workflow/main.nf
@@ -34,21 +34,21 @@ process processdesign {
      """
 }
 
-//process run_deeptools {
-//   publishDir "$baseDir/output", mode: 'copy'
-//   input:
-//     file deeptools_design_file from deeptools_design
-//   file annotation Tdx
-//   output:
-//     stdout result
-//     script:
-//     """
-//     module load python/2.7.x-anaconda
-//     source activate /project/shared/bicf_workflow_ref/chipseq_bchen4/
-//     module load deeptools/2.3.5 
-//     python $baseDir/scripts/runDeepTools.py -i $deeptools_design_file -g ${params.genomepath}}
-//"""
-//}
+process run_deeptools {
+   publishDir "$baseDir/output", mode: 'copy'
+   input:
+     file deeptools_design_file from deeptools_design
+   file annotation Tdx
+   output:
+     stdout result
+     script:
+     """
+     module load python/2.7.x-anaconda
+     source activate /project/shared/bicf_workflow_ref/chipseq_bchen4/
+     module load deeptools/2.3.5 
+     python $baseDir/scripts/runDeepTools.py -i $deeptools_design_file -g ${params.genomepath}}
+"""
+}
 
 
 process run_diffbind {
@@ -67,35 +67,35 @@ process run_diffbind {
      Rscript $baseDir/scripts/runDiffBind.R $diffbind_design_file
 """
 }
-//
-//process run_chipseeker_diffpeak {
+
+process run_chipseeker_diffpeak {
+   publishDir "$baseDir/output", mode: 'copy'
+   input:
+     file diffpeak_design_file from diffpeaksdesign_chipseeker
+     file diffpeaks from diffpeaks_chipseeker
+   output:
+     stdout result
+   script:
+     """
+     module load python/2.7.x-anaconda
+     source activate /project/shared/bicf_workflow_ref/chipseq_bchen4/
+     Rscript $baseDir/scripts/runChipseeker.R $diffpeak_design_file hg19
+"""
+}
+
+process run_chipseeker_originalpeak {
 //   publishDir "$baseDir/output", mode: 'copy'
-//   input:
-//     file diffpeak_design_file from diffpeaksdesign_chipseeker
-//     file diffpeaks from diffpeaks_chipseeker
-//   output:
-//     stdout result
-//   script:
-//     """
-//     module load python/2.7.x-anaconda
-//     source activate /project/shared/bicf_workflow_ref/chipseq_bchen4/
-//     Rscript $baseDir/scripts/runChipseeker.R $diffpeak_design_file hg19
-//"""
-//}
-//
-//process run_chipseeker_originalpeak {
-////   publishDir "$baseDir/output", mode: 'copy'
-//   input:
-//     file design_file from chipseeker_design
-//   output:
-//     stdout result1
-//   script:
-//     """
-//     module load python/2.7.x-anaconda
-//     source activate /project/shared/bicf_workflow_ref/chipseq_bchen4/
-//     Rscript $baseDir/scripts/runChipseeker.R $design_file ${species}
-//"""
-//}
+   input:
+     file design_file from chipseeker_design
+   output:
+     stdout result1
+   script:
+     """
+     module load python/2.7.x-anaconda
+     source activate /project/shared/bicf_workflow_ref/chipseq_bchen4/
+     Rscript $baseDir/scripts/runChipseeker.R $design_file ${species}
+"""
+}
 
 process run_meme_original {
    publishDir "$baseDir/output", mode: 'copy'
diff --git a/workflow/scripts/runDiffBind.R b/workflow/scripts/runDiffBind.R
index 019ced9d1d787d6dd6bfa7c92f2731eb40a6c4ab..f4c7a6bc6bcc47e56b6a72ffde2109c362297d21 100644
--- a/workflow/scripts/runDiffBind.R
+++ b/workflow/scripts/runDiffBind.R
@@ -38,7 +38,7 @@ for (i in c(1:length(data$contrasts)))
  colnames(report)[1:5]<-c("chrom","peak_start","peak_stop","peak_width","peak_strand")
  #print(head(report))
  write.table(report,contrast_name,sep="\t",quote=F,row.names=F)
- write.table(report,contrast_bed_name,sep="\t",quote=F,row.names=F, col.names=F)
+ write.table(report[,c(1:3)],contrast_bed_name,sep="\t",quote=F,row.names=F, col.names=F)
 }
 #Write new design file
 newdesign = data.frame(SampleID=new_SampleID, Peaks=new_Peaks)
diff --git a/workflow/scripts/runMemechip.py b/workflow/scripts/runMemechip.py
index 1157cf1a8ab82938442efd8a331d92ed4f443816..0bc79d6c4d6d6ea7f64ba64b3ce9a0e58e3071a3 100644
--- a/workflow/scripts/runMemechip.py
+++ b/workflow/scripts/runMemechip.py
@@ -53,25 +53,33 @@ def run_wrapper(args):
 
 def run(infile, genome, limit, output):
   infile = pybedtools.BedTool(infile)
+  logging.debug(len(infile))
   genome = twobitreader.TwoBitFile(genome)
   outfile = open(output+".fa","w")
   rowcount = 0
   limit = int(limit)
+  logging.debug(limit)
   if limit ==-1:
     limit = len(infile)
   for record in infile:
-    rowcount += 1    
+    rowcount += 1   
+    #logging.debug(record) 
     if rowcount <=limit:
-     # logging.debug(rowcount)
+      #logging.debug(rowcount)
       try:
+        #logging.debug(record.chrom)
         seq = genome[record.chrom][record.start:record.stop]
       except:
         pass
       else:
         if record.strand == "-":
           seq = rc(seq)
-        newfa_name = record.name#"_".join(record.fields)
+        if len(record.fields)>=4:
+          newfa_name = record.name
+        else:
+          newfa_name = "_".join(record.fields)
         newfa = SeqRecord(Seq(seq),newfa_name,description="")
+        #logging.debug(seq)
         SeqIO.write(newfa,outfile,"fasta")
   outfile.close()
   #Call memechip