Skip to content

Commit

Permalink
Merge pull request #145 from TORCH-Consortium/abhinav/use-labels-with…
Browse files Browse the repository at this point in the history
…-numbers

Refactor labels to use the intuitive numbers
  • Loading branch information
abhi18av authored Mar 29, 2023
2 parents 3ce641b + f5fa816 commit 786d13d
Show file tree
Hide file tree
Showing 18 changed files with 37 additions and 28 deletions.
5 changes: 5 additions & 0 deletions conf/docker.config
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ process {
}

}


docker {
enabled = true
}
2 changes: 1 addition & 1 deletion modules/bgzip/bgzip.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process BGZIP {
tag "${name}"
label 'cpu_low_memory_low'
label 'cpu_2_memory_2'
publishDir params.results_dir, mode: params.save_mode, enabled: params.should_publish

input:
Expand Down
2 changes: 1 addition & 1 deletion modules/bwa/mem.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process BWA_MEM {
tag "${sampleName}"
label 'cpu_high_memory_high'
label 'cpu_8_memory_8'
publishDir params.results_dir, mode: params.save_mode, enabled: params.should_publish

input:
Expand Down
2 changes: 1 addition & 1 deletion modules/fastqc/fastqc.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process FASTQC {
tag "${sampleName}"
label 'cpu_low_memory_low'
label 'cpu_2_memory_2'
publishDir params.results_dir, mode: params.save_mode, enabled: params.should_publish

input:
Expand Down
2 changes: 1 addition & 1 deletion modules/gatk/apply_bqsr.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process GATK_APPLY_BQSR {
tag "$sampleName"
label 'cpu_low_memory_low'
label 'cpu_2_memory_2'
publishDir params.results_dir, mode: params.save_mode, enabled: params.should_publish

input:
Expand Down
2 changes: 1 addition & 1 deletion modules/gatk/base_recalibrator.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process GATK_BASE_RECALIBRATOR {
tag "$sampleName"
label 'cpu_low_memory_low'
label 'cpu_2_memory_2'

publishDir params.results_dir, mode: params.save_mode, enabled: params.should_publish

Expand Down
2 changes: 1 addition & 1 deletion modules/gatk/collect_wgs_metrics.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process GATK_COLLECT_WGS_METRICS {
tag "${sampleName}"
label 'cpu_low_memory_low'
label 'cpu_2_memory_2'
publishDir params.results_dir, mode: params.save_mode, enabled: params.should_publish

input:
Expand Down
2 changes: 1 addition & 1 deletion modules/gatk/flag_stat.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process GATK_FLAG_STAT {
tag "${sampleName}"
label 'cpu_low_memory_low'
label 'cpu_2_memory_2'
publishDir params.results_dir, mode: params.save_mode, enabled: params.should_publish

input:
Expand Down
2 changes: 1 addition & 1 deletion modules/gatk/haplotype_caller.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process GATK_HAPLOTYPE_CALLER {
tag "$sampleName"
label 'cpu_medium_memory_medium'
label 'cpu_8_memory_8'
publishDir params.results_dir, mode: params.save_mode, enabled: params.should_publish


Expand Down
2 changes: 1 addition & 1 deletion modules/gatk/haplotype_caller__minor_variants.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process GATK_HAPLOTYPE_CALLER__MINOR_VARIANTS {
tag "$sampleName"
label 'cpu_medium_memory_medium'
label 'cpu_4_memory_8'
publishDir params.results_dir, mode: params.save_mode, enabled: params.should_publish


Expand Down
2 changes: 1 addition & 1 deletion modules/gatk/mark_duplicates.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process GATK_MARK_DUPLICATES {
tag "$sampleName"
label 'cpu_low_memory_high'
label 'cpu_4_memory_8'
publishDir params.results_dir, mode: params.save_mode, enabled: params.should_publish

input:
Expand Down
2 changes: 1 addition & 1 deletion modules/lofreq/call.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process LOFREQ_CALL {
tag "${sampleName}"
label 'cpu_high_memory_medium'
label 'cpu_8_memory_4'
publishDir params.results_dir, mode: params.save_mode, enabled: params.should_publish

input:
Expand Down
2 changes: 1 addition & 1 deletion modules/lofreq/indelqual.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process LOFREQ_INDELQUAL {
tag "${sampleName}"
label 'cpu_low_memory_low'
label 'cpu_2_memory_2'
publishDir params.results_dir, mode: params.save_mode, enabled: params.should_publish

input:
Expand Down
2 changes: 1 addition & 1 deletion modules/multiqc/multiqc.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process MULTIQC {
publishDir params.results_dir, mode: params.save_mode, enabled: params.should_publish
label 'cpu_low_memory_high'
label 'cpu_4_memory_16'

input:
path("*")
Expand Down
2 changes: 1 addition & 1 deletion modules/samtools/index.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process SAMTOOLS_INDEX {
tag "${sampleName}"
label 'cpu_low_memory_low'
label 'cpu_2_memory_2'
publishDir params.results_dir, mode: params.save_mode, enabled: params.should_publish

input:
Expand Down
1 change: 0 additions & 1 deletion modules/samtools/merge.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
process SAMTOOLS_MERGE {
tag "${sampleName}"
label 'cpu_medium_memory_medium'
publishDir params.results_dir, mode: params.save_mode, enabled: params.should_publish

input:
Expand Down
2 changes: 1 addition & 1 deletion modules/samtools/stats.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process SAMTOOLS_STATS {
tag "${sampleName}"
label 'cpu_low_memory_low'
label 'cpu_2_memory_2'
publishDir params.results_dir, mode: params.save_mode, enabled: params.should_publish

input:
Expand Down
29 changes: 17 additions & 12 deletions nextflow.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
manifest {
name = 'MAGMA'
description = 'MAGMA is a pipeline for comprehensive genomic analyses of Mycobacterium tuberculosis with a focus on clinical decision making as well as research.'
version = '1.0.0'
version = '1.0.1'
author = 'TORCH-Consortium'
defaultBranch = 'master'
homePage = 'https://github.com/TORCH-Consortium/MAGMA'
Expand All @@ -11,34 +11,39 @@ params { includeConfig 'default_params.config' }

process {

//Default values if a label hasn't been specified within a process
cpus = 4
memory = 4.GB

withLabel: 'cpu_low_memory_low' {
//Default action is to ignore the process if the second attempt fails
errorStrategy = { task.attempt < 3 ? 'retry' : 'ignore' }

//NOTE: These labels are ordered by number of cpus allocated and then the memory
withLabel: 'cpu_2_memory_2' {
cpus = 2
memory = 2.GB
}

withLabel: 'cpu_low_memory_high' {
cpus = 2
memory = 16.GB
withLabel: 'cpu_4_memory_8' {
cpus = 4
memory = 8.GB
}

withLabel: 'cpu_medium_memory_medium' {
withLabel: 'cpu_4_memory_16' {
cpus = 4
memory = 16.GB
}

withLabel: 'cpu_8_memory_4' {
cpus = 8
memory = 4.GB
}

withLabel: 'cpu_high_memory_high' {
withLabel: 'cpu_8_memory_8' {
cpus = 8
memory = 8.GB
}

withLabel: 'cpu_high_memory_medium' {
cpus = 8
memory = 4.GB
}

withName: 'SAMPLESHEET_VALIDATION' {
//NOTE: If this process fails, terminate the pipeline execution
errorStrategy = 'terminate'
Expand Down

0 comments on commit 786d13d

Please sign in to comment.