From dc02e51ef975dcda697acb50ce7ced7640a7e3db Mon Sep 17 00:00:00 2001 From: Rahul Pisupati Date: Wed, 27 Mar 2019 14:02:15 +0100 Subject: [PATCH] changed configs for easier use --- conf/mendel.config | 6 ++-- conf/snpcall.config | 68 +++++++++++++++++++++------------------------ main.nf | 11 ++++++++ 3 files changed, 46 insertions(+), 39 deletions(-) diff --git a/conf/mendel.config b/conf/mendel.config index 8e1c3bf..d4690c8 100644 --- a/conf/mendel.config +++ b/conf/mendel.config @@ -18,7 +18,7 @@ executor { } params { - max_memory = 250.GB - max_cpus = 24 - max_time = 2.d + max_memory = 180.GB + max_cpus = 12 + max_time = 24.h } diff --git a/conf/snpcall.config b/conf/snpcall.config index 459e665..6cced5b 100644 --- a/conf/snpcall.config +++ b/conf/snpcall.config @@ -12,75 +12,71 @@ process { - cpus = { check_max( 1 * task.attempt, 'cpus') } - memory = { check_max( 15.GB * task.attempt, 'memory') } - time = { check_max( 6.h * task.attempt, 'time') } - errorStrategy = { task.exitStatus in [143,137] ? 'retry' : 'terminate' } maxRetries = 3 maxErrors = '-1' - $makeBWAindex { + withLabel: env_picard_small { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 15.GB * task.attempt, 'memory') } + time = { check_max( 6.h * task.attempt, 'time') } module = ['BWA/0.7.15-foss-2016a', 'SAMtools/1.3.1-foss-2016a', 'picard/2.6.0-Java-1.8.0_131'] } - $extractFastq { - module = ['picard/2.6.0-Java-1.8.0_131', 'sratoolkit/2.8.1-3'] - } - - $fastqc { - module = ['FastQC/0.11.5-foss-2016a'] + withLabel: env_qual_small { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 15.GB * task.attempt, 'memory') } + time = { check_max( 6.h * task.attempt, 'time') } + module = ['picard/2.6.0-Java-1.8.0_131', 'sratoolkit/2.8.1-3', 'FastQC/0.11.5-foss-2016a'] errorStrategy = { task.exitStatus in [143,137] ? 'retry' : 'ignore' } } - $trim_galore { - module = ['Trim_Galore/0.4.1-foss-2016a'] + withLabel: env_picard_medium { cpus = { check_max( 2 * task.attempt, 'cpus') } memory = { check_max( 20.GB * task.attempt, 'memory') } - time = { check_max( 8.h * task.attempt, 'time') } + time = { check_max( 16.h * task.attempt, 'time') } + module = ['BWA/0.7.15-foss-2016a', 'SAMtools/1.3.1-foss-2016a', 'picard/2.6.0-Java-1.8.0_131'] + } + + withLabel: env_bwa_small { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 15.GB * task.attempt, 'memory') } + time = { check_max( 6.h * task.attempt, 'time') } + module = ['BWA/0.7.15-foss-2016a', 'SAMtools/1.3.1-foss-2016a', 'picard/2.6.0-Java-1.8.0_131'] } - $alignReads { - module = ['BWA/0.7.15-foss-2016a'] + withLabel: env_bwa_large { cpus = { check_max( 8 * task.attempt, 'cpus') } memory = { check_max( 80.GB * task.attempt, 'memory') } time = { check_max( 16.h * task.attempt, 'time') } + module = ['BWA/0.7.15-foss-2016a', 'SAMtools/1.3.1-foss-2016a', 'picard/2.6.0-Java-1.8.0_131'] } - $processBam { - module = ['SAMtools/1.3.1-intel-2016a'] + withLabel: env_trim { + module = ['Trim_Galore/0.4.1-foss-2016a'] cpus = { check_max( 2 * task.attempt, 'cpus') } memory = { check_max( 20.GB * task.attempt, 'memory') } - time = { check_max( 16.h * task.attempt, 'time') } - } - - $picardBam { - module = ['SAMtools/1.3.1-intel-2016a', 'picard/2.6.0-Java-1.8.0_131'] + time = { check_max( 8.h * task.attempt, 'time') } } - $realignBam { - module = ['GATK/3.5-Java-1.8.0_45', 'SAMtools/1.3.1-intel-2016a'] + withLabel: env_gatk_small { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 15.GB * task.attempt, 'memory') } + time = { check_max( 6.h * task.attempt, 'time') } + module = ['GATK/3.5-Java-1.8.0_45', 'SAMtools/1.3.1-intel-2016a', 'tabix/0.2.6-goolf-1.4.10'] } - $doSNPcall { - module = ['GATK/3.5-Java-1.8.0_45'] + withLabel: env_gatk_medium { cpus = { check_max( 4 * task.attempt, 'cpus') } memory = { check_max( 40.GB * task.attempt, 'memory') } time = { check_max( 16.h * task.attempt, 'time') } + module = ['GATK/3.5-Java-1.8.0_45'] } - $joinGVCFs { - module = ['GATK/3.5-Java-1.8.0_45'] + withLabel: env_gatk_large { cpus = { check_max( 8 * task.attempt, 'cpus') } memory = { check_max( 100.GB * task.attempt, 'memory') } time = { check_max( 16.h * task.attempt, 'time') } - } - - $getSamples { - module = ['tabix/0.2.6-goolf-1.4.10'] - } - - $selectSNPs { module = ['GATK/3.5-Java-1.8.0_45'] } diff --git a/main.nf b/main.nf index 90fe2a0..af59f0b 100644 --- a/main.nf +++ b/main.nf @@ -125,6 +125,7 @@ log.info "=========================================" if (build_index == true){ process makeBWAindex { publishDir "${reffol}", mode: 'copy' + label 'env_bwa_small' input: file genome @@ -157,6 +158,7 @@ if (params.file_ext == "fastq"){ process extractFastq { tag "$name" storeDir "${params.tmpdir}/rawreads" + label 'env_qual_small' input: set val(name), file(reads) from read_files_processing @@ -220,6 +222,7 @@ if(params.notrim){ } else { process trim_galore { tag "$name" + label 'env_trim' publishDir "${params.outdir}/trim_galore", mode: 'copy', saveAs: {filename -> if (filename.indexOf("_fastqc") > 0) "FastQC/$filename" @@ -261,6 +264,7 @@ if(params.notrim){ */ process alignReads { tag "$name" + label 'env_bwa_large' input: set val(name), file(reads) from trimmed_reads @@ -281,6 +285,7 @@ process alignReads { */ process processBam { tag "$name" + label 'env_picard_medium' input: set val(name), file(sam) from aligned_sam @@ -301,6 +306,7 @@ process processBam { */ process picardBam { tag "$name" + label 'env_picard_small' input: set val(name), file(bam) from sorted_bam @@ -323,6 +329,7 @@ process picardBam { process realignBam { tag "$name" publishDir "${params.outdir}/alignedBam", mode: 'copy' + label 'env_gatk_small' input: set val(name), file(bam) from modified_bam @@ -354,6 +361,7 @@ process realignBam { process doSNPcall { tag "$name" publishDir "${params.outdir}/gvcf", mode: 'copy' + label 'env_gatk_medium' input: set val(name), file(bam) from realigned_bam @@ -383,6 +391,7 @@ input_genotypegvcf_index = raw_gvcf_index.collect() process joinGVCFs { publishDir "$params.outdir", mode: 'copy' + label 'env_gatk_large' input: file in_vcf from input_genotypegvcf @@ -410,6 +419,7 @@ process joinGVCFs { */ process getSamples { tag "joinGVCF" + label 'env_gatk_small' input: file gvcf from combgVCF_name @@ -432,6 +442,7 @@ input_names = sample_names process selectSNPs { tag "$name" publishDir "${params.outdir}/vcf", mode: 'copy' + label 'env_gatk_small' input: val name from input_names