From 3abde3de0970781e8e9aeec3cfeed759008a6ef4 Mon Sep 17 00:00:00 2001 From: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com> Date: Wed, 30 Oct 2024 13:39:11 +0530 Subject: [PATCH 1/2] add tests for fq2bam (#6902) * add tests for fq2bam * Added tests for PE and stub * Fixed linting * Removed pytests --------- Co-authored-by: GallVp --- .github/workflows/test.yml | 6 + modules/nf-core/parabricks/fq2bam/main.nf | 37 ++-- modules/nf-core/parabricks/fq2bam/meta.yml | 11 +- .../parabricks/fq2bam/tests/main.nf.test | 174 +++++++++++++++ .../parabricks/fq2bam/tests/main.nf.test.snap | 172 +++++++++++++++ .../parabricks/fq2bam/tests/nextflow.config | 8 + tests/config/pytest_modules.yml | 3 - .../modules/nf-core/parabricks/fq2bam/main.nf | 191 ----------------- .../nf-core/parabricks/fq2bam/nextflow.config | 17 -- .../nf-core/parabricks/fq2bam/test.yml | 120 ----------- .../parabricks/fq2bam/test_GPU_config.txt | 22 -- .../parabricks/fq2bam/test_GPU_yml.txt | 201 ------------------ 12 files changed, 380 insertions(+), 582 deletions(-) create mode 100644 modules/nf-core/parabricks/fq2bam/tests/main.nf.test create mode 100644 modules/nf-core/parabricks/fq2bam/tests/main.nf.test.snap create mode 100644 modules/nf-core/parabricks/fq2bam/tests/nextflow.config delete mode 100644 tests/modules/nf-core/parabricks/fq2bam/main.nf delete mode 100644 tests/modules/nf-core/parabricks/fq2bam/nextflow.config delete mode 100644 tests/modules/nf-core/parabricks/fq2bam/test.yml delete mode 100644 tests/modules/nf-core/parabricks/fq2bam/test_GPU_config.txt delete mode 100644 tests/modules/nf-core/parabricks/fq2bam/test_GPU_yml.txt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c6c9ae459c5..12d201a5d51 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -644,6 +644,12 @@ jobs: path: modules/nf-core/parabricks/fq2bammeth - profile: singularity path: modules/nf-core/parabricks/fq2bammeth + - profile: conda + path: modules/nf-core/parabricks/fq2bam + - profile: docker_self_hosted + path: modules/nf-core/parabricks/fq2bam + - profile: singularity + path: modules/nf-core/parabricks/fq2bam - profile: conda path: subworkflows/nf-core/vcf_annotate_ensemblvep - profile: conda diff --git a/modules/nf-core/parabricks/fq2bam/main.nf b/modules/nf-core/parabricks/fq2bam/main.nf index dac03b34c87..a68a64bf948 100644 --- a/modules/nf-core/parabricks/fq2bam/main.nf +++ b/modules/nf-core/parabricks/fq2bam/main.nf @@ -2,21 +2,22 @@ process PARABRICKS_FQ2BAM { tag "$meta.id" label 'process_high' - container "nvcr.io/nvidia/clara/clara-parabricks:4.3.0-1" + container "nvcr.io/nvidia/clara/clara-parabricks:4.3.2-1" input: - tuple val(meta), path(reads), path(interval_file) + tuple val(meta), path(reads) tuple val(meta2), path(fasta) tuple val(meta3), path(index) - path known_sites + path(interval_file) + path(known_sites) output: - tuple val(meta), path("*.bam") , emit: bam - tuple val(meta), path("*.bai") , emit: bai - path "versions.yml" , emit: versions - path "qc_metrics", optional:true , emit: qc_metrics - path("*.table"), optional:true , emit: bqsr_table - path("duplicate-metrics.txt"), optional:true , emit: duplicate_metrics + tuple val(meta), path("*.bam") , emit: bam + tuple val(meta), path("*.bai") , emit: bai + path "versions.yml" , emit: versions + path "qc_metrics" , emit: qc_metrics , optional:true + path("*.table") , emit: bqsr_table , optional:true + path("duplicate-metrics.txt") , emit: duplicate_metrics , optional:true when: task.ext.when == null || task.ext.when @@ -32,21 +33,20 @@ process PARABRICKS_FQ2BAM { def known_sites_command = known_sites ? known_sites.collect{"--knownSites $it"}.join(' ') : "" def known_sites_output = known_sites ? "--out-recal-file ${prefix}.table" : "" def interval_file_command = interval_file ? interval_file.collect{"--interval-file $it"}.join(' ') : "" + def num_gpus = task.accelerator ? "--num-gpus $task.accelerator.request" : '' """ - INDEX=`find -L ./ -name "*.amb" | sed 's/\\.amb\$//'` - mv $fasta \$INDEX + cp $fasta \$INDEX pbrun \\ fq2bam \\ --ref \$INDEX \\ $in_fq_command \\ - --read-group-sm $meta.id \\ --out-bam ${prefix}.bam \\ $known_sites_command \\ $known_sites_output \\ $interval_file_command \\ - --num-gpus $task.accelerator.request \\ + $num_gpus \\ $args cat <<-END_VERSIONS > versions.yml @@ -62,19 +62,10 @@ process PARABRICKS_FQ2BAM { } def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def in_fq_command = meta.single_end ? "--in-se-fq $reads" : "--in-fq $reads" - def known_sites_command = known_sites ? known_sites.collect{"--knownSites $it"}.join(' ') : "" - def known_sites_output = known_sites ? "--out-recal-file ${prefix}.table" : "" - def interval_file_command = interval_file ? interval_file.collect{"--interval-file $it"}.join(' ') : "" - def metrics_output_command = args = "--out-duplicate-metrics duplicate-metrics.txt" ? "touch duplicate-metrics.txt" : "" - def known_sites_output_command = known_sites ? "touch ${prefix}.table" : "" - def qc_metrics_output_command = args = "--out-qc-metrics-dir qc_metrics " ? "mkdir qc_metrics && touch qc_metrics/alignment.txt" : "" """ touch ${prefix}.bam touch ${prefix}.bam.bai - $metrics_output_command - $known_sites_output_command - $qc_metrics_output_command + cat <<-END_VERSIONS > versions.yml "${task.process}": pbrun: \$(echo \$(pbrun version 2>&1) | sed 's/^Please.* //' ) diff --git a/modules/nf-core/parabricks/fq2bam/meta.yml b/modules/nf-core/parabricks/fq2bam/meta.yml index c86ff19aade..b1cae9c4fa4 100644 --- a/modules/nf-core/parabricks/fq2bam/meta.yml +++ b/modules/nf-core/parabricks/fq2bam/meta.yml @@ -24,11 +24,6 @@ input: type: file description: fastq.gz files pattern: "*.fastq.gz" - - interval_file: - type: file - description: (optional) file(s) containing genomic intervals for use in base - quality score recalibration (BQSR) - pattern: "*.{bed,interval_list,picard,list,intervals}" - - meta2: type: map description: | @@ -45,6 +40,11 @@ input: type: file description: reference BWA index pattern: "*.{amb,ann,bwt,pac,sa}" + - - interval_file: + type: file + description: (optional) file(s) containing genomic intervals for use in base + quality score recalibration (BQSR) + pattern: "*.{bed,interval_list,picard,list,intervals}" - - known_sites: type: file description: (optional) known sites file(s) for calculating BQSR. markdups must @@ -99,3 +99,4 @@ authors: maintainers: - "@bsiranosian" - "@adamrtalbot" + - "@gallvp" diff --git a/modules/nf-core/parabricks/fq2bam/tests/main.nf.test b/modules/nf-core/parabricks/fq2bam/tests/main.nf.test new file mode 100644 index 00000000000..46d06322c32 --- /dev/null +++ b/modules/nf-core/parabricks/fq2bam/tests/main.nf.test @@ -0,0 +1,174 @@ +nextflow_process { + + name "Test Process PARABRICKS_FQ2BAM" + script "../main.nf" + process "PARABRICKS_FQ2BAM" + config "./nextflow.config" + + tag "bwa/index" + tag "modules" + tag "parabricks/fq2bam" + tag "modules_nfcore" + tag "parabricks" + + setup { + run("BWA_INDEX") { + script "../../../bwa/index/main.nf" + process { + """ + input[0] = Channel.of([ + [ id:'test' ], // meta map + file('https://github.com/nf-core/test-datasets/raw/methylseq/reference/genome.fa', checkIfExists: true) + ]) + """ + } + } + + run("BWA_INDEX", alias: 'BWA_INDEX_PE') { + script "../../../bwa/index/main.nf" + process { + """ + input[0] = Channel.of([ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ]) + """ + } + } + } + + test("SRR389222 - fastq - se") { + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], // meta map + [ + file('https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub1.fastq.gz', checkIfExists: true) + ] + ]) + input[1] = Channel.of([ + [ id:'test' ], // meta map + file('https://github.com/nf-core/test-datasets/raw/methylseq/reference/genome.fa', checkIfExists: true) + ]) + input[2] = BWA_INDEX.out.index + input[3] = [] + input[4] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + bam(process.out.bam[0][1]).getReadsMD5(), + file(process.out.bai[0][1]).name, + process.out.versions + ).match() } + ) + } + } + + test("SRR389222 - fastq - se - stub") { + options '-stub' + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], // meta map + [ + file('https://github.com/nf-core/test-datasets/raw/methylseq/testdata/SRR389222_sub1.fastq.gz', checkIfExists: true) + ] + ]) + input[1] = Channel.of([ + [ id:'test' ], // meta map + file('https://github.com/nf-core/test-datasets/raw/methylseq/reference/genome.fa', checkIfExists: true) + ]) + input[2] = BWA_INDEX.out.index + input[3] = [] + input[4] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("sarscov2 - fastq - pe") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ] + input[1] = Channel.of([ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ]) + input[2] = BWA_INDEX_PE.out.index + input[3] = [] + input[4] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + bam(process.out.bam[0][1]).getReadsMD5(), + file(process.out.bai[0][1]).name, + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - fastq - pe - stub") { + options '-stub' + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ] + input[1] = Channel.of([ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ]) + input[2] = BWA_INDEX_PE.out.index + input[3] = [] + input[4] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/parabricks/fq2bam/tests/main.nf.test.snap b/modules/nf-core/parabricks/fq2bam/tests/main.nf.test.snap new file mode 100644 index 00000000000..50d96e78ffb --- /dev/null +++ b/modules/nf-core/parabricks/fq2bam/tests/main.nf.test.snap @@ -0,0 +1,172 @@ +{ + "SRR389222 - fastq - se - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,c054e8254095319b660a92bdc07d990f" + ], + "3": [ + + ], + "4": [ + + ], + "5": [ + + ], + "bai": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "bam": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "bqsr_table": [ + + ], + "duplicate_metrics": [ + + ], + "qc_metrics": [ + + ], + "versions": [ + "versions.yml:md5,c054e8254095319b660a92bdc07d990f" + ] + } + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-30T00:20:56.208782" + }, + "sarscov2 - fastq - pe - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,c054e8254095319b660a92bdc07d990f" + ], + "3": [ + + ], + "4": [ + + ], + "5": [ + + ], + "bai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "bqsr_table": [ + + ], + "duplicate_metrics": [ + + ], + "qc_metrics": [ + + ], + "versions": [ + "versions.yml:md5,c054e8254095319b660a92bdc07d990f" + ] + } + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-30T00:35:07.267293" + }, + "sarscov2 - fastq - pe": { + "content": [ + "2d64e4363d9f3c0e2167fce49d5087cf", + "test.bam.bai", + [ + "versions.yml:md5,c054e8254095319b660a92bdc07d990f" + ] + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-30T00:30:39.910679" + }, + "SRR389222 - fastq - se": { + "content": [ + "3d5b94990c7fdf90a682edb5ee0f59de", + "test.bam.bai", + [ + "versions.yml:md5,c054e8254095319b660a92bdc07d990f" + ] + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-30T00:22:15.94157" + } +} \ No newline at end of file diff --git a/modules/nf-core/parabricks/fq2bam/tests/nextflow.config b/modules/nf-core/parabricks/fq2bam/tests/nextflow.config new file mode 100644 index 00000000000..507305cbf69 --- /dev/null +++ b/modules/nf-core/parabricks/fq2bam/tests/nextflow.config @@ -0,0 +1,8 @@ +process { + withName: 'PARABRICKS_FQ2BAM' { + ext.args = '--low-memory' + } + // Ref: https://forums.developer.nvidia.com/t/problem-with-gpu/256825/6 + // Parabricks’s fq2bam requires 24GB of memory. + // Using --low-memory for testing +} diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index cb62c33fbe0..0bf3c88fbc6 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -476,9 +476,6 @@ parabricks/dbsnp: parabricks/deepvariant: - modules/nf-core/parabricks/deepvariant/** - tests/modules/nf-core/parabricks/deepvariant/** -parabricks/fq2bam: - - modules/nf-core/parabricks/fq2bam/** - - tests/modules/nf-core/parabricks/fq2bam/** parabricks/genotypegvcf: - modules/nf-core/parabricks/genotypegvcf/** - tests/modules/nf-core/parabricks/genotypegvcf/** diff --git a/tests/modules/nf-core/parabricks/fq2bam/main.nf b/tests/modules/nf-core/parabricks/fq2bam/main.nf deleted file mode 100644 index da33475ad79..00000000000 --- a/tests/modules/nf-core/parabricks/fq2bam/main.nf +++ /dev/null @@ -1,191 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { PARABRICKS_FQ2BAM } from '../../../../../modules/nf-core/parabricks/fq2bam/main.nf' -include { PARABRICKS_FQ2BAM as PARABRICKS_FQ2BAM_MKDUP_NOQC } from '../../../../../modules/nf-core/parabricks/fq2bam/main.nf' -include { PARABRICKS_FQ2BAM as PARABRICKS_FQ2BAM_NOMKDUP_NOQC } from '../../../../../modules/nf-core/parabricks/fq2bam/main.nf' -include { PARABRICKS_FQ2BAM as PARABRICKS_FQ2BAM_MKDUP_QC } from '../../../../../modules/nf-core/parabricks/fq2bam/main.nf' -include { PARABRICKS_FQ2BAM as PARABRICKS_FQ2BAM_NOMKDUP_QC } from '../../../../../modules/nf-core/parabricks/fq2bam/main.nf' -include { BWA_INDEX } from '../../../../../modules/nf-core/bwa/index/main.nf' - -workflow test_parabricks_fq2bam_pe_default { - - input = [ - [ id:'test', single_end:false], - [ - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) - ], - [] - ] - fasta = [ - [id: 'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - BWA_INDEX ( fasta ) - PARABRICKS_FQ2BAM ( input, fasta, BWA_INDEX.out.index, known_sites=[] ) - -} - -workflow test_parabricks_fq2bam_se_default { - - input = [ - [ id:'test', single_end:true], - [file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)], - [] - ] - - fasta = [ - [id: 'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - - - BWA_INDEX ( fasta ) - PARABRICKS_FQ2BAM ( input, fasta, BWA_INDEX.out.index, known_sites=[] ) -} - -workflow test_parabricks_fq2bam_pe_mkdup_noqc { - - input = [ - [ id:'test', single_end:false], - [ - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) - ], - [] - ] - fasta = [ - [id: 'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - BWA_INDEX ( fasta ) - PARABRICKS_FQ2BAM_MKDUP_NOQC ( input, fasta, BWA_INDEX.out.index, known_sites=[] ) -} - -workflow test_parabricks_fq2bam_pe_nomkdup_noqc { - - input = [ - [ id:'test', single_end:false], - [ - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) - ], - [] - ] - fasta = [ - [id: 'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - BWA_INDEX ( fasta ) - PARABRICKS_FQ2BAM_NOMKDUP_NOQC ( input, fasta, BWA_INDEX.out.index, known_sites=[] ) -} - -workflow test_parabricks_fq2bam_pe_mkdup_qc { - - input = [ - [ id:'test', single_end:false], - [ - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) - ], - [] - ] - fasta = [ - [id: 'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - BWA_INDEX ( fasta ) - PARABRICKS_FQ2BAM_MKDUP_QC ( input, fasta, BWA_INDEX.out.index, known_sites=[] ) -} - -workflow test_parabricks_fq2bam_pe_nomkdup_qc { - - input = [ - [ id:'test', single_end:false], - [ - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) - ], - [] - ] - fasta = [ - [id: 'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - BWA_INDEX ( fasta ) - PARABRICKS_FQ2BAM_NOMKDUP_QC ( input, fasta, BWA_INDEX.out.index, known_sites=[] ) -} - -workflow test_parabricks_fq2bam_pe_bqsr { - - input = [ - [ id:'test', single_end:false], - [ - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) - ], - [] - ] - fasta = [ - [id: 'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - known_sites = [ - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) - ] - - BWA_INDEX ( fasta ) - PARABRICKS_FQ2BAM ( input, fasta, BWA_INDEX.out.index, known_sites=known_sites ) -} - -workflow test_parabricks_fq2bam_pe_bqsr2 { - - input = [ - [ id:'test', single_end:false], - [ - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) - ], - [] - ] - fasta = [ - [id: 'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - known_sites = [ - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true) - ] - - BWA_INDEX ( fasta ) - PARABRICKS_FQ2BAM ( input, fasta, BWA_INDEX.out.index, known_sites=known_sites ) -} - - -workflow test_parabricks_fq2bam_pe_bqsr_intervals { - - input = [ - [ id:'test', single_end:false], - [ - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) - ], - [ - file(params.test_data['sarscov2']['genome']['baits_interval_list'], checkIfExists: true), - file(params.test_data['sarscov2']['genome']['targets_interval_list'], checkIfExists: true) - ] - ] - fasta = [ - [id: 'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - known_sites = [ - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test2_vcf_gz'], checkIfExists: true) - ] - - BWA_INDEX ( fasta ) - PARABRICKS_FQ2BAM ( input, fasta, BWA_INDEX.out.index, known_sites=known_sites ) -} \ No newline at end of file diff --git a/tests/modules/nf-core/parabricks/fq2bam/nextflow.config b/tests/modules/nf-core/parabricks/fq2bam/nextflow.config deleted file mode 100644 index 09b089b7fee..00000000000 --- a/tests/modules/nf-core/parabricks/fq2bam/nextflow.config +++ /dev/null @@ -1,17 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: PARABRICKS_FQ2BAM_MKDUP_NOQC { - ext.args = "--out-duplicate-metrics duplicate-metrics.txt" - } - withName: PARABRICKS_FQ2BAM_NOMKDUP_NOQC { - ext.args = "--no-markdups" - } - withName: PARABRICKS_FQ2BAM_MKDUP_QC { - ext.args = "--out-duplicate-metrics duplicate-metrics.txt --out-qc-metrics-dir qc_metrics" - } - withName: PARABRICKS_FQ2BAM_NOMKDUP_QC { - ext.args = "--no-markdups --out-qc-metrics-dir qc_metrics" - } -} diff --git a/tests/modules/nf-core/parabricks/fq2bam/test.yml b/tests/modules/nf-core/parabricks/fq2bam/test.yml deleted file mode 100644 index c6818b67aae..00000000000 --- a/tests/modules/nf-core/parabricks/fq2bam/test.yml +++ /dev/null @@ -1,120 +0,0 @@ -- name: parabricks fq2bam test_parabricks_fq2bam_pe_default - command: nextflow run ./tests/modules/nf-core/parabricks/fq2bam -entry test_parabricks_fq2bam_pe_default -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/fq2bam/nextflow.config -stub-run - tags: - - parabricks/fq2bam - - parabricks - files: - - path: output/parabricks/test.bam - should_exist: true - - path: output/parabricks/test.bam.bai - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks fq2bam test_parabricks_fq2bam_se_default - command: nextflow run ./tests/modules/nf-core/parabricks/fq2bam -entry test_parabricks_fq2bam_se_default -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/fq2bam/nextflow.config -stub-run - tags: - - parabricks/fq2bam - - parabricks - files: - - path: output/parabricks/test.bam - should_exist: true - - path: output/parabricks/test.bam.bai - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks fq2bam test_parabricks_fq2bam_pe_mkdup_noqc - command: nextflow run ./tests/modules/nf-core/parabricks/fq2bam -entry test_parabricks_fq2bam_pe_mkdup_noqc -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/fq2bam/nextflow.config -stub-run - tags: - - parabricks/fq2bam - - parabricks - files: - - path: output/parabricks/test.bam - should_exist: true - - path: output/parabricks/test.bam.bai - should_exist: true - - path: output/parabricks/duplicate-metrics.txt - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks fq2bam test_parabricks_fq2bam_pe_nomkdup_noqc - command: nextflow run ./tests/modules/nf-core/parabricks/fq2bam -entry test_parabricks_fq2bam_pe_nomkdup_noqc -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/fq2bam/nextflow.config -stub-run - tags: - - parabricks/fq2bam - - parabricks - files: - - path: output/parabricks/test.bam - should_exist: true - - path: output/parabricks/test.bam.bai - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks fq2bam test_parabricks_fq2bam_pe_mkdup_qc - command: nextflow run ./tests/modules/nf-core/parabricks/fq2bam -entry test_parabricks_fq2bam_pe_mkdup_qc -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/fq2bam/nextflow.config -stub-run - tags: - - parabricks/fq2bam - - parabricks - files: - - path: output/parabricks/qc_metrics/alignment.txt - should_exist: true - - path: output/parabricks/duplicate-metrics.txt - should_exist: true - - path: output/parabricks/test.bam - should_exist: true - - path: output/parabricks/test.bam.bai - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks fq2bam test_parabricks_fq2bam_pe_nomkdup_qc - command: nextflow run ./tests/modules/nf-core/parabricks/fq2bam -entry test_parabricks_fq2bam_pe_nomkdup_qc -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/fq2bam/nextflow.config -stub-run - tags: - - parabricks/fq2bam - - parabricks - files: - - path: output/parabricks/qc_metrics/alignment.txt - should_exist: true - - path: output/parabricks/test.bam - should_exist: true - - path: output/parabricks/test.bam.bai - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks fq2bam test_parabricks_fq2bam_pe_bqsr - command: nextflow run ./tests/modules/nf-core/parabricks/fq2bam -entry test_parabricks_fq2bam_pe_bqsr -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/fq2bam/nextflow.config -stub-run - tags: - - parabricks/fq2bam - - parabricks - files: - - path: output/parabricks/test.bam - should_exist: true - - path: output/parabricks/test.bam.bai - should_exist: true - - path: output/parabricks/test.table - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks fq2bam test_parabricks_fq2bam_pe_bqsr2 - command: nextflow run ./tests/modules/nf-core/parabricks/fq2bam -entry test_parabricks_fq2bam_pe_bqsr2 -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/fq2bam/nextflow.config -stub-run - tags: - - parabricks/fq2bam - - parabricks - files: - - path: output/parabricks/test.bam - should_exist: true - - path: output/parabricks/test.bam.bai - should_exist: true - - path: output/parabricks/test.table - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks fq2bam test_parabricks_fq2bam_pe_bqsr_intervals - command: nextflow run ./tests/modules/nf-core/parabricks/fq2bam -entry test_parabricks_fq2bam_pe_bqsr_intervals -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/fq2bam/nextflow.config -stub-run - tags: - - parabricks/fq2bam - - parabricks - files: - - path: output/parabricks/test.bam - should_exist: true - - path: output/parabricks/test.bam.bai - should_exist: true - - path: output/parabricks/test.table - should_exist: true diff --git a/tests/modules/nf-core/parabricks/fq2bam/test_GPU_config.txt b/tests/modules/nf-core/parabricks/fq2bam/test_GPU_config.txt deleted file mode 100644 index 91609e89818..00000000000 --- a/tests/modules/nf-core/parabricks/fq2bam/test_GPU_config.txt +++ /dev/null @@ -1,22 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - memory = "15.GB" - cpus = 4 - accelerator = 1 - - withName: PARABRICKS_FQ2BAM_MKDUP_NOQC { - ext.args = "--out-duplicate-metrics duplicate-metrics.txt" - } - withName: PARABRICKS_FQ2BAM_NOMKDUP_NOQC { - ext.args = "--no-markdups" - } - withName: PARABRICKS_FQ2BAM_MKDUP_QC { - ext.args = "--out-duplicate-metrics duplicate-metrics.txt --out-qc-metrics-dir qc_metrics" - } - withName: PARABRICKS_FQ2BAM_NOMKDUP_QC { - ext.args = "--no-markdups --out-qc-metrics-dir qc_metrics" - } -} -docker.runOptions = "--gpus all" -singularity.runOptions = "--nv" diff --git a/tests/modules/nf-core/parabricks/fq2bam/test_GPU_yml.txt b/tests/modules/nf-core/parabricks/fq2bam/test_GPU_yml.txt deleted file mode 100644 index 335f229bd9c..00000000000 --- a/tests/modules/nf-core/parabricks/fq2bam/test_GPU_yml.txt +++ /dev/null @@ -1,201 +0,0 @@ -- name: parabricks fq2bam test_parabricks_fq2bam_pe_default - command: nextflow run ./tests/modules/nf-core/parabricks/fq2bam -entry test_parabricks_fq2bam_pe_default -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/fq2bam/nextflow.config - tags: - - parabricks/fq2bam - - parabricks - files: - - path: output/parabricks/test.bam - should_exist: true - - path: output/parabricks/test.bam.bai - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks fq2bam test_parabricks_fq2bam_se_default - command: nextflow run ./tests/modules/nf-core/parabricks/fq2bam -entry test_parabricks_fq2bam_se_default -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/fq2bam/nextflow.config - tags: - - parabricks/fq2bam - - parabricks - files: - - path: output/parabricks/test.bam - should_exist: true - - path: output/parabricks/test.bam.bai - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks fq2bam test_parabricks_fq2bam_pe_mkdup_noqc - command: nextflow run ./tests/modules/nf-core/parabricks/fq2bam -entry test_parabricks_fq2bam_pe_mkdup_noqc -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/fq2bam/nextflow.config - tags: - - parabricks/fq2bam - - parabricks - files: - - path: output/parabricks/test.bam - should_exist: true - - path: output/parabricks/test.bam.bai - should_exist: true - - path: output/parabricks/duplicate-metrics.txt - md5sum: e3bd79a85934aaf66d76ea02958a0364 - - path: output/parabricks/versions.yml - -- name: parabricks fq2bam test_parabricks_fq2bam_pe_nomkdup_noqc - command: nextflow run ./tests/modules/nf-core/parabricks/fq2bam -entry test_parabricks_fq2bam_pe_nomkdup_noqc -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/fq2bam/nextflow.config - tags: - - parabricks/fq2bam - - parabricks - files: - - path: output/parabricks/test.bam - should_exist: true - - path: output/parabricks/test.bam.bai - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks fq2bam test_parabricks_fq2bam_pe_mkdup_qc - command: nextflow run ./tests/modules/nf-core/parabricks/fq2bam -entry test_parabricks_fq2bam_pe_mkdup_qc -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/fq2bam/nextflow.config - tags: - - parabricks/fq2bam - - parabricks - files: - - path: output/parabricks/qc_metrics/alignment.txt - md5sum: 7460720019995fdf8958694e5e2dfbd4 - - path: output/parabricks/qc_metrics/base_distribution_by_cycle.pdf - should_exist: true - - path: output/parabricks/qc_metrics/base_distribution_by_cycle.png - should_exist: true - - path: output/parabricks/qc_metrics/base_distribution_by_cycle.txt - md5sum: 409ca5a736a1c86d56f151c3524b8474 - - path: output/parabricks/qc_metrics/gcbias.pdf - should_exist: true - - path: output/parabricks/qc_metrics/gcbias_0.png - md5sum: 954e493ba19ae4bc54f1d72b6b894285 - - path: output/parabricks/qc_metrics/gcbias_detail.txt - md5sum: 2163a0e9de9efcf89178449634080d3f - - path: output/parabricks/qc_metrics/gcbias_summary.txt - md5sum: 40cf804e365489f79e09b04332e5a1da - - path: output/parabricks/qc_metrics/insert_size.txt - md5sum: ce5a32ab105d243d6bdea366dfafa351 - - path: output/parabricks/qc_metrics/mean_quality_by_cycle.pdf - should_exist: true - - path: output/parabricks/qc_metrics/mean_quality_by_cycle.png - should_exist: true - - path: output/parabricks/qc_metrics/mean_quality_by_cycle.txt - md5sum: 19589f6c86ddfe06e697a9e84cf2e3df - - path: output/parabricks/qc_metrics/quality_yield.txt - md5sum: 2a717db9042292f75d84d813ac09f4c8 - - path: output/parabricks/qc_metrics/qualityscore.pdf - should_exist: true - - path: output/parabricks/qc_metrics/qualityscore.png - should_exist: true - - path: output/parabricks/qc_metrics/qualityscore.txt - md5sum: 506888848039f7ee1522dcce83e3af10 - - path: output/parabricks/qc_metrics/sequencingArtifact.bait_bias_detail_metrics.txt - md5sum: fcb8b49e23ed4c699df29012c5b67728 - - path: output/parabricks/qc_metrics/sequencingArtifact.bait_bias_summary_metrics.txt - md5sum: 2a0604289493cab71828bf1e674d2b26 - - path: output/parabricks/qc_metrics/sequencingArtifact.error_summary_metrics.txt - md5sum: cbb7fe776495a7ecde26f738d05951ce - - path: output/parabricks/qc_metrics/sequencingArtifact.pre_adapter_detail_metrics.txt - md5sum: 459fe6aae4a74ea7bab63c70c675559e - - path: output/parabricks/qc_metrics/sequencingArtifact.pre_adapter_summary_metrics.txt - md5sum: b133062d9230ae664e71c5a462dc291c - - path: output/parabricks/duplicate-metrics.txt - md5sum: e3bd79a85934aaf66d76ea02958a0364 - - path: output/parabricks/test.bam - should_exist: true - - path: output/parabricks/test.bam.bai - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks fq2bam test_parabricks_fq2bam_pe_nomkdup_qc - command: nextflow run ./tests/modules/nf-core/parabricks/fq2bam -entry test_parabricks_fq2bam_pe_nomkdup_qc -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/fq2bam/nextflow.config - tags: - - parabricks/fq2bam - - parabricks - files: - - path: output/parabricks/qc_metrics/alignment.txt - md5sum: 7460720019995fdf8958694e5e2dfbd4 - - path: output/parabricks/qc_metrics/base_distribution_by_cycle.pdf - should_exist: true - - path: output/parabricks/qc_metrics/base_distribution_by_cycle.png - should_exist: true - - path: output/parabricks/qc_metrics/base_distribution_by_cycle.txt - md5sum: 409ca5a736a1c86d56f151c3524b8474 - - path: output/parabricks/qc_metrics/gcbias.pdf - should_exist: true - - path: output/parabricks/qc_metrics/gcbias_0.png - md5sum: 954e493ba19ae4bc54f1d72b6b894285 - - path: output/parabricks/qc_metrics/gcbias_detail.txt - md5sum: 2163a0e9de9efcf89178449634080d3f - - path: output/parabricks/qc_metrics/gcbias_summary.txt - md5sum: 40cf804e365489f79e09b04332e5a1da - - path: output/parabricks/qc_metrics/insert_size.txt - md5sum: ce5a32ab105d243d6bdea366dfafa351 - - path: output/parabricks/qc_metrics/mean_quality_by_cycle.pdf - should_exist: true - - path: output/parabricks/qc_metrics/mean_quality_by_cycle.png - should_exist: true - - path: output/parabricks/qc_metrics/mean_quality_by_cycle.txt - md5sum: 19589f6c86ddfe06e697a9e84cf2e3df - - path: output/parabricks/qc_metrics/quality_yield.txt - md5sum: 2a717db9042292f75d84d813ac09f4c8 - - path: output/parabricks/qc_metrics/qualityscore.pdf - should_exist: true - - path: output/parabricks/qc_metrics/qualityscore.png - should_exist: true - - path: output/parabricks/qc_metrics/qualityscore.txt - md5sum: 506888848039f7ee1522dcce83e3af10 - - path: output/parabricks/qc_metrics/sequencingArtifact.bait_bias_detail_metrics.txt - md5sum: fcb8b49e23ed4c699df29012c5b67728 - - path: output/parabricks/qc_metrics/sequencingArtifact.bait_bias_summary_metrics.txt - md5sum: 2a0604289493cab71828bf1e674d2b26 - - path: output/parabricks/qc_metrics/sequencingArtifact.error_summary_metrics.txt - md5sum: cbb7fe776495a7ecde26f738d05951ce - - path: output/parabricks/qc_metrics/sequencingArtifact.pre_adapter_detail_metrics.txt - md5sum: 459fe6aae4a74ea7bab63c70c675559e - - path: output/parabricks/qc_metrics/sequencingArtifact.pre_adapter_summary_metrics.txt - md5sum: b133062d9230ae664e71c5a462dc291c - - path: output/parabricks/test.bam - should_exist: true - - path: output/parabricks/test.bam.bai - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks fq2bam test_parabricks_fq2bam_pe_bqsr - command: nextflow run ./tests/modules/nf-core/parabricks/fq2bam -entry test_parabricks_fq2bam_pe_bqsr -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/fq2bam/nextflow.config - tags: - - parabricks/fq2bam - - parabricks - files: - - path: output/parabricks/test.bam - should_exist: true - - path: output/parabricks/test.bam.bai - should_exist: true - - path: output/parabricks/test.table - md5sum: a63b35267493ab63ae58c348caaaf28f - - path: output/parabricks/versions.yml - -- name: parabricks fq2bam test_parabricks_fq2bam_pe_bqsr2 - command: nextflow run ./tests/modules/nf-core/parabricks/fq2bam -entry test_parabricks_fq2bam_pe_bqsr2 -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/fq2bam/nextflow.config - tags: - - parabricks/fq2bam - - parabricks - files: - - path: output/parabricks/test.bam - should_exist: true - - path: output/parabricks/test.bam.bai - should_exist: true - - path: output/parabricks/test.table - md5sum: a63b35267493ab63ae58c348caaaf28f - - path: output/parabricks/versions.yml - -- name: parabricks fq2bam test_parabricks_fq2bam_pe_bqsr_intervals - command: nextflow run ./tests/modules/nf-core/parabricks/fq2bam -entry test_parabricks_fq2bam_pe_bqsr_intervals -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/fq2bam/nextflow.config - tags: - - parabricks/fq2bam - - parabricks - files: - - path: output/parabricks/test.bam - should_exist: true - - path: output/parabricks/test.bam.bai - should_exist: true - - path: output/parabricks/test.table - md5sum: f703648007481982782952c040137594 - - path: output/parabricks/versions.yml From adf071fbc2235ee4ef5789aa77410c976d1e94e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20B=C3=A4uerle?= <45968370+famosab@users.noreply.github.com> Date: Wed, 30 Oct 2024 11:26:14 +0100 Subject: [PATCH 2/2] adjust io of fq2bam to be consistent (#6906) * adjust io to be consistent * adjust meta to be consistent * fix meta --- modules/nf-core/parabricks/fq2bam/main.nf | 4 ++-- modules/nf-core/parabricks/fq2bam/meta.yml | 23 +++++++++++++------ .../parabricks/fq2bam/tests/main.nf.test | 8 +++---- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/modules/nf-core/parabricks/fq2bam/main.nf b/modules/nf-core/parabricks/fq2bam/main.nf index a68a64bf948..c1877bdf468 100644 --- a/modules/nf-core/parabricks/fq2bam/main.nf +++ b/modules/nf-core/parabricks/fq2bam/main.nf @@ -8,15 +8,15 @@ process PARABRICKS_FQ2BAM { tuple val(meta), path(reads) tuple val(meta2), path(fasta) tuple val(meta3), path(index) - path(interval_file) + tuple val(meta4), path(interval_file) path(known_sites) output: tuple val(meta), path("*.bam") , emit: bam tuple val(meta), path("*.bai") , emit: bai + tuple val(meta), path("*.table"), emit: bqsr_table , optional:true path "versions.yml" , emit: versions path "qc_metrics" , emit: qc_metrics , optional:true - path("*.table") , emit: bqsr_table , optional:true path("duplicate-metrics.txt") , emit: duplicate_metrics , optional:true when: diff --git a/modules/nf-core/parabricks/fq2bam/meta.yml b/modules/nf-core/parabricks/fq2bam/meta.yml index b1cae9c4fa4..b3e2e7e6ee6 100644 --- a/modules/nf-core/parabricks/fq2bam/meta.yml +++ b/modules/nf-core/parabricks/fq2bam/meta.yml @@ -40,7 +40,11 @@ input: type: file description: reference BWA index pattern: "*.{amb,ann,bwt,pac,sa}" - - - interval_file: + - - meta4: + type: map + description: | + Groovy Map containing index information + - interval_file: type: file description: (optional) file(s) containing genomic intervals for use in base quality score recalibration (BQSR) @@ -71,6 +75,17 @@ output: type: file description: index corresponding to sorted BAM file pattern: "*.bai" + - bqsr_table: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test'] + - "*.table": + type: file + description: (optional) table from base quality score recalibration calculation, + to be used with parabricks/applybqsr + pattern: "*.table" - versions: - versions.yml: type: file @@ -81,12 +96,6 @@ output: type: directory description: (optional) optional directory of qc metrics pattern: "qc_metrics" - - bqsr_table: - - "*.table": - type: file - description: (optional) table from base quality score recalibration calculation, - to be used with parabricks/applybqsr - pattern: "*.table" - duplicate_metrics: - duplicate-metrics.txt: type: file diff --git a/modules/nf-core/parabricks/fq2bam/tests/main.nf.test b/modules/nf-core/parabricks/fq2bam/tests/main.nf.test index 46d06322c32..8e4adb2966c 100644 --- a/modules/nf-core/parabricks/fq2bam/tests/main.nf.test +++ b/modules/nf-core/parabricks/fq2bam/tests/main.nf.test @@ -53,7 +53,7 @@ nextflow_process { file('https://github.com/nf-core/test-datasets/raw/methylseq/reference/genome.fa', checkIfExists: true) ]) input[2] = BWA_INDEX.out.index - input[3] = [] + input[3] = [ [], [] ] input[4] = [] """ } @@ -88,7 +88,7 @@ nextflow_process { file('https://github.com/nf-core/test-datasets/raw/methylseq/reference/genome.fa', checkIfExists: true) ]) input[2] = BWA_INDEX.out.index - input[3] = [] + input[3] = [ [], [] ] input[4] = [] """ } @@ -119,7 +119,7 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ]) input[2] = BWA_INDEX_PE.out.index - input[3] = [] + input[3] = [ [], [] ] input[4] = [] """ } @@ -156,7 +156,7 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ]) input[2] = BWA_INDEX_PE.out.index - input[3] = [] + input[3] = [ [], [] ] input[4] = [] """ }