From 7fa6b2d41b43b79a74d640a1544054c0b0d8ab6b Mon Sep 17 00:00:00 2001
From: Laurent Modolo <laurent@modolo.fr>
Date: Wed, 20 Mar 2019 17:24:47 +0100
Subject: [PATCH] fix training_dataset pipeline

---
 src/nf_modules/bedtools/fasta_from_bed.config |   1 +
 src/training_dataset.config                   | 212 +++++++++++++-----
 2 files changed, 158 insertions(+), 55 deletions(-)

diff --git a/src/nf_modules/bedtools/fasta_from_bed.config b/src/nf_modules/bedtools/fasta_from_bed.config
index 0a70980b..1e1aad47 100644
--- a/src/nf_modules/bedtools/fasta_from_bed.config
+++ b/src/nf_modules/bedtools/fasta_from_bed.config
@@ -25,6 +25,7 @@ profiles {
         module = "bedtools/2.25.0"
         executor = "sge"
         clusterOptions = "-m e -cwd -V"
+        cpus = 1
         memory = "20GB"
         time = "12h"
         queue = 'monointeldeb128'
diff --git a/src/training_dataset.config b/src/training_dataset.config
index b416751d..baebb4cf 100644
--- a/src/training_dataset.config
+++ b/src/training_dataset.config
@@ -3,135 +3,237 @@ profiles {
     docker.temp = 'auto'
     docker.enabled = true
     process {
-      withname: build_synthetic_bed {
+      withName: build_synthetic_bed {
         container = "bedtools:2.25.0"
+        cpus = 1
       }
-      withname: fasta_from_bed {
+      withName: fasta_from_bed {
         container = "bedtools:2.25.0"
+        cpus = 1
       }
-      withname: index_fasta {
+      withName: index_fasta {
         container = "bowtie2:2.3.4.1"
+        cpus = 4
       }
-      withname: mapping_fastq_paired {
+      withName: mapping_fastq_paired {
         container = "bowtie2:2.3.4.1"
+        cpus = 4
       }
-      withname: bam_2_fastq_paired {
+      withName: bam_2_fastq_paired {
         container = "samtools:1.7"
+        cpus = 4
       }
-      withname: sort_bam_paired {
+      withName: filter_bam_paired {
         container = "samtools:1.7"
+        cpus = 4
       }
-      withname: index_bam_paired {
+      withName: sort_bam_paired {
         container = "samtools:1.7"
+        cpus = 4
       }
-      withname: mapping_fastq_single {
+      withName: index_bam_paired {
+        container = "samtools:1.7"
+        cpus = 4
+      }
+      withName: mapping_fastq_single {
         container = "bowtie2:2.3.4.1"
+        cpus = 4
       }
-      withname: bam_2_fastq_single {
+      withName: bam_2_fastq_single {
         container = "samtools:1.7"
+        cpus = 4
       }
-      withname: sort_bam_single {
+      withName: filter_bam_single {
         container = "samtools:1.7"
+        cpus = 4
       }
-      withname: index_bam_single {
+      withName: sort_bam_single {
         container = "samtools:1.7"
+        cpus = 4
+      }
+      withName: index_bam_single {
+        container = "samtools:1.7"
+        cpus = 4
+      }
+    }
+  }
+  singularity {
+    singularity.enabled = true
+    process {
+      withName: build_synthetic_bed {
+        container = "file://bin/bedtools:2.25.0.sif"
+        cpus = 1
+      }
+      withName: fasta_from_bed {
+        container = "file://bin/bedtools:2.25.0.sif"
+        cpus = 1
+      }
+      withName: index_fasta {
+        container = "file://bin/bowtie2:2.3.4.1.sif"
+        cpus = 4
+      }
+      withName: mapping_fastq_single {
+        container = "file://bin/bowtie2:2.3.4.1.sif"
+        cpus = 4
+      }
+      withName: mapping_fastq_paired {
+        container = "file://bin/bowtie2:2.3.4.1.sif"
+        cpus = 4
+      }
+      withName: bam_2_fastq_paired {
+        container = "file://bin/samtools:1.7.sif"
+        cpus = 4
+      }
+      withName: filter_bam_paired {
+        container = "file://bin/samtools:1.7.sif"
+        cpus = 4
+      }
+      withName: sort_bam_paired {
+        container = "file://bin/samtools:1.7.sif"
+        cpus = 4
+      }
+      withName: index_bam_paired {
+        container = "file://bin/samtools:1.7.sif"
+        cpus = 4
+      }
+      withName: bam_2_fastq_single {
+        container = "file://bin/samtools:1.7.sif"
+        cpus = 4
+      }
+      withName: filter_bam_single {
+        container = "file://bin/samtools:1.7.sif"
+        cpus = 4
+      }
+      withName: sort_bam_single {
+        container = "file://bin/samtools:1.7.sif"
+        cpus = 4
+      }
+      withName: index_bam_single {
+        container = "file://bin/samtools:1.7.sif"
+        cpus = 4
       }
     }
   }
   psmn {
     process{
-      withname: build_synthetic_bed {
+      withName: build_synthetic_bed {
         beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
-        module = "BEDtools/2.25.0"
+        module = "bedtools/2.25.0"
         executor = "sge"
-        clusterOptions = "-m be -cwd -V"
+        clusterOptions = "-m e -cwd -V"
+        cpus = 1
         memory = "20GB"
         time = "12h"
         queue = 'monointeldeb128'
       }
-      withname: fasta_from_bed {
+      withName: fasta_from_bed {
         beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
-        module = "BEDtools/2.25.0"
+        module = "bedtools/2.25.0"
         executor = "sge"
-        clusterOptions = "-m be -cwd -V"
+        clusterOptions = "-m e -cwd -V"
+        cpus = 1
         memory = "20GB"
         time = "12h"
         queue = 'monointeldeb128'
       }
-      withname: index_fasta {
+      withName: index_fasta {
         beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
-        module = "Bowtie2/2.3.4.1"
+        module = "bowtie2/2.3.4.1"
         executor = "sge"
-        memory = "30GB"
-        time = "24h"
+        clusterOptions = "-m e -cwd -V"
+        cpus = 16
+        memory = "20GB"
+        time = "12h"
         queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F'
         penv = 'openmp16'
       }
-      withname: mapping_fastq_paired {
+      withName: mapping_fastq_paired {
         beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
-        module = "Bowtie2/2.3.4.1:SAMtools/1.7"
+        module = "bowtie2/2.3.4.1:samtools/1.7"
         executor = "sge"
+        clusterOptions = "-m e -cwd -V"
+        cpus = 16
         memory = "30GB"
         time = "24h"
         queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F'
         penv = 'openmp16'
       }
-      withname: bam_2_fastq_paired {
+      withName: bam_2_fastq_paired {
         beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
-        module = "SAMtools/1.7"
+        module = "samtools/1.7"
         executor = "sge"
-        memory = "20GB"
-        time = "12h"
-        queue = 'monointeldeb128'
+        clusterOptions = "-m e -cwd -V"
+        cpus = 16
+        memory = "30GB"
+        time = "24h"
+        queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F'
+        penv = 'openmp16'
       }
-      withname: sort_bam_paired {
+      withName: sort_bam_paired {
         beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
-        module = "SAMtools/1.7"
+        module = "samtools/1.7"
         executor = "sge"
-        memory = "20GB"
-        time = "12h"
-        queue = 'monointeldeb128'
+        clusterOptions = "-m e -cwd -V"
+        cpus = 16
+        memory = "30GB"
+        time = "24h"
+        queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F'
+        penv = 'openmp16'
       }
-      withname: index_bam_paired {
+      withName: index_bam_paired {
         beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
-        module = "SAMtools/1.7"
+        module = "samtools/1.7"
         executor = "sge"
-        memory = "20GB"
-        time = "12h"
-        queue = 'monointeldeb128'
+        clusterOptions = "-m e -cwd -V"
+        cpus = 16
+        memory = "30GB"
+        time = "24h"
+        queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F'
+        penv = 'openmp16'
       }
-      withname: mapping_fastq_single {
+      withName: mapping_fastq_single {
         beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
-        module = "Bowtie2/2.3.4.1:SAMtools/1.7"
+        module = "bowtie2/2.3.4.1:samtools/1.7"
         executor = "sge"
+        clusterOptions = "-m e -cwd -V"
+        cpus = 16
         memory = "30GB"
         time = "24h"
         queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F'
         penv = 'openmp16'
       }
-      withname: bam_2_fastq_single {
+      withName: bam_2_fastq_single {
         beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
-        module = "SAMtools/1.7"
+        module = "samtools/1.7"
         executor = "sge"
-        memory = "20GB"
-        time = "12h"
-        queue = 'monointeldeb128'
+        clusterOptions = "-m e -cwd -V"
+        cpus = 16
+        memory = "30GB"
+        time = "24h"
+        queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F'
+        penv = 'openmp16'
       }
-      withname: sort_bam_single {
+      withName: sort_bam_single {
         beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
-        module = "SAMtools/1.7"
+        module = "samtools/1.7"
         executor = "sge"
-        memory = "20GB"
-        time = "12h"
-        queue = 'monointeldeb128'
+        clusterOptions = "-m e -cwd -V"
+        cpus = 16
+        memory = "30GB"
+        time = "24h"
+        queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F'
+        penv = 'openmp16'
       }
-      withname: index_bam_single {
+      withName: index_bam_single {
         beforeScript = "source /usr/share/lmod/lmod/init/bash; module use ~/privatemodules"
-        module = "SAMtools/1.7"
+        module = "samtools/1.7"
         executor = "sge"
-        memory = "20GB"
-        time = "12h"
-        queue = 'monointeldeb128'
+        clusterOptions = "-m e -cwd -V"
+        cpus = 16
+        memory = "30GB"
+        time = "24h"
+        queue = 'E5-2670deb128A,E5-2670deb128B,E5-2670deb128C,E5-2670deb128D,E5-2670deb128E,E5-2670deb128F'
+        penv = 'openmp16'
       }
     }
   }
-- 
GitLab