From 60b598f9330afb4e8b40446db38f6bb76e2db655 Mon Sep 17 00:00:00 2001 From: hoelzer Date: Thu, 8 Aug 2024 14:35:24 +0200 Subject: [PATCH 01/13] add error handling --- configs/node.config | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/configs/node.config b/configs/node.config index f1bdb73..24c5a45 100644 --- a/configs/node.config +++ b/configs/node.config @@ -1,11 +1,11 @@ process { - withLabel: minimap2 { cpus = 24; memory = 24.GB } - withLabel: bbmap { cpus = 24; memory = 24.GB } - withLabel: smallTask { cpus = 1; memory = 2.GB } - withLabel: pysam { cpus = 2; memory = 4.GB } - withLabel: fastqc { cpus = {2 * task.attempt}; memory = {4.GB * task.attempt } ; maxRetries = 3 ; errorStrategy = { task.exitStatus in 130..140 ? 'retry' : 'terminate' } } - withLabel: multiqc { cpus = 4; memory = 4.GB } - withLabel: nanoplot{ cpus = 8; memory = 8.GB } - withLabel: quast{ cpus = 8; memory = 8.GB } + withLabel: minimap2 { cpus = {24 * task.attempt}; memory = {24.GB * task.attempt}; maxRetries = 3 ; errorStrategy = { task.exitStatus in 1 ? 'retry' : 'terminate' }; } + withLabel: bbmap { cpus = {24 * task.attempt}; memory = {24.GB * task.attempt}; maxRetries = 3 ; errorStrategy = { task.exitStatus in 1 ? 'retry' : 'terminate' }; } + withLabel: smallTask { cpus = 1; memory = 2.GB } + withLabel: pysam { cpus = 2; memory = 4.GB } + withLabel: fastqc { cpus = {2 * task.attempt}; memory = {4.GB * task.attempt } ; maxRetries = 3 ; errorStrategy = { task.exitStatus in 130..140 ? 'retry' : 'terminate' }; } + withLabel: multiqc { cpus = 4; memory = 4.GB } + withLabel: nanoplot { cpus = 8; memory = 8.GB } + withLabel: quast { cpus = 8; memory = 8.GB } } From 24d6493bf4090313745de62bfa07b1297ae2d6f6 Mon Sep 17 00:00:00 2001 From: hoelzer Date: Mon, 12 Aug 2024 16:41:35 +0200 Subject: [PATCH 02/13] increase RAM further if fails --- configs/node.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/node.config b/configs/node.config index 24c5a45..d207d91 100644 --- a/configs/node.config +++ b/configs/node.config @@ -1,6 +1,6 @@ process { - withLabel: minimap2 { cpus = {24 * task.attempt}; memory = {24.GB * task.attempt}; maxRetries = 3 ; errorStrategy = { task.exitStatus in 1 ? 'retry' : 'terminate' }; } - withLabel: bbmap { cpus = {24 * task.attempt}; memory = {24.GB * task.attempt}; maxRetries = 3 ; errorStrategy = { task.exitStatus in 1 ? 'retry' : 'terminate' }; } + withLabel: minimap2 { cpus = {24 * task.attempt}; memory = {24.GB * task.attempt}; maxRetries = 4 ; errorStrategy = { task.exitStatus in 1 ? 'retry' : 'terminate' }; } + withLabel: bbmap { cpus = {24 * task.attempt}; memory = {24.GB * task.attempt}; maxRetries = 4 ; errorStrategy = { task.exitStatus in 1 ? 'retry' : 'terminate' }; } withLabel: smallTask { cpus = 1; memory = 2.GB } withLabel: pysam { cpus = 2; memory = 4.GB } withLabel: fastqc { cpus = {2 * task.attempt}; memory = {4.GB * task.attempt } ; maxRetries = 3 ; errorStrategy = { task.exitStatus in 130..140 ? 'retry' : 'terminate' }; } From 78f15e116836ed9921a8b51ad2d4eba390811f9c Mon Sep 17 00:00:00 2001 From: hoelzer Date: Tue, 13 Aug 2024 10:47:55 +0200 Subject: [PATCH 03/13] incr ram further when err --- configs/node.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/node.config b/configs/node.config index d207d91..556a4ce 100644 --- a/configs/node.config +++ b/configs/node.config @@ -1,6 +1,6 @@ process { withLabel: minimap2 { cpus = {24 * task.attempt}; memory = {24.GB * task.attempt}; maxRetries = 4 ; errorStrategy = { task.exitStatus in 1 ? 'retry' : 'terminate' }; } - withLabel: bbmap { cpus = {24 * task.attempt}; memory = {24.GB * task.attempt}; maxRetries = 4 ; errorStrategy = { task.exitStatus in 1 ? 'retry' : 'terminate' }; } + withLabel: bbmap { cpus = {24 * task.attempt}; memory = {24.GB * task.attempt}; maxRetries = 4 ; errorStrategy = { task.exitStatus in 1 || 137 ? 'retry' : 'terminate' }; } withLabel: smallTask { cpus = 1; memory = 2.GB } withLabel: pysam { cpus = 2; memory = 4.GB } withLabel: fastqc { cpus = {2 * task.attempt}; memory = {4.GB * task.attempt } ; maxRetries = 3 ; errorStrategy = { task.exitStatus in 130..140 ? 'retry' : 'terminate' }; } From a21402b4e1d5b3eec244f69fa06395b06ef9aee6 Mon Sep 17 00:00:00 2001 From: hoelzer Date: Tue, 13 Aug 2024 11:21:14 +0200 Subject: [PATCH 04/13] incr ram further when err --- configs/node.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/node.config b/configs/node.config index 556a4ce..799869a 100644 --- a/configs/node.config +++ b/configs/node.config @@ -1,6 +1,6 @@ process { withLabel: minimap2 { cpus = {24 * task.attempt}; memory = {24.GB * task.attempt}; maxRetries = 4 ; errorStrategy = { task.exitStatus in 1 ? 'retry' : 'terminate' }; } - withLabel: bbmap { cpus = {24 * task.attempt}; memory = {24.GB * task.attempt}; maxRetries = 4 ; errorStrategy = { task.exitStatus in 1 || 137 ? 'retry' : 'terminate' }; } + withLabel: bbmap { cpus = {24 * task.attempt}; memory = {12.GB * task.attempt}; maxRetries = 5 ; errorStrategy = { task.exitStatus in 1 || 137 ? 'retry' : 'terminate' }; } withLabel: smallTask { cpus = 1; memory = 2.GB } withLabel: pysam { cpus = 2; memory = 4.GB } withLabel: fastqc { cpus = {2 * task.attempt}; memory = {4.GB * task.attempt } ; maxRetries = 3 ; errorStrategy = { task.exitStatus in 130..140 ? 'retry' : 'terminate' }; } From db5366d79c6e8f904913ef8a75e9940f59df2eb1 Mon Sep 17 00:00:00 2001 From: hoelzer Date: Tue, 13 Aug 2024 11:48:50 +0200 Subject: [PATCH 05/13] incr ram further when err --- configs/node.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/node.config b/configs/node.config index 799869a..fca5709 100644 --- a/configs/node.config +++ b/configs/node.config @@ -1,6 +1,6 @@ process { withLabel: minimap2 { cpus = {24 * task.attempt}; memory = {24.GB * task.attempt}; maxRetries = 4 ; errorStrategy = { task.exitStatus in 1 ? 'retry' : 'terminate' }; } - withLabel: bbmap { cpus = {24 * task.attempt}; memory = {12.GB * task.attempt}; maxRetries = 5 ; errorStrategy = { task.exitStatus in 1 || 137 ? 'retry' : 'terminate' }; } + withLabel: bbmap { cpus = {250 * task.attempt}; memory = {24.GB * task.attempt}; maxRetries = 5 ; errorStrategy = { task.exitStatus in 1 || 137 ? 'retry' : 'terminate' }; } withLabel: smallTask { cpus = 1; memory = 2.GB } withLabel: pysam { cpus = 2; memory = 4.GB } withLabel: fastqc { cpus = {2 * task.attempt}; memory = {4.GB * task.attempt } ; maxRetries = 3 ; errorStrategy = { task.exitStatus in 130..140 ? 'retry' : 'terminate' }; } From fc43bc526f8fa28e0b7196d15ea493072f1cb710 Mon Sep 17 00:00:00 2001 From: hoelzer Date: Tue, 13 Aug 2024 11:49:57 +0200 Subject: [PATCH 06/13] incr ram further when err --- configs/node.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/node.config b/configs/node.config index fca5709..52b8b7b 100644 --- a/configs/node.config +++ b/configs/node.config @@ -1,6 +1,6 @@ process { withLabel: minimap2 { cpus = {24 * task.attempt}; memory = {24.GB * task.attempt}; maxRetries = 4 ; errorStrategy = { task.exitStatus in 1 ? 'retry' : 'terminate' }; } - withLabel: bbmap { cpus = {250 * task.attempt}; memory = {24.GB * task.attempt}; maxRetries = 5 ; errorStrategy = { task.exitStatus in 1 || 137 ? 'retry' : 'terminate' }; } + withLabel: bbmap { cpus = {24 * task.attempt}; memory = {240.GB * task.attempt}; maxRetries = 5 ; errorStrategy = { task.exitStatus in 1 || 137 ? 'retry' : 'terminate' }; } withLabel: smallTask { cpus = 1; memory = 2.GB } withLabel: pysam { cpus = 2; memory = 4.GB } withLabel: fastqc { cpus = {2 * task.attempt}; memory = {4.GB * task.attempt } ; maxRetries = 3 ; errorStrategy = { task.exitStatus in 130..140 ? 'retry' : 'terminate' }; } From ed1b37e4f1cd1aee94cc081254def25d20dec7b1 Mon Sep 17 00:00:00 2001 From: hoelzer Date: Tue, 13 Aug 2024 12:56:47 +0200 Subject: [PATCH 07/13] incr ram further when err --- configs/node.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/node.config b/configs/node.config index 52b8b7b..2c718bc 100644 --- a/configs/node.config +++ b/configs/node.config @@ -1,6 +1,6 @@ process { - withLabel: minimap2 { cpus = {24 * task.attempt}; memory = {24.GB * task.attempt}; maxRetries = 4 ; errorStrategy = { task.exitStatus in 1 ? 'retry' : 'terminate' }; } - withLabel: bbmap { cpus = {24 * task.attempt}; memory = {240.GB * task.attempt}; maxRetries = 5 ; errorStrategy = { task.exitStatus in 1 || 137 ? 'retry' : 'terminate' }; } + withLabel: minimap2 { cpus = {24 * task.attempt}; memory = {24.GB * task.attempt}; maxRetries = 4 ; errorStrategy = { task.exitStatus in 1 || 130..140 ? 'retry' : 'terminate' }; } + withLabel: bbmap { cpus = {24 * task.attempt}; memory = {24.GB * task.attempt}; maxRetries = 6 ; errorStrategy = { task.exitStatus in 1 || 130..140 ? 'retry' : 'terminate' }; } withLabel: smallTask { cpus = 1; memory = 2.GB } withLabel: pysam { cpus = 2; memory = 4.GB } withLabel: fastqc { cpus = {2 * task.attempt}; memory = {4.GB * task.attempt } ; maxRetries = 3 ; errorStrategy = { task.exitStatus in 130..140 ? 'retry' : 'terminate' }; } From b534001266643b4302ad30edab8e9874fa4bf896 Mon Sep 17 00:00:00 2001 From: "Lataretu, Marie" Date: Mon, 19 Aug 2024 17:22:48 +0200 Subject: [PATCH 08/13] added bwa as mapping option relates to Replace minimap2 with another mapper for short-read data? #102 --- CHANGELOG.md | 6 +++++ clean.nf | 2 +- configs/container.config | 19 +++++++------- configs/node.config | 15 ++++++----- envs/bwa.yaml | 8 ++++++ modules/bwa.nf | 56 ++++++++++++++++++++++++++++++++++++++++ nextflow.config | 1 + workflows/clean_wf.nf | 15 ++++++++--- 8 files changed, 101 insertions(+), 21 deletions(-) create mode 100644 envs/bwa.yaml create mode 100644 modules/bwa.nf diff --git a/CHANGELOG.md b/CHANGELOG.md index bfdb9a8..8a41ccd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## unreleased + +### Added + +- `bwa mem` as short-read mapper alternative, parameter: `--bwa` + ## [v1.0.2] - 2024-05-17 ### Added diff --git a/clean.nf b/clean.nf index 395b29e..5c37b2f 100755 --- a/clean.nf +++ b/clean.nf @@ -10,7 +10,7 @@ Author: hoelzer.martin@gmail.com // Parameters sanity checking -Set valid_params = ['max_cores', 'cores', 'max_memory', 'memory', 'profile', 'help', 'input', 'input_type', 'list', 'host', 'own', 'control', 'keep', 'rm_rrna', 'bbduk', 'bbduk_kmer', 'bbduk_qin', 'reads_rna', 'min_clip', 'dcs_strict', 'output', 'multiqc_dir', 'nf_runinfo_dir', 'databases', 'cleanup_work_dir','condaCacheDir', 'singularityCacheDir', 'singularityCacheDir', 'cloudProcess', 'conda-cache-dir', 'singularity-cache-dir', 'cloud-process', 'publish_dir_mode', 'no_intermediate', 'skip_qc'] // don't ask me why there is also 'conda-cache-dir', 'singularity-cache-dir', 'cloud-process' +Set valid_params = ['max_cores', 'cores', 'max_memory', 'memory', 'profile', 'help', 'input', 'input_type', 'list', 'host', 'own', 'control', 'keep', 'rm_rrna', 'bwa', 'bbduk', 'bbduk_kmer', 'bbduk_qin', 'reads_rna', 'min_clip', 'dcs_strict', 'output', 'multiqc_dir', 'nf_runinfo_dir', 'databases', 'cleanup_work_dir','condaCacheDir', 'singularityCacheDir', 'singularityCacheDir', 'cloudProcess', 'conda-cache-dir', 'singularity-cache-dir', 'cloud-process', 'publish_dir_mode', 'no_intermediate', 'skip_qc'] // don't ask me why there is also 'conda-cache-dir', 'singularity-cache-dir', 'cloud-process' def parameter_diff = params.keySet() - valid_params if (parameter_diff.size() != 0){ exit 1, "ERROR: Parameter(s) $parameter_diff is/are not valid in the pipeline!\n" diff --git a/configs/container.config b/configs/container.config index f713429..ccc6263 100644 --- a/configs/container.config +++ b/configs/container.config @@ -1,11 +1,12 @@ process { - withLabel: smallTask { container = 'nanozoo/samtools:1.14--d8fb865' } - withLabel: minimap2 { container = 'nanozoo/minimap2:2.26--d9ef6b6' } - withLabel: bbmap { container = 'nanozoo/bbmap:38.79--8e915d7' } - withLabel: multiqc { container = 'nanozoo/multiqc:1.9--aba729b' } - withLabel: fastqc { container = 'nanozoo/fastqc:0.11.9--f61b8b4' } - withLabel: nanoplot { container = 'nanozoo/nanoplot:1.32.0--1ae6f5d' } - withLabel: quast { container = 'nanozoo/quast:5.0.2--e7f0cfe' } - withLabel: bed_samtools { container = 'nanozoo/bed_samtools:2.30.0--cc7d1b9' } - withLabel: seqkit { container = 'nanozoo/seqkit:2.6.1--022e008' } + withLabel: smallTask { container = 'nanozoo/samtools:1.14--d8fb865' } + withLabel: minimap2 { container = 'nanozoo/minimap2:2.26--d9ef6b6' } + withLabel: bwa { container = 'nanozoo/bwa:0.7.17--5d3a7e3' } + withLabel: bbmap { container = 'nanozoo/bbmap:38.79--8e915d7' } + withLabel: multiqc { container = 'nanozoo/multiqc:1.9--aba729b' } + withLabel: fastqc { container = 'nanozoo/fastqc:0.11.9--f61b8b4' } + withLabel: nanoplot { container = 'nanozoo/nanoplot:1.32.0--1ae6f5d' } + withLabel: quast { container = 'nanozoo/quast:5.0.2--e7f0cfe' } + withLabel: bed_samtools { container = 'nanozoo/bed_samtools:2.30.0--cc7d1b9' } + withLabel: seqkit { container = 'nanozoo/seqkit:2.6.1--022e008' } } diff --git a/configs/node.config b/configs/node.config index f1bdb73..97271ab 100644 --- a/configs/node.config +++ b/configs/node.config @@ -1,11 +1,12 @@ process { - withLabel: minimap2 { cpus = 24; memory = 24.GB } - withLabel: bbmap { cpus = 24; memory = 24.GB } + withLabel: minimap2 { cpus = 24; memory = 24.GB } + withLabel: bwa { cpus = 24; memory = 24.GB } + withLabel: bbmap { cpus = 24; memory = 24.GB } withLabel: smallTask { cpus = 1; memory = 2.GB } - withLabel: pysam { cpus = 2; memory = 4.GB } - withLabel: fastqc { cpus = {2 * task.attempt}; memory = {4.GB * task.attempt } ; maxRetries = 3 ; errorStrategy = { task.exitStatus in 130..140 ? 'retry' : 'terminate' } } - withLabel: multiqc { cpus = 4; memory = 4.GB } - withLabel: nanoplot{ cpus = 8; memory = 8.GB } - withLabel: quast{ cpus = 8; memory = 8.GB } + withLabel: pysam { cpus = 2; memory = 4.GB } + withLabel: fastqc { cpus = {2 * task.attempt}; memory = {4.GB * task.attempt } ; maxRetries = 3 ; errorStrategy = { task.exitStatus in 130..140 ? 'retry' : 'terminate' } } + withLabel: multiqc { cpus = 4; memory = 4.GB } + withLabel: nanoplot { cpus = 8; memory = 8.GB } + withLabel: quast { cpus = 8; memory = 8.GB } } diff --git a/envs/bwa.yaml b/envs/bwa.yaml new file mode 100644 index 0000000..b443d6f --- /dev/null +++ b/envs/bwa.yaml @@ -0,0 +1,8 @@ +name: bwa +channels: + - bioconda + - conda-forge +dependencies: + - bwa=0.7.18 + - samtools=1.20 + - htslib=1.20 \ No newline at end of file diff --git a/modules/bwa.nf b/modules/bwa.nf new file mode 100644 index 0000000..f5a32ed --- /dev/null +++ b/modules/bwa.nf @@ -0,0 +1,56 @@ +process bwa_index { + label 'bwa' + + input: + path(fasta) + + output: + path(bwa) , emit: index + + script: + """ + mkdir bwa + bwa \\ + index \\ + -p bwa/db \\ + $fasta + """ + + stub: + """ + mkdir bwa + + touch bwa/db.amb + touch bwa/db.ann + touch bwa/db.bwt + touch bwa/db.pac + touch bwa/db.sa + """ +} + +process bwa { + label 'bwa' + + input: + tuple val(name), path(input) + path(db_index) + path(db) + + + output: + tuple val(name), val('raw'), path("${name}.bam"), emit: bam // input just for naming + + script: + """ + INDEX=`find -L ./ -name "*.amb" | sed 's/\\.amb\$//'` + bwa mem \\ + -t $task.cpus \\ + \$INDEX \\ + $input \\ + | samtools view -bhS -@ $task.cpus > ${name}.bam + """ + stub: + """ + touch ${name}.bam + """ +} diff --git a/nextflow.config b/nextflow.config index 694092f..58fa1b5 100644 --- a/nextflow.config +++ b/nextflow.config @@ -24,6 +24,7 @@ params { control = false keep = false rm_rrna = false + bwa = false bbduk = false bbduk_kmer = 27 bbduk_qin = 'auto' diff --git a/workflows/clean_wf.nf b/workflows/clean_wf.nf index b61ed5b..d18eae9 100644 --- a/workflows/clean_wf.nf +++ b/workflows/clean_wf.nf @@ -1,4 +1,5 @@ include { minimap2 } from '../modules/minimap2' +include { bwa_index; bwa } from '../modules/bwa' include { bbduk } from '../modules/bbmap' include { bbduk_stats } from '../modules/utils' include { split_bam; fastq_from_bam ; idxstats_from_bam ; flagstats_from_bam ; index_bam as index_bam; index_bam as index_bam2; sort_bam ; filter_true_dcs_alignments ; merge_bam as merge_bam1 ; merge_bam as merge_bam2 ; merge_bam as merge_bam3 ; merge_bam as merge_bam4 ; filter_soft_clipped_alignments } from '../modules/alignment_processing' @@ -21,11 +22,17 @@ workflow clean { flagstats = Channel.empty() out_reads = bbduk.out.cleaned_reads.concat(bbduk.out.contaminated_reads) bams_bai = Channel.empty() - } - else { - minimap2(input, contamination) | sort_bam | index_bam | ( idxstats_from_bam & flagstats_from_bam ) + } else { + + if ( params.bwa ) { + bwa_index(contamination) + bwa(input, bwa_index.out, contamination) | sort_bam | index_bam | ( idxstats_from_bam & flagstats_from_bam ) + split_bam(bwa.out.bam) + } else { + minimap2(input, contamination) | sort_bam | index_bam | ( idxstats_from_bam & flagstats_from_bam ) + split_bam(minimap2.out.bam) + } - split_bam(minimap2.out.bam) contamination_bam = split_bam.out.mapped cleaned_bam = split_bam.out.unmapped if ( params.control && 'dcs' in params.control.split(',') && params.dcs_strict ) { From 2c6839513eaa4c4b6eac4bc6f55a2b15ad55e04b Mon Sep 17 00:00:00 2001 From: "Lataretu, Marie" Date: Mon, 19 Aug 2024 17:23:17 +0200 Subject: [PATCH 09/13] added stub tests for bwa, added tags --- tests/fasta/main.nf.test | 1 + tests/illumina/main.nf.test | 44 +++++++++++++++++++++++++++++++++++++ tests/nanopore/main.nf.test | 1 + 3 files changed, 46 insertions(+) diff --git a/tests/fasta/main.nf.test b/tests/fasta/main.nf.test index dde2ae0..0abbfd9 100644 --- a/tests/fasta/main.nf.test +++ b/tests/fasta/main.nf.test @@ -4,6 +4,7 @@ nextflow_pipeline { script "../../clean.nf" test("Stub") { + tag "minimap2" options "-stub-run" when { diff --git a/tests/illumina/main.nf.test b/tests/illumina/main.nf.test index d53af29..59ba82d 100644 --- a/tests/illumina/main.nf.test +++ b/tests/illumina/main.nf.test @@ -4,6 +4,7 @@ nextflow_pipeline { script "../../clean.nf" test("Stub paired-end") { + tag "minimap2" options "-stub-run" when { @@ -22,6 +23,7 @@ nextflow_pipeline { } test("Stub single-end") { + tag "minimap2" options "-stub-run" when { @@ -39,7 +41,48 @@ nextflow_pipeline { } } + test("Stub paired-end bwa") { + tag "bwa" + options "-stub-run" + + when { + params { + input_type = "illumina" + input = "$projectDir/assets/EMPTY_FILE_{R1,R2}.fastq" + own = "$projectDir/assets/EMPTY_FILE" + bwa = true + } + } + + then { + assertAll( + { assert workflow.success } + ) + } + } + + test("Stub single-end bwa") { + tag "bwa" + options "-stub-run" + + when { + params { + input_type = "illumina_single_end" + input = "$projectDir/assets/EMPTY_FILE" + own = "$projectDir/assets/EMPTY_FILE" + bwa = true + } + } + + then { + assertAll( + { assert workflow.success } + ) + } + } + test("Stub paired-end bbduk") { + tag "bbduk" options "-stub-run" when { @@ -59,6 +102,7 @@ nextflow_pipeline { } test("Stub single-end bbduk") { + tag "bbduk" options "-stub-run" when { diff --git a/tests/nanopore/main.nf.test b/tests/nanopore/main.nf.test index eb5ac62..0894d67 100644 --- a/tests/nanopore/main.nf.test +++ b/tests/nanopore/main.nf.test @@ -4,6 +4,7 @@ nextflow_pipeline { script "../../clean.nf" test("Stub") { + tag "minimap2" options "-stub-run" when { From 881595e5941e9c44af3d868978e0e0992be624ce Mon Sep 17 00:00:00 2001 From: "Lataretu, Marie" Date: Tue, 20 Aug 2024 15:48:12 +0200 Subject: [PATCH 10/13] bump bwa container --- configs/container.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/container.config b/configs/container.config index ccc6263..0f746c8 100644 --- a/configs/container.config +++ b/configs/container.config @@ -1,7 +1,7 @@ process { withLabel: smallTask { container = 'nanozoo/samtools:1.14--d8fb865' } withLabel: minimap2 { container = 'nanozoo/minimap2:2.26--d9ef6b6' } - withLabel: bwa { container = 'nanozoo/bwa:0.7.17--5d3a7e3' } + withLabel: bwa { container = 'nanozoo/bwa:0.7.18--0eff897' } withLabel: bbmap { container = 'nanozoo/bbmap:38.79--8e915d7' } withLabel: multiqc { container = 'nanozoo/multiqc:1.9--aba729b' } withLabel: fastqc { container = 'nanozoo/fastqc:0.11.9--f61b8b4' } From 98c624a513135c2557561c07d617140f62abab66 Mon Sep 17 00:00:00 2001 From: "Lataretu, Marie" Date: Tue, 20 Aug 2024 17:00:06 +0200 Subject: [PATCH 11/13] updated help and citations --- CITATIONS.md | 4 ++++ clean.nf | 1 + 2 files changed, 5 insertions(+) diff --git a/CITATIONS.md b/CITATIONS.md index 8d0e428..641d26b 100644 --- a/CITATIONS.md +++ b/CITATIONS.md @@ -12,6 +12,10 @@ > Quinlan AR, Hall IM. BEDTools: a flexible suite of utilities for comparing genomic features. Bioinformatics. 2010 Mar 15;26(6):841-2. doi: 10.1093/bioinformatics/btq033. Epub 2010 Jan 28. PubMed PMID: 20110278; PubMed Central PMCID: PMC2832824. +- [BWA](https://arxiv.org/abs/1303.3997) + + > Li H. (2013) Aligning sequence reads, clone sequences and assembly contigs with BWA-MEM. arXiv:1303.3997v2 [q-bio.GN] + - [FastQC](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/) - [Minimap2](https://pubmed.ncbi.nlm.nih.gov/29750242/) diff --git a/clean.nf b/clean.nf index 5c37b2f..5daf743 100755 --- a/clean.nf +++ b/clean.nf @@ -271,6 +271,7 @@ def helpMSG() { Reads are assigned to a combined index for decontamination and keeping. The use of this parameter can prevent false positive hits and the accidental removal of reads due to (poor quality) mappings. ${c_green}--rm_rrna ${c_reset} Clean your data from rRNA [default: $params.rm_rrna] + ${c_green}--bwa${c_reset} Add this flag to use BAW MEM instead of minimap2 for decontamination of short reads [default: $params.bwa] ${c_green}--bbduk${c_reset} Add this flag to use bbduk instead of minimap2 for decontamination of short reads [default: $params.bbduk] ${c_green}--bbduk_kmer${c_reset} Set kmer for bbduk [default: $params.bbduk_kmer] ${c_green}--bbduk_qin${c_reset} Set quality ASCII encoding for bbduk [default: $params.bbduk_qin; options are: 64, 33, auto] From 2dc049899dc5e39423a4838bf79b9169f18e5704 Mon Sep 17 00:00:00 2001 From: hoelzer Date: Wed, 21 Aug 2024 16:43:08 +0200 Subject: [PATCH 12/13] increase RAM for BWA if failing (indexing) --- configs/node.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/node.config b/configs/node.config index 97271ab..314e3a1 100644 --- a/configs/node.config +++ b/configs/node.config @@ -1,6 +1,6 @@ process { withLabel: minimap2 { cpus = 24; memory = 24.GB } - withLabel: bwa { cpus = 24; memory = 24.GB } + withLabel: bwa { cpus = {24 * task.attempt}; memory = {24.GB * task.attempt } ; maxRetries = 3 ; errorStrategy = { task.exitStatus in 130..140 ? 'retry' : 'terminate' } } withLabel: bbmap { cpus = 24; memory = 24.GB } withLabel: smallTask { cpus = 1; memory = 2.GB } withLabel: pysam { cpus = 2; memory = 4.GB } From 742c430e377c76e909137fe34dcf32a5748eb8fd Mon Sep 17 00:00:00 2001 From: "Lataretu, Marie" Date: Thu, 5 Sep 2024 17:33:56 +0200 Subject: [PATCH 13/13] addressed reviewer comments --- modules/bwa.nf | 6 +----- tests/illumina/main.nf.test | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/modules/bwa.nf b/modules/bwa.nf index f5a32ed..d6b5179 100644 --- a/modules/bwa.nf +++ b/modules/bwa.nf @@ -20,11 +20,7 @@ process bwa_index { """ mkdir bwa - touch bwa/db.amb - touch bwa/db.ann - touch bwa/db.bwt - touch bwa/db.pac - touch bwa/db.sa + touch bwa/db.{amb,ann,bwt,pac,sa} """ } diff --git a/tests/illumina/main.nf.test b/tests/illumina/main.nf.test index 59ba82d..c62b7c0 100644 --- a/tests/illumina/main.nf.test +++ b/tests/illumina/main.nf.test @@ -9,8 +9,8 @@ nextflow_pipeline { when { params { - input_type = "illumina" - input = "$projectDir/assets/EMPTY_FILE_{R1,R2}.fastq" + input_type = "illumina" + input = "$projectDir/assets/EMPTY_FILE_{R1,R2}.fastq" own = "$projectDir/assets/EMPTY_FILE" } } @@ -28,8 +28,8 @@ nextflow_pipeline { when { params { - input_type = "illumina_single_end" - input = "$projectDir/assets/EMPTY_FILE" + input_type = "illumina_single_end" + input = "$projectDir/assets/EMPTY_FILE" own = "$projectDir/assets/EMPTY_FILE" } } @@ -47,8 +47,8 @@ nextflow_pipeline { when { params { - input_type = "illumina" - input = "$projectDir/assets/EMPTY_FILE_{R1,R2}.fastq" + input_type = "illumina" + input = "$projectDir/assets/EMPTY_FILE_{R1,R2}.fastq" own = "$projectDir/assets/EMPTY_FILE" bwa = true } @@ -67,8 +67,8 @@ nextflow_pipeline { when { params { - input_type = "illumina_single_end" - input = "$projectDir/assets/EMPTY_FILE" + input_type = "illumina_single_end" + input = "$projectDir/assets/EMPTY_FILE" own = "$projectDir/assets/EMPTY_FILE" bwa = true } @@ -87,8 +87,8 @@ nextflow_pipeline { when { params { - input_type = "illumina" - input = "$projectDir/assets/EMPTY_FILE_{R1,R2}.fastq" + input_type = "illumina" + input = "$projectDir/assets/EMPTY_FILE_{R1,R2}.fastq" own = "$projectDir/assets/EMPTY_FILE" bbduk = true } @@ -107,8 +107,8 @@ nextflow_pipeline { when { params { - input_type = "illumina_single_end" - input = "$projectDir/assets/EMPTY_FILE" + input_type = "illumina_single_end" + input = "$projectDir/assets/EMPTY_FILE" own = "$projectDir/assets/EMPTY_FILE" bbduk = true }