From 192699bec218ca55ef42bcf09e1789dbc06257d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Wed, 13 Nov 2024 10:30:02 +0100 Subject: [PATCH 01/33] port to nf-test --- .../mutectcaller/tests/main.nf.test | 217 ++++++++++++++++++ .../parabricks/mutectcaller/tests/pon.config | 6 + .../parabricks/mutectcaller/tests/tn.config | 7 + tests/config/pytest_modules.yml | 3 - .../nf-core/parabricks/mutectcaller/main.nf | 113 --------- .../parabricks/mutectcaller/nextflow.config | 14 -- .../nf-core/parabricks/mutectcaller/test.yml | 61 ----- .../mutectcaller/test_GPU_config.txt | 18 -- .../parabricks/mutectcaller/test_GPU_yml.txt | 62 ----- 9 files changed, 230 insertions(+), 271 deletions(-) create mode 100644 modules/nf-core/parabricks/mutectcaller/tests/main.nf.test create mode 100644 modules/nf-core/parabricks/mutectcaller/tests/pon.config create mode 100644 modules/nf-core/parabricks/mutectcaller/tests/tn.config delete mode 100644 tests/modules/nf-core/parabricks/mutectcaller/main.nf delete mode 100644 tests/modules/nf-core/parabricks/mutectcaller/nextflow.config delete mode 100644 tests/modules/nf-core/parabricks/mutectcaller/test.yml delete mode 100644 tests/modules/nf-core/parabricks/mutectcaller/test_GPU_config.txt delete mode 100644 tests/modules/nf-core/parabricks/mutectcaller/test_GPU_yml.txt diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test new file mode 100644 index 00000000000..efa3e4e5ce8 --- /dev/null +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -0,0 +1,217 @@ +nextflow_process { + + name "Test Process PARABRICKS_MUTECTCALLER" + script "../main.nf" + process "PARABRICKS_MUTECTCALLER" + config "./nextflow.config" + + tag "modules" + tag "parabricks/mutectcaller" + tag "modules_nfcore" + tag "parabricks" + + test("human - bam") { + + when { + process { + """ + input[0] = [ + [ id:'test', tumor_id:'tumor' ], + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + [], // index only neeeded if using intervals or tumor-normal calling + [], + [], + [] + ] + input[1] = [ // fasta + [ id: 'reference' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [] // pon + input[3] = [] // pon index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( process.out ).match() } + ) + } + + } + + test("human - bam - tn") { + // tumor-normal calling not passing because of issue with readgroups in the test files + // [PB Error][src/readers.cpp:1314] ID simulation01 maps to tm_simulation01, but PU is nm_simulation01 (different platform), exiting. + + config "./tn.config" + + when { + process { + """ + input[0] = [ + [ id:'test', tumor_id:'tumor', normal_id:'normal' ], + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [] + ] + input[1] = [ // fasta + [ id: 'reference' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [] // pon + input[3] = [] // pon index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( process.out ).match() } + ) + } + + } + + test("human - bam - intervals") { + + when { + process { + """ + input[0] = [ + [ id:'test', tumor_id:'tumor' ], + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [], + [], + file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + ] + input[1] = [ // fasta + [ id: 'reference' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [] // pon + input[3] = [] // pon index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( process.out ).match() } + ) + } + + } + + test("human - bam - tn - intervals") { + + config "./tn.config" + + when { + process { + """ + input[0] = [ + [ id:'test', tumor_id:'tumor', normal_id:'normal'], + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + ] + input[1] = [ // fasta + [ id: 'reference' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [] // pon + input[3] = [] // pon index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( process.out ).match() } + ) + } + + } + + test("human - bam - pon") { + // PON test not passing because the tool expects all chromosomes in the PON file to + // be present in the reference genome. + + config "./pon.config" + + when { + process { + """ + input[0] = [ + [ id:'test', tumor_id:'tumour' ], + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [], + [], + file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + ] + input[1] = [ // fasta + [ id: 'reference' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz'], checkIfExists: true) + input[3] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz_tbi'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( process.out ).match() } + ) + } + + } + + test("human - bam - stub") { + + options '-stub' + + when { + process { + """ + input[0] = [ + [ id:'test', tumor_id:'tumor' ], + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + [], // index only neeeded if using intervals or tumor-normal calling + [], + [], + [] + ] + input[1] = [ // fasta + [ id: 'reference' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [] // pon + input[3] = [] // pon index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( process.out ).match() } + ) + } + + } + +} diff --git a/modules/nf-core/parabricks/mutectcaller/tests/pon.config b/modules/nf-core/parabricks/mutectcaller/tests/pon.config new file mode 100644 index 00000000000..6a9e8c8462c --- /dev/null +++ b/modules/nf-core/parabricks/mutectcaller/tests/pon.config @@ -0,0 +1,6 @@ +process { + + withName: PARABRICKS_MUTECTCALLER { + ext.args = { "--pon $panel_of_normals" } + } +} diff --git a/modules/nf-core/parabricks/mutectcaller/tests/tn.config b/modules/nf-core/parabricks/mutectcaller/tests/tn.config new file mode 100644 index 00000000000..df119772170 --- /dev/null +++ b/modules/nf-core/parabricks/mutectcaller/tests/tn.config @@ -0,0 +1,7 @@ +process { + + withName: PARABRICKS_MUTECTCALLER { + ext.args = { "--in-normal-bam $normal_bam --normal-name $meta.normal_id" } + } + +} diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 55984e2de9e..211d9688989 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -473,9 +473,6 @@ parabricks/haplotypecaller: parabricks/indexgvcf: - modules/nf-core/parabricks/indexgvcf/** - tests/modules/nf-core/parabricks/indexgvcf/** -parabricks/mutectcaller: - - modules/nf-core/parabricks/mutectcaller/** - - tests/modules/nf-core/parabricks/mutectcaller/** paraclu: - modules/nf-core/paraclu/** - tests/modules/nf-core/paraclu/** diff --git a/tests/modules/nf-core/parabricks/mutectcaller/main.nf b/tests/modules/nf-core/parabricks/mutectcaller/main.nf deleted file mode 100644 index 2d4469a5456..00000000000 --- a/tests/modules/nf-core/parabricks/mutectcaller/main.nf +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { PARABRICKS_MUTECTCALLER } from '../../../../../modules/nf-core/parabricks/mutectcaller/main.nf' -include { PARABRICKS_MUTECTCALLER as PARABRICKS_MUTECTCALLER_TN } from '../../../../../modules/nf-core/parabricks/mutectcaller/main.nf' -include { PARABRICKS_MUTECTCALLER as PARABRICKS_MUTECTCALLER_TN_INTERVALS } from '../../../../../modules/nf-core/parabricks/mutectcaller/main.nf' -include { PARABRICKS_MUTECTCALLER as PARABRICKS_MUTECTCALLER_PON } from '../../../../../modules/nf-core/parabricks/mutectcaller/main.nf' - -workflow test_parabricks_mutectcaller { - - input = [ - [ id:'test', tumor_id:'tumour' ], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - [], // index only neeeded if using intervals or tumor-normal calling - [], - [], - [] - ] - fasta = [ - [ id: 'homo_sapiens' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - panel_of_normals = [] - panel_of_normals_index = [] - - PARABRICKS_MUTECTCALLER ( input, fasta, panel_of_normals, panel_of_normals_index ) -} - -// tumor-normal calling not passing because of issue with readgroups in the test files -// [PB Error][src/readers.cpp:1314] ID simulation01 maps to tm_simulation01, but PU is nm_simulation01 (different platform), exiting. -workflow test_parabricks_mutectcaller_tn { - input = [ - [ id:'test', tumor_id:'tumour', normal_id:'normal' ], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - [] - ] - fasta = [ - [ id: 'homo_sapiens' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - panel_of_normals = [] - panel_of_normals_index = [] - - PARABRICKS_MUTECTCALLER_TN ( input, fasta, panel_of_normals, panel_of_normals_index ) -} - -workflow test_parabricks_mutectcaller_intervals { - input = [ - [ id:'test', tumor_id:'tumour' ], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - [], - [], - file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - ] - - fasta = [ - [ id: 'homo_sapiens' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - - panel_of_normals = [] - panel_of_normals_index = [] - - PARABRICKS_MUTECTCALLER ( input, fasta, panel_of_normals, panel_of_normals_index ) -} - -workflow test_parabricks_mutectcaller_tn_intervals { - input = [ - [ id:'test', tumor_id:'tumour', normal_id:'normal'], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - ] - - fasta = [ - [ id: 'homo_sapiens' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - panel_of_normals = [] - panel_of_normals_index = [] - - PARABRICKS_MUTECTCALLER_TN_INTERVALS ( input, fasta, panel_of_normals, panel_of_normals_index ) -} - -// PON test not passing because the tool expects all chromosomes in the PON file to -// be present in the reference genome. -workflow test_parabricks_mutectcaller_pon { - input = [ - [ id:'test', tumor_id:'tumour' ], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - [], - [], - file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - ] - - fasta = [ - [ id: 'homo_sapiens' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - - panel_of_normals = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz'], checkIfExists: true) - panel_of_normals_index = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz_tbi'], checkIfExists: true) - - PARABRICKS_MUTECTCALLER_PON ( input, fasta, panel_of_normals, panel_of_normals_index ) -} diff --git a/tests/modules/nf-core/parabricks/mutectcaller/nextflow.config b/tests/modules/nf-core/parabricks/mutectcaller/nextflow.config deleted file mode 100644 index c3bfea0dc45..00000000000 --- a/tests/modules/nf-core/parabricks/mutectcaller/nextflow.config +++ /dev/null @@ -1,14 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: PARABRICKS_MUTECTCALLER_TN { - ext.args = { "--in-normal-bam $normal_bam --normal-name $meta.normal_id" } - } - withName: PARABRICKS_MUTECTCALLER_TN_INTERVALS { - ext.args = { "--in-normal-bam $normal_bam --normal-name $meta.normal_id" } - } - withName: PARABRICKS_MUTECTCALLER_PON { - ext.args = { "--pon $panel_of_normals" } - } -} diff --git a/tests/modules/nf-core/parabricks/mutectcaller/test.yml b/tests/modules/nf-core/parabricks/mutectcaller/test.yml deleted file mode 100644 index 8674fc02c58..00000000000 --- a/tests/modules/nf-core/parabricks/mutectcaller/test.yml +++ /dev/null @@ -1,61 +0,0 @@ -- name: parabricks mutectcaller test_parabricks_mutectcaller - command: nextflow run ./tests/modules/nf-core/parabricks/mutectcaller -entry test_parabricks_mutectcaller -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/mutectcaller/nextflow.config -stub-run - tags: - - parabricks/mutectcaller - - parabricks - files: - - path: output/parabricks/test.vcf.gz - should_exist: true - - path: output/parabricks/test.vcf.gz.stats - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks mutectcaller test_parabricks_mutectcaller_tn - command: nextflow run ./tests/modules/nf-core/parabricks/mutectcaller -entry test_parabricks_mutectcaller_tn -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/mutectcaller/nextflow.config -stub-run - tags: - - parabricks/mutectcaller - - parabricks - files: - - path: output/parabricks/test.vcf.gz - should_exist: true - - path: output/parabricks/test.vcf.gz.stats - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks mutectcaller test_parabricks_mutectcaller_intervals - command: nextflow run ./tests/modules/nf-core/parabricks/mutectcaller -entry test_parabricks_mutectcaller_intervals -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/mutectcaller/nextflow.config -stub-run - tags: - - parabricks/mutectcaller - - parabricks - files: - - path: output/parabricks/test.vcf.gz - should_exist: true - - path: output/parabricks/test.vcf.gz.stats - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks mutectcaller test_parabricks_mutectcaller_tn_intervals - command: nextflow run ./tests/modules/nf-core/parabricks/mutectcaller -entry test_parabricks_mutectcaller_tn_intervals -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/mutectcaller/nextflow.config -stub-run - tags: - - parabricks/mutectcaller - - parabricks - files: - - path: output/parabricks/test.vcf.gz - should_exist: true - - path: output/parabricks/test.vcf.gz.stats - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks mutectcaller test_parabricks_mutectcaller_pon - command: nextflow run ./tests/modules/nf-core/parabricks/mutectcaller -entry test_parabricks_mutectcaller_pon -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/mutectcaller/nextflow.config -stub-run - tags: - - parabricks/mutectcaller - - parabricks - files: - - path: output/parabricks/test.vcf.gz - should_exist: true - - path: output/parabricks/test_annotated.vcf.gz - should_exist: true - - path: output/parabricks/test.vcf.gz.stats - should_exist: true - - path: output/parabricks/versions.yml diff --git a/tests/modules/nf-core/parabricks/mutectcaller/test_GPU_config.txt b/tests/modules/nf-core/parabricks/mutectcaller/test_GPU_config.txt deleted file mode 100644 index 32b2011adef..00000000000 --- a/tests/modules/nf-core/parabricks/mutectcaller/test_GPU_config.txt +++ /dev/null @@ -1,18 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - memory = "15.GB" - cpus = 4 - accelerator = 1 - withName: PARABRICKS_MUTECTCALLER_TN { - ext.args = { "--in-normal-bam $normal_bam --normal-name $meta.normal_id" } - } - withName: PARABRICKS_MUTECTCALLER_TN_INTERVALS { - ext.args = { "--in-normal-bam $normal_bam --normal-name $meta.normal_id" } - } - withName: PARABRICKS_MUTECTCALLER_PON { - ext.args = { "--pon $panel_of_normals" } - } -} -docker.runOptions = "--gpus all" -singularity.runOptions = "--nv" \ No newline at end of file diff --git a/tests/modules/nf-core/parabricks/mutectcaller/test_GPU_yml.txt b/tests/modules/nf-core/parabricks/mutectcaller/test_GPU_yml.txt deleted file mode 100644 index d06202c8aaa..00000000000 --- a/tests/modules/nf-core/parabricks/mutectcaller/test_GPU_yml.txt +++ /dev/null @@ -1,62 +0,0 @@ -- name: parabricks mutectcaller test_parabricks_mutectcaller - command: nextflow run ./tests/modules/nf-core/parabricks/mutectcaller -entry test_parabricks_mutectcaller -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/mutectcaller/nextflow.config - tags: - - parabricks/mutectcaller - - parabricks - files: - - path: output/parabricks/test.vcf.gz - md5sum: 8c674cd93a83b9e66794db83c9b29926 - - path: output/parabricks/test.vcf.gz.stats - md5sum: c58bc062c6f18d38df3892d15548d8c8 - - path: output/parabricks/versions.yml - -- name: parabricks mutectcaller test_parabricks_mutectcaller_tn - command: nextflow run ./tests/modules/nf-core/parabricks/mutectcaller -entry test_parabricks_mutectcaller_tn -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/mutectcaller/nextflow.config - tags: - - parabricks/mutectcaller - - parabricks - files: - - path: output/parabricks/test.vcf.gz - should_exist: true - - path: output/parabricks/test.vcf.gz.stats - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks mutectcaller test_parabricks_mutectcaller_intervals - command: nextflow run ./tests/modules/nf-core/parabricks/mutectcaller -entry test_parabricks_mutectcaller_intervals -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/mutectcaller/nextflow.config - tags: - - parabricks/mutectcaller - - parabricks - files: - - path: output/parabricks/test.vcf.gz - md5sum: 37fb3c2e9c96df940b5201f66962c79f - - path: output/parabricks/test.vcf.gz.stats - md5sum: 730b6c6fd6c35aa7752c2455e9e50847 - - path: output/parabricks/versions.yml - -- name: parabricks mutectcaller test_parabricks_mutectcaller_tn_intervals - command: nextflow run ./tests/modules/nf-core/parabricks/mutectcaller -entry test_parabricks_mutectcaller_tn_intervals -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/mutectcaller/nextflow.config - tags: - - parabricks/mutectcaller - - parabricks - files: - - path: output/parabricks/test.vcf.gz - should_exist: true - - path: output/parabricks/test.vcf.gz.stats - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks mutectcaller test_parabricks_mutectcaller_pon - command: nextflow run ./tests/modules/nf-core/parabricks/mutectcaller -entry test_parabricks_mutectcaller_pon -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/mutectcaller/nextflow.config - tags: - - parabricks/mutectcaller - - parabricks - files: - - path: output/parabricks/test.vcf.gz - should_exist: true - - path: output/parabricks/test_annotated.vcf.gz - should_exist: true - - path: output/parabricks/test.vcf.gz.stats - should_exist: true - - path: output/parabricks/versions.yml - \ No newline at end of file From fca1546cf6131ac57d9777569d804c8e9862f376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Wed, 13 Nov 2024 12:16:15 +0100 Subject: [PATCH 02/33] change conf --- modules/nf-core/parabricks/mutectcaller/tests/main.nf.test | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test index efa3e4e5ce8..20940ede4ec 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -3,7 +3,6 @@ nextflow_process { name "Test Process PARABRICKS_MUTECTCALLER" script "../main.nf" process "PARABRICKS_MUTECTCALLER" - config "./nextflow.config" tag "modules" tag "parabricks/mutectcaller" From fdd5ce688abc84a1d586c342e8982da106dfcd3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Wed, 13 Nov 2024 12:24:05 +0100 Subject: [PATCH 03/33] add num_gpu --- modules/nf-core/parabricks/mutectcaller/main.nf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/nf-core/parabricks/mutectcaller/main.nf b/modules/nf-core/parabricks/mutectcaller/main.nf index 4758cb14671..0e3ac694e89 100644 --- a/modules/nf-core/parabricks/mutectcaller/main.nf +++ b/modules/nf-core/parabricks/mutectcaller/main.nf @@ -1,6 +1,7 @@ process PARABRICKS_MUTECTCALLER { tag "$meta.id" label 'process_high' + label 'process_gpu' container "nvcr.io/nvidia/clara/clara-parabricks:4.3.0-1" @@ -30,6 +31,7 @@ process PARABRICKS_MUTECTCALLER { def interval_file_command = interval_file ? interval_file.collect{"--interval-file $it"}.join(' ') : "" def prepon_command = panel_of_normals ? "cp -L $panel_of_normals_index `readlink -f $panel_of_normals`.tbi && pbrun prepon --in-pon-file $panel_of_normals" : "" def postpon_command = panel_of_normals ? "pbrun postpon --in-vcf ${prefix}.vcf.gz --in-pon-file $panel_of_normals --out-vcf ${prefix}_annotated.vcf.gz" : "" + def num_gpus = task.accelerator ? "--num-gpus $task.accelerator.request" : '' """ # if panel of normals specified, run prepon @@ -42,7 +44,7 @@ process PARABRICKS_MUTECTCALLER { --tumor-name ${meta.tumor_id} \\ --out-vcf ${prefix}.vcf.gz \\ $interval_file_command \\ - --num-gpus $task.accelerator.request \\ + $num_gpus \\ $args # if panel of normals specified, run postpon From 5fe3310b695c698d0a52862d95f679ea111f3dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Wed, 13 Nov 2024 12:28:18 +0100 Subject: [PATCH 04/33] comment out some tests --- .../nf-core/parabricks/mutectcaller/main.nf | 2 +- .../mutectcaller/tests/main.nf.test | 274 +++++++++--------- 2 files changed, 138 insertions(+), 138 deletions(-) diff --git a/modules/nf-core/parabricks/mutectcaller/main.nf b/modules/nf-core/parabricks/mutectcaller/main.nf index 0e3ac694e89..813184f5107 100644 --- a/modules/nf-core/parabricks/mutectcaller/main.nf +++ b/modules/nf-core/parabricks/mutectcaller/main.nf @@ -3,7 +3,7 @@ process PARABRICKS_MUTECTCALLER { label 'process_high' label 'process_gpu' - container "nvcr.io/nvidia/clara/clara-parabricks:4.3.0-1" + container "nvcr.io/nvidia/clara/clara-parabricks:4.4.0-1" input: tuple val(meta), path(tumor_bam), path(tumor_bam_index), path(normal_bam), path(normal_bam_index), path(interval_file) diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test index 20940ede4ec..e77115ca539 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -41,143 +41,143 @@ nextflow_process { } - test("human - bam - tn") { - // tumor-normal calling not passing because of issue with readgroups in the test files - // [PB Error][src/readers.cpp:1314] ID simulation01 maps to tm_simulation01, but PU is nm_simulation01 (different platform), exiting. - - config "./tn.config" - - when { - process { - """ - input[0] = [ - [ id:'test', tumor_id:'tumor', normal_id:'normal' ], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - [] - ] - input[1] = [ // fasta - [ id: 'reference' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - input[2] = [] // pon - input[3] = [] // pon index - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot( process.out ).match() } - ) - } - - } - - test("human - bam - intervals") { - - when { - process { - """ - input[0] = [ - [ id:'test', tumor_id:'tumor' ], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - [], - [], - file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - ] - input[1] = [ // fasta - [ id: 'reference' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - input[2] = [] // pon - input[3] = [] // pon index - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot( process.out ).match() } - ) - } - - } - - test("human - bam - tn - intervals") { - - config "./tn.config" - - when { - process { - """ - input[0] = [ - [ id:'test', tumor_id:'tumor', normal_id:'normal'], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - ] - input[1] = [ // fasta - [ id: 'reference' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - input[2] = [] // pon - input[3] = [] // pon index - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot( process.out ).match() } - ) - } - - } - - test("human - bam - pon") { - // PON test not passing because the tool expects all chromosomes in the PON file to - // be present in the reference genome. - - config "./pon.config" - - when { - process { - """ - input[0] = [ - [ id:'test', tumor_id:'tumour' ], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - [], - [], - file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - ] - input[1] = [ // fasta - [ id: 'reference' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - input[2] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz'], checkIfExists: true) - input[3] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz_tbi'], checkIfExists: true) - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot( process.out ).match() } - ) - } - - } + // test("human - bam - tn") { + // // tumor-normal calling not passing because of issue with readgroups in the test files + // // [PB Error][src/readers.cpp:1314] ID simulation01 maps to tm_simulation01, but PU is nm_simulation01 (different platform), exiting. + + // config "./tn.config" + + // when { + // process { + // """ + // input[0] = [ + // [ id:'test', tumor_id:'tumor', normal_id:'normal' ], + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // [] + // ] + // input[1] = [ // fasta + // [ id: 'reference' ], + // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + // ] + // input[2] = [] // pon + // input[3] = [] // pon index + // """ + // } + // } + + // then { + // assertAll( + // { assert process.success }, + // { assert snapshot( process.out ).match() } + // ) + // } + + // } + + // test("human - bam - intervals") { + + // when { + // process { + // """ + // input[0] = [ + // [ id:'test', tumor_id:'tumor' ], + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // [], + // [], + // file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + // ] + // input[1] = [ // fasta + // [ id: 'reference' ], + // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + // ] + // input[2] = [] // pon + // input[3] = [] // pon index + // """ + // } + // } + + // then { + // assertAll( + // { assert process.success }, + // { assert snapshot( process.out ).match() } + // ) + // } + + // } + + // test("human - bam - tn - intervals") { + + // config "./tn.config" + + // when { + // process { + // """ + // input[0] = [ + // [ id:'test', tumor_id:'tumor', normal_id:'normal'], + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + // ] + // input[1] = [ // fasta + // [ id: 'reference' ], + // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + // ] + // input[2] = [] // pon + // input[3] = [] // pon index + // """ + // } + // } + + // then { + // assertAll( + // { assert process.success }, + // { assert snapshot( process.out ).match() } + // ) + // } + + // } + + // test("human - bam - pon") { + // // PON test not passing because the tool expects all chromosomes in the PON file to + // // be present in the reference genome. + + // config "./pon.config" + + // when { + // process { + // """ + // input[0] = [ + // [ id:'test', tumor_id:'tumour' ], + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // [], + // [], + // file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + // ] + // input[1] = [ // fasta + // [ id: 'reference' ], + // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + // ] + // input[2] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz'], checkIfExists: true) + // input[3] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz_tbi'], checkIfExists: true) + // """ + // } + // } + + // then { + // assertAll( + // { assert process.success }, + // { assert snapshot( process.out ).match() } + // ) + // } + + // } test("human - bam - stub") { From 409a86efbacec7cf0dd67524e93fa4d12bae181b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Wed, 13 Nov 2024 12:32:01 +0100 Subject: [PATCH 05/33] comment out some tests --- modules/nf-core/parabricks/mutectcaller/main.nf | 2 +- modules/nf-core/parabricks/mutectcaller/tests/main.nf.test | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/parabricks/mutectcaller/main.nf b/modules/nf-core/parabricks/mutectcaller/main.nf index 813184f5107..eb5a8b6a0df 100644 --- a/modules/nf-core/parabricks/mutectcaller/main.nf +++ b/modules/nf-core/parabricks/mutectcaller/main.nf @@ -31,7 +31,7 @@ process PARABRICKS_MUTECTCALLER { def interval_file_command = interval_file ? interval_file.collect{"--interval-file $it"}.join(' ') : "" def prepon_command = panel_of_normals ? "cp -L $panel_of_normals_index `readlink -f $panel_of_normals`.tbi && pbrun prepon --in-pon-file $panel_of_normals" : "" def postpon_command = panel_of_normals ? "pbrun postpon --in-vcf ${prefix}.vcf.gz --in-pon-file $panel_of_normals --out-vcf ${prefix}_annotated.vcf.gz" : "" - def num_gpus = task.accelerator ? "--num-gpus $task.accelerator.request" : '' + def num_gpus = task.accelerator ? "--num-gpus $task.accelerator.request" : "" """ # if panel of normals specified, run prepon diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test index e77115ca539..23eb3ca65bc 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -15,7 +15,7 @@ nextflow_process { process { """ input[0] = [ - [ id:'test', tumor_id:'tumor' ], + [ id:'test', tumor_id:'tumour' ], file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), [], // index only neeeded if using intervals or tumor-normal calling [], @@ -187,7 +187,7 @@ nextflow_process { process { """ input[0] = [ - [ id:'test', tumor_id:'tumor' ], + [ id:'test', tumor_id:'tumour' ], file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), [], // index only neeeded if using intervals or tumor-normal calling [], From 3613eeca2426ad234ae4b5bd925fb6f97aaf310f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Wed, 13 Nov 2024 12:34:12 +0100 Subject: [PATCH 06/33] only stub --- .../mutectcaller/tests/main.nf.test | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test index 23eb3ca65bc..6113577c0b9 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -9,37 +9,37 @@ nextflow_process { tag "modules_nfcore" tag "parabricks" - test("human - bam") { + // test("human - bam") { - when { - process { - """ - input[0] = [ - [ id:'test', tumor_id:'tumour' ], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - [], // index only neeeded if using intervals or tumor-normal calling - [], - [], - [] - ] - input[1] = [ // fasta - [ id: 'reference' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - input[2] = [] // pon - input[3] = [] // pon index - """ - } - } + // when { + // process { + // """ + // input[0] = [ + // [ id:'test', tumor_id:'tumour' ], + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // [], // index only neeeded if using intervals or tumor-normal calling + // [], + // [], + // [] + // ] + // input[1] = [ // fasta + // [ id: 'reference' ], + // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + // ] + // input[2] = [] // pon + // input[3] = [] // pon index + // """ + // } + // } - then { - assertAll( - { assert process.success }, - { assert snapshot( process.out ).match() } - ) - } + // then { + // assertAll( + // { assert process.success }, + // { assert snapshot( process.out ).match() } + // ) + // } - } + // } // test("human - bam - tn") { // // tumor-normal calling not passing because of issue with readgroups in the test files From 9cf060ae36967560794c03e17c072e04b962e1fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Wed, 13 Nov 2024 12:36:22 +0100 Subject: [PATCH 07/33] only stub --- modules/nf-core/parabricks/mutectcaller/main.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/parabricks/mutectcaller/main.nf b/modules/nf-core/parabricks/mutectcaller/main.nf index eb5a8b6a0df..1d5589e1cd0 100644 --- a/modules/nf-core/parabricks/mutectcaller/main.nf +++ b/modules/nf-core/parabricks/mutectcaller/main.nf @@ -59,9 +59,9 @@ process PARABRICKS_MUTECTCALLER { stub: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def postpon_command = panel_of_normals ? "touch ${prefix}_annotated.vcf.gz" : "" + def postpon_command = panel_of_normals ? "echo '' | gzip > ${prefix}_annotated.vcf.gz" : "" """ - touch ${prefix}.vcf.gz + echo "" | gzip > ${prefix}.vcf.gz touch ${prefix}.vcf.gz.stats $postpon_command From a56692a4a98f6166362db47588f8cc2e1be13dfb Mon Sep 17 00:00:00 2001 From: famosab Date: Wed, 13 Nov 2024 12:40:54 +0100 Subject: [PATCH 08/33] stub snap works --- .../mutectcaller/tests/main.nf.test.snap | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap new file mode 100644 index 00000000000..32d281a6e1c --- /dev/null +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap @@ -0,0 +1,55 @@ +{ + "human - bam - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "tumor_id": "tumour" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test", + "tumor_id": "tumour" + }, + "test.vcf.gz.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,ce8c692a50f9b07c076f2e48a29d12bb" + ], + "stats": [ + [ + { + "id": "test", + "tumor_id": "tumour" + }, + "test.vcf.gz.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test", + "tumor_id": "tumour" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,ce8c692a50f9b07c076f2e48a29d12bb" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-13T12:37:04.215535795" + } +} \ No newline at end of file From ae10a6bac760b54b19b7f9031603b3f6b30d7ed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Wed, 13 Nov 2024 12:41:20 +0100 Subject: [PATCH 09/33] add normal test --- .../mutectcaller/tests/main.nf.test | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test index 6113577c0b9..23eb3ca65bc 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -9,37 +9,37 @@ nextflow_process { tag "modules_nfcore" tag "parabricks" - // test("human - bam") { + test("human - bam") { - // when { - // process { - // """ - // input[0] = [ - // [ id:'test', tumor_id:'tumour' ], - // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - // [], // index only neeeded if using intervals or tumor-normal calling - // [], - // [], - // [] - // ] - // input[1] = [ // fasta - // [ id: 'reference' ], - // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - // ] - // input[2] = [] // pon - // input[3] = [] // pon index - // """ - // } - // } + when { + process { + """ + input[0] = [ + [ id:'test', tumor_id:'tumour' ], + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + [], // index only neeeded if using intervals or tumor-normal calling + [], + [], + [] + ] + input[1] = [ // fasta + [ id: 'reference' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [] // pon + input[3] = [] // pon index + """ + } + } - // then { - // assertAll( - // { assert process.success }, - // { assert snapshot( process.out ).match() } - // ) - // } + then { + assertAll( + { assert process.success }, + { assert snapshot( process.out ).match() } + ) + } - // } + } // test("human - bam - tn") { // // tumor-normal calling not passing because of issue with readgroups in the test files From 52cf9bfca74ffa6b68d5d5dc3876e6dfd44f492f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Wed, 13 Nov 2024 12:55:58 +0100 Subject: [PATCH 10/33] low mem --- .../nf-core/parabricks/mutectcaller/tests/lowmem.config | 7 +++++++ modules/nf-core/parabricks/mutectcaller/tests/main.nf.test | 2 ++ modules/nf-core/parabricks/mutectcaller/tests/pon.config | 2 +- modules/nf-core/parabricks/mutectcaller/tests/tn.config | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 modules/nf-core/parabricks/mutectcaller/tests/lowmem.config diff --git a/modules/nf-core/parabricks/mutectcaller/tests/lowmem.config b/modules/nf-core/parabricks/mutectcaller/tests/lowmem.config new file mode 100644 index 00000000000..c2e11ba7832 --- /dev/null +++ b/modules/nf-core/parabricks/mutectcaller/tests/lowmem.config @@ -0,0 +1,7 @@ +process { + + withName: PARABRICKS_MUTECTCALLER { + ext.args = { "--mutect-low-memory" } + } + +} diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test index 23eb3ca65bc..2aab3c85433 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -11,6 +11,8 @@ nextflow_process { test("human - bam") { + config "./lowmem.config" + when { process { """ diff --git a/modules/nf-core/parabricks/mutectcaller/tests/pon.config b/modules/nf-core/parabricks/mutectcaller/tests/pon.config index 6a9e8c8462c..640c18a3a9f 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/pon.config +++ b/modules/nf-core/parabricks/mutectcaller/tests/pon.config @@ -1,6 +1,6 @@ process { withName: PARABRICKS_MUTECTCALLER { - ext.args = { "--pon $panel_of_normals" } + ext.args = { "--pon $panel_of_normals --mutect-low-memory" } } } diff --git a/modules/nf-core/parabricks/mutectcaller/tests/tn.config b/modules/nf-core/parabricks/mutectcaller/tests/tn.config index df119772170..36e89803a54 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/tn.config +++ b/modules/nf-core/parabricks/mutectcaller/tests/tn.config @@ -1,7 +1,7 @@ process { withName: PARABRICKS_MUTECTCALLER { - ext.args = { "--in-normal-bam $normal_bam --normal-name $meta.normal_id" } + ext.args = { "--in-normal-bam $normal_bam --normal-name $meta.normal_id --mutect-low-memory" } } } From 971c2a9611b3233fb0db626430af2c48bdfa4a46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Wed, 13 Nov 2024 13:01:39 +0100 Subject: [PATCH 11/33] add more tests --- .../mutectcaller/tests/main.nf.test | 165 ++++++++++++------ 1 file changed, 107 insertions(+), 58 deletions(-) diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test index 2aab3c85433..05a22a7ae70 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -37,7 +37,11 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( process.out ).match() } + { assert snapshot( + path(process.out.vcf[0][1]).vcf.variantsMD5, + process.out.stats, + process.out.versions + ).match() } ) } @@ -79,71 +83,81 @@ nextflow_process { // } - // test("human - bam - intervals") { + test("human - bam - intervals") { - // when { - // process { - // """ - // input[0] = [ - // [ id:'test', tumor_id:'tumor' ], - // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - // [], - // [], - // file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - // ] - // input[1] = [ // fasta - // [ id: 'reference' ], - // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - // ] - // input[2] = [] // pon - // input[3] = [] // pon index - // """ - // } - // } + config "./lowmem.config" - // then { - // assertAll( - // { assert process.success }, - // { assert snapshot( process.out ).match() } - // ) - // } + when { + process { + """ + input[0] = [ + [ id:'test', tumor_id:'tumor' ], + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [], + [], + file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + ] + input[1] = [ // fasta + [ id: 'reference' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [] // pon + input[3] = [] // pon index + """ + } + } - // } + then { + assertAll( + { assert process.success }, + { assert snapshot( + path(process.out.vcf[0][1]).vcf.variantsMD5, + process.out.stats, + process.out.versions + ).match() } + ) + } - // test("human - bam - tn - intervals") { + } - // config "./tn.config" + test("human - bam - tn - intervals") { - // when { - // process { - // """ - // input[0] = [ - // [ id:'test', tumor_id:'tumor', normal_id:'normal'], - // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - // file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - // ] - // input[1] = [ // fasta - // [ id: 'reference' ], - // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - // ] - // input[2] = [] // pon - // input[3] = [] // pon index - // """ - // } - // } + config "./tn.config" - // then { - // assertAll( - // { assert process.success }, - // { assert snapshot( process.out ).match() } - // ) - // } + when { + process { + """ + input[0] = [ + [ id:'test', tumor_id:'tumor', normal_id:'normal'], + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + ] + input[1] = [ // fasta + [ id: 'reference' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [] // pon + input[3] = [] // pon index + """ + } + } - // } + then { + assertAll( + { assert process.success }, + { assert snapshot( + path(process.out.vcf[0][1]).vcf.variantsMD5, + process.out.stats, + process.out.versions + ).match() } + ) + } + + } // test("human - bam - pon") { // // PON test not passing because the tool expects all chromosomes in the PON file to @@ -215,4 +229,39 @@ nextflow_process { } + test("human - bam - pon - stub") { + + config "./pon.config" + options '-stub' + + when { + process { + """ + input[0] = [ + [ id:'test', tumor_id:'tumour' ], + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [], + [], + file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + ] + input[1] = [ // fasta + [ id: 'reference' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz'], checkIfExists: true) + input[3] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz_tbi'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( process.out ).match() } + ) + } + + } + } From 7d32e00fa1e413c4bd9cf356baafafa79da322ec Mon Sep 17 00:00:00 2001 From: famosab Date: Thu, 14 Nov 2024 11:38:39 +0100 Subject: [PATCH 12/33] wip --- .../mutectcaller/tests/main.nf.test | 164 ++++++++++-------- .../mutectcaller/tests/main.nf.test.snap | 110 ++++++++++++ 2 files changed, 197 insertions(+), 77 deletions(-) diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test index 05a22a7ae70..a17ce908813 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -47,59 +47,26 @@ nextflow_process { } - // test("human - bam - tn") { - // // tumor-normal calling not passing because of issue with readgroups in the test files - // // [PB Error][src/readers.cpp:1314] ID simulation01 maps to tm_simulation01, but PU is nm_simulation01 (different platform), exiting. + test("human - bam - tn") { + // tumor-normal calling not passing because of issue with readgroups in the test files + // [PB Error][src/readers.cpp:1314] ID simulation01 maps to tm_simulation01, but PU is nm_simulation01 (different platform), exiting. - // config "./tn.config" - - // when { - // process { - // """ - // input[0] = [ - // [ id:'test', tumor_id:'tumor', normal_id:'normal' ], - // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - // [] - // ] - // input[1] = [ // fasta - // [ id: 'reference' ], - // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - // ] - // input[2] = [] // pon - // input[3] = [] // pon index - // """ - // } - // } - - // then { - // assertAll( - // { assert process.success }, - // { assert snapshot( process.out ).match() } - // ) - // } - - // } - - test("human - bam - intervals") { - - config "./lowmem.config" + config "./tn.config" when { process { """ input[0] = [ - [ id:'test', tumor_id:'tumor' ], + [ id:'test', tumor_id:'tumour', normal_id:'normal' ], file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - [], - [], - file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [] ] input[1] = [ // fasta - [ id: 'reference' ], + [ id: 'reference' ], //genomics/homo_sapiens/genome/chr21/sequence/genome.fasta + // file() file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) ] input[2] = [] // pon @@ -121,43 +88,82 @@ nextflow_process { } - test("human - bam - tn - intervals") { + // test("human - bam - intervals") { + // // fails because bai is not in stage dir with bam - config "./tn.config" + // config "./lowmem.config" - when { - process { - """ - input[0] = [ - [ id:'test', tumor_id:'tumor', normal_id:'normal'], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - ] - input[1] = [ // fasta - [ id: 'reference' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - input[2] = [] // pon - input[3] = [] // pon index - """ - } - } + // when { + // process { + // """ + // input[0] = [ + // [ id:'test', tumor_id:'tumor' ], + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // [], + // [], + // file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + // ] + // input[1] = [ // fasta + // [ id: 'reference' ], + // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + // ] + // input[2] = [] // pon + // input[3] = [] // pon index + // """ + // } + // } - then { - assertAll( - { assert process.success }, - { assert snapshot( - path(process.out.vcf[0][1]).vcf.variantsMD5, - process.out.stats, - process.out.versions - ).match() } - ) - } + // then { + // assertAll( + // { assert process.success }, + // { assert snapshot( + // path(process.out.vcf[0][1]).vcf.variantsMD5, + // process.out.stats, + // process.out.versions + // ).match() } + // ) + // } - } + // } + + // test("human - bam - tn - intervals") { + + // config "./tn.config" + + // when { + // process { + // """ + // input[0] = [ + // [ id:'test', tumor_id:'tumor', normal_id:'normal'], + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + // ] + // input[1] = [ // fasta + // [ id: 'reference' ], + // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + // ] + // input[2] = [] // pon + // input[3] = [] // pon index + // """ + // } + // } + + // then { + // assertAll( + // { assert process.success }, + // { assert snapshot( + // path(process.out.vcf[0][1]).vcf.variantsMD5, + // process.out.stats, + // process.out.versions + // ).match() } + // ) + // } + + // } // test("human - bam - pon") { // // PON test not passing because the tool expects all chromosomes in the PON file to @@ -189,7 +195,11 @@ nextflow_process { // then { // assertAll( // { assert process.success }, - // { assert snapshot( process.out ).match() } + // { assert snapshot( + // path(process.out.vcf[0][1]).vcf.variantsMD5, + // process.out.stats, + // process.out.versions + // ).match() } // ) // } diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap index 32d281a6e1c..8a7ae38ff3f 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap @@ -1,4 +1,63 @@ { + "human - bam - pon - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "tumor_id": "tumour" + }, + [ + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_annotated.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "tumor_id": "tumour" + }, + "test.vcf.gz.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,ce8c692a50f9b07c076f2e48a29d12bb" + ], + "stats": [ + [ + { + "id": "test", + "tumor_id": "tumour" + }, + "test.vcf.gz.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test", + "tumor_id": "tumour" + }, + [ + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_annotated.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "versions": [ + "versions.yml:md5,ce8c692a50f9b07c076f2e48a29d12bb" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-13T13:03:28.202892679" + }, "human - bam - stub": { "content": [ { @@ -51,5 +110,56 @@ "nextflow": "24.10.0" }, "timestamp": "2024-11-13T12:37:04.215535795" + }, + "human - bam - tn": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "2": [ + + ], + "stats": [ + + ], + "vcf": [ + + ], + "versions": [ + + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-14T11:17:09.23366103" + }, + "human - bam": { + "content": [ + "e9e77b557c40e868547a34dfca4fbd45", + [ + [ + { + "id": "test", + "tumor_id": "tumour" + }, + "test.vcf.gz.stats:md5,c58bc062c6f18d38df3892d15548d8c8" + ] + ], + [ + "versions.yml:md5,ce8c692a50f9b07c076f2e48a29d12bb" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-13T13:02:31.029364594" } } \ No newline at end of file From d240c884c7d83b6ba8776e300383029b5a76dfd7 Mon Sep 17 00:00:00 2001 From: famosab Date: Thu, 14 Nov 2024 11:55:24 +0100 Subject: [PATCH 13/33] add working tests --- .../mutectcaller/tests/lowmem.config | 1 + .../mutectcaller/tests/main.nf.test | 99 ++++++++++--------- .../mutectcaller/tests/main.nf.test.snap | 35 +++---- .../parabricks/mutectcaller/tests/tn.config | 1 + 4 files changed, 66 insertions(+), 70 deletions(-) diff --git a/modules/nf-core/parabricks/mutectcaller/tests/lowmem.config b/modules/nf-core/parabricks/mutectcaller/tests/lowmem.config index c2e11ba7832..c71ebb536ef 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/lowmem.config +++ b/modules/nf-core/parabricks/mutectcaller/tests/lowmem.config @@ -2,6 +2,7 @@ process { withName: PARABRICKS_MUTECTCALLER { ext.args = { "--mutect-low-memory" } + stageInMode = 'copy' } } diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test index a17ce908813..fa70eb120c0 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -47,65 +47,26 @@ nextflow_process { } - test("human - bam - tn") { - // tumor-normal calling not passing because of issue with readgroups in the test files - // [PB Error][src/readers.cpp:1314] ID simulation01 maps to tm_simulation01, but PU is nm_simulation01 (different platform), exiting. + // test("human - bam - tn") { + // // tumor-normal calling not passing because of issue with readgroups in the test files + // // [PB Error][src/readers.cpp:1314] ID simulation01 maps to tm_simulation01, but PU is nm_simulation01 (different platform), exiting. - config "./tn.config" - - when { - process { - """ - input[0] = [ - [ id:'test', tumor_id:'tumour', normal_id:'normal' ], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - [] - ] - input[1] = [ // fasta - [ id: 'reference' ], //genomics/homo_sapiens/genome/chr21/sequence/genome.fasta - // file() - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - input[2] = [] // pon - input[3] = [] // pon index - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot( - path(process.out.vcf[0][1]).vcf.variantsMD5, - process.out.stats, - process.out.versions - ).match() } - ) - } - - } - - // test("human - bam - intervals") { - // // fails because bai is not in stage dir with bam - - // config "./lowmem.config" + // config "./tn.config" // when { // process { // """ // input[0] = [ - // [ id:'test', tumor_id:'tumor' ], + // [ id:'test', tumor_id:'tumour', normal_id:'normal' ], // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - // [], - // [], - // file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // [] // ] // input[1] = [ // fasta - // [ id: 'reference' ], + // [ id: 'reference' ], //genomics/homo_sapiens/genome/chr21/sequence/genome.fasta + // // file() // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) // ] // input[2] = [] // pon @@ -127,7 +88,47 @@ nextflow_process { // } + test("human - bam - intervals") { + + config "./lowmem.config" + + when { + process { + """ + input[0] = [ + [ id:'test', tumor_id:'tumour' ], + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [], + [], + file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + ] + input[1] = [ // fasta + [ id: 'reference' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [] // pon + input[3] = [] // pon index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + path(process.out.vcf[0][1]).vcf.variantsMD5, + process.out.stats, + process.out.versions + ).match() } + ) + } + + } + // test("human - bam - tn - intervals") { + // // tumor-normal calling not passing because of issue with readgroups in the test files + // // [PB Error][src/readers.cpp:1314] ID simulation01 maps to tm_simulation01, but PU is nm_simulation01 (different platform), exiting. // config "./tn.config" diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap index 8a7ae38ff3f..7a84586d618 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap @@ -111,34 +111,27 @@ }, "timestamp": "2024-11-13T12:37:04.215535795" }, - "human - bam - tn": { + "human - bam - intervals": { "content": [ - { - "0": [ - - ], - "1": [ - - ], - "2": [ - - ], - "stats": [ - - ], - "vcf": [ - - ], - "versions": [ - + "e7a67bdfa88e542bc73b02bce45be059", + [ + [ + { + "id": "test", + "tumor_id": "tumour" + }, + "test.vcf.gz.stats:md5,730b6c6fd6c35aa7752c2455e9e50847" ] - } + ], + [ + "versions.yml:md5,ce8c692a50f9b07c076f2e48a29d12bb" + ] ], "meta": { "nf-test": "0.9.2", "nextflow": "24.10.0" }, - "timestamp": "2024-11-14T11:17:09.23366103" + "timestamp": "2024-11-14T11:51:57.596573105" }, "human - bam": { "content": [ diff --git a/modules/nf-core/parabricks/mutectcaller/tests/tn.config b/modules/nf-core/parabricks/mutectcaller/tests/tn.config index 36e89803a54..ed4de17f475 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/tn.config +++ b/modules/nf-core/parabricks/mutectcaller/tests/tn.config @@ -2,6 +2,7 @@ process { withName: PARABRICKS_MUTECTCALLER { ext.args = { "--in-normal-bam $normal_bam --normal-name $meta.normal_id --mutect-low-memory" } + stageInMode = 'copy' } } From d48fee6880ef09929b13b18ac2d7a8416bac0fc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Fri, 15 Nov 2024 09:46:35 +0100 Subject: [PATCH 14/33] update test --- .../mutectcaller/tests/main.nf.test | 90 ++++++++++++------- 1 file changed, 57 insertions(+), 33 deletions(-) diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test index fa70eb120c0..e33a032617e 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -88,44 +88,68 @@ nextflow_process { // } - test("human - bam - intervals") { + // test("human - bam - intervals") { - config "./lowmem.config" + // config "./lowmem.config" - when { - process { - """ - input[0] = [ - [ id:'test', tumor_id:'tumour' ], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - [], - [], - file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - ] - input[1] = [ // fasta - [ id: 'reference' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - input[2] = [] // pon - input[3] = [] // pon index - """ - } - } + // when { + // process { + // """ + // input[0] = [ + // [ id:'test', tumor_id:'tumor' ], + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // [], + // [], + // file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + // ] + // input[1] = [ // fasta + // [ id: 'reference' ], + // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + // ] + // input[2] = [] // pon + // input[3] = [] // pon index + // """ + // } + // } - then { - assertAll( - { assert process.success }, - { assert snapshot( - path(process.out.vcf[0][1]).vcf.variantsMD5, - process.out.stats, - process.out.versions - ).match() } - ) - } + // then { + // assertAll( + // { assert process.success }, + // { assert snapshot( + // path(process.out.vcf[0][1]).vcf.variantsMD5, + // process.out.stats, + // process.out.versions + // ).match() } + // ) + // } - } + // } + // test("human - bam - tn - intervals") { + + // config "./tn.config" + + // when { + // process { + // """ + // input[0] = [ + // [ id:'test', tumor_id:'tumor', normal_id:'normal'], + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + // ] + // input[1] = [ // fasta + // [ id: 'reference' ], + // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + // ] + // input[2] = [] // pon + // input[3] = [] // pon index + // """ + // } + // } // test("human - bam - tn - intervals") { // // tumor-normal calling not passing because of issue with readgroups in the test files // // [PB Error][src/readers.cpp:1314] ID simulation01 maps to tm_simulation01, but PU is nm_simulation01 (different platform), exiting. From 511280a11b38db93866f18c021e4e09dd3da8ee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Mon, 18 Nov 2024 11:24:54 +0100 Subject: [PATCH 15/33] update test yaml --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 736b2c9eae9..6a7fe9a5190 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -662,6 +662,7 @@ jobs: - path: modules/nf-core/parabricks/fq2bammeth - path: modules/nf-core/parabricks/fq2bam - path: modules/nf-core/parabricks/applybqsr + - path: modules/nf-core/parabricks/mutectcaller - profile: conda path: modules/nf-core/xeniumranger/relabel - profile: conda @@ -698,6 +699,8 @@ jobs: profile: [docker_self_hosted, singularity] - path: modules/nf-core/parabricks/fq2bammeth profile: [docker_self_hosted, singularity] + - path: modules/nf-core/parabricks/mutectcaller + profile: [docker_self_hosted, singularity] env: NXF_ANSI_LOG: false From 413da910cde9a43332f2b427353bc0e59bea49ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Wed, 13 Nov 2024 10:30:02 +0100 Subject: [PATCH 16/33] port to nf-test --- .../mutectcaller/tests/main.nf.test | 217 ++++++++++++++++++ .../parabricks/mutectcaller/tests/pon.config | 6 + .../parabricks/mutectcaller/tests/tn.config | 7 + tests/config/pytest_modules.yml | 3 - .../nf-core/parabricks/mutectcaller/main.nf | 113 --------- .../parabricks/mutectcaller/nextflow.config | 14 -- .../nf-core/parabricks/mutectcaller/test.yml | 61 ----- .../mutectcaller/test_GPU_config.txt | 18 -- .../parabricks/mutectcaller/test_GPU_yml.txt | 62 ----- 9 files changed, 230 insertions(+), 271 deletions(-) create mode 100644 modules/nf-core/parabricks/mutectcaller/tests/main.nf.test create mode 100644 modules/nf-core/parabricks/mutectcaller/tests/pon.config create mode 100644 modules/nf-core/parabricks/mutectcaller/tests/tn.config delete mode 100644 tests/modules/nf-core/parabricks/mutectcaller/main.nf delete mode 100644 tests/modules/nf-core/parabricks/mutectcaller/nextflow.config delete mode 100644 tests/modules/nf-core/parabricks/mutectcaller/test.yml delete mode 100644 tests/modules/nf-core/parabricks/mutectcaller/test_GPU_config.txt delete mode 100644 tests/modules/nf-core/parabricks/mutectcaller/test_GPU_yml.txt diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test new file mode 100644 index 00000000000..efa3e4e5ce8 --- /dev/null +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -0,0 +1,217 @@ +nextflow_process { + + name "Test Process PARABRICKS_MUTECTCALLER" + script "../main.nf" + process "PARABRICKS_MUTECTCALLER" + config "./nextflow.config" + + tag "modules" + tag "parabricks/mutectcaller" + tag "modules_nfcore" + tag "parabricks" + + test("human - bam") { + + when { + process { + """ + input[0] = [ + [ id:'test', tumor_id:'tumor' ], + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + [], // index only neeeded if using intervals or tumor-normal calling + [], + [], + [] + ] + input[1] = [ // fasta + [ id: 'reference' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [] // pon + input[3] = [] // pon index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( process.out ).match() } + ) + } + + } + + test("human - bam - tn") { + // tumor-normal calling not passing because of issue with readgroups in the test files + // [PB Error][src/readers.cpp:1314] ID simulation01 maps to tm_simulation01, but PU is nm_simulation01 (different platform), exiting. + + config "./tn.config" + + when { + process { + """ + input[0] = [ + [ id:'test', tumor_id:'tumor', normal_id:'normal' ], + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [] + ] + input[1] = [ // fasta + [ id: 'reference' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [] // pon + input[3] = [] // pon index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( process.out ).match() } + ) + } + + } + + test("human - bam - intervals") { + + when { + process { + """ + input[0] = [ + [ id:'test', tumor_id:'tumor' ], + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [], + [], + file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + ] + input[1] = [ // fasta + [ id: 'reference' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [] // pon + input[3] = [] // pon index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( process.out ).match() } + ) + } + + } + + test("human - bam - tn - intervals") { + + config "./tn.config" + + when { + process { + """ + input[0] = [ + [ id:'test', tumor_id:'tumor', normal_id:'normal'], + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + ] + input[1] = [ // fasta + [ id: 'reference' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [] // pon + input[3] = [] // pon index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( process.out ).match() } + ) + } + + } + + test("human - bam - pon") { + // PON test not passing because the tool expects all chromosomes in the PON file to + // be present in the reference genome. + + config "./pon.config" + + when { + process { + """ + input[0] = [ + [ id:'test', tumor_id:'tumour' ], + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [], + [], + file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + ] + input[1] = [ // fasta + [ id: 'reference' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz'], checkIfExists: true) + input[3] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz_tbi'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( process.out ).match() } + ) + } + + } + + test("human - bam - stub") { + + options '-stub' + + when { + process { + """ + input[0] = [ + [ id:'test', tumor_id:'tumor' ], + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + [], // index only neeeded if using intervals or tumor-normal calling + [], + [], + [] + ] + input[1] = [ // fasta + [ id: 'reference' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [] // pon + input[3] = [] // pon index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( process.out ).match() } + ) + } + + } + +} diff --git a/modules/nf-core/parabricks/mutectcaller/tests/pon.config b/modules/nf-core/parabricks/mutectcaller/tests/pon.config new file mode 100644 index 00000000000..6a9e8c8462c --- /dev/null +++ b/modules/nf-core/parabricks/mutectcaller/tests/pon.config @@ -0,0 +1,6 @@ +process { + + withName: PARABRICKS_MUTECTCALLER { + ext.args = { "--pon $panel_of_normals" } + } +} diff --git a/modules/nf-core/parabricks/mutectcaller/tests/tn.config b/modules/nf-core/parabricks/mutectcaller/tests/tn.config new file mode 100644 index 00000000000..df119772170 --- /dev/null +++ b/modules/nf-core/parabricks/mutectcaller/tests/tn.config @@ -0,0 +1,7 @@ +process { + + withName: PARABRICKS_MUTECTCALLER { + ext.args = { "--in-normal-bam $normal_bam --normal-name $meta.normal_id" } + } + +} diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 0bd8e7cfa63..79fed6cf697 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -428,9 +428,6 @@ parabricks/haplotypecaller: parabricks/indexgvcf: - modules/nf-core/parabricks/indexgvcf/** - tests/modules/nf-core/parabricks/indexgvcf/** -parabricks/mutectcaller: - - modules/nf-core/parabricks/mutectcaller/** - - tests/modules/nf-core/parabricks/mutectcaller/** paraclu: - modules/nf-core/paraclu/** - tests/modules/nf-core/paraclu/** diff --git a/tests/modules/nf-core/parabricks/mutectcaller/main.nf b/tests/modules/nf-core/parabricks/mutectcaller/main.nf deleted file mode 100644 index 2d4469a5456..00000000000 --- a/tests/modules/nf-core/parabricks/mutectcaller/main.nf +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { PARABRICKS_MUTECTCALLER } from '../../../../../modules/nf-core/parabricks/mutectcaller/main.nf' -include { PARABRICKS_MUTECTCALLER as PARABRICKS_MUTECTCALLER_TN } from '../../../../../modules/nf-core/parabricks/mutectcaller/main.nf' -include { PARABRICKS_MUTECTCALLER as PARABRICKS_MUTECTCALLER_TN_INTERVALS } from '../../../../../modules/nf-core/parabricks/mutectcaller/main.nf' -include { PARABRICKS_MUTECTCALLER as PARABRICKS_MUTECTCALLER_PON } from '../../../../../modules/nf-core/parabricks/mutectcaller/main.nf' - -workflow test_parabricks_mutectcaller { - - input = [ - [ id:'test', tumor_id:'tumour' ], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - [], // index only neeeded if using intervals or tumor-normal calling - [], - [], - [] - ] - fasta = [ - [ id: 'homo_sapiens' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - panel_of_normals = [] - panel_of_normals_index = [] - - PARABRICKS_MUTECTCALLER ( input, fasta, panel_of_normals, panel_of_normals_index ) -} - -// tumor-normal calling not passing because of issue with readgroups in the test files -// [PB Error][src/readers.cpp:1314] ID simulation01 maps to tm_simulation01, but PU is nm_simulation01 (different platform), exiting. -workflow test_parabricks_mutectcaller_tn { - input = [ - [ id:'test', tumor_id:'tumour', normal_id:'normal' ], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - [] - ] - fasta = [ - [ id: 'homo_sapiens' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - panel_of_normals = [] - panel_of_normals_index = [] - - PARABRICKS_MUTECTCALLER_TN ( input, fasta, panel_of_normals, panel_of_normals_index ) -} - -workflow test_parabricks_mutectcaller_intervals { - input = [ - [ id:'test', tumor_id:'tumour' ], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - [], - [], - file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - ] - - fasta = [ - [ id: 'homo_sapiens' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - - panel_of_normals = [] - panel_of_normals_index = [] - - PARABRICKS_MUTECTCALLER ( input, fasta, panel_of_normals, panel_of_normals_index ) -} - -workflow test_parabricks_mutectcaller_tn_intervals { - input = [ - [ id:'test', tumor_id:'tumour', normal_id:'normal'], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - ] - - fasta = [ - [ id: 'homo_sapiens' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - panel_of_normals = [] - panel_of_normals_index = [] - - PARABRICKS_MUTECTCALLER_TN_INTERVALS ( input, fasta, panel_of_normals, panel_of_normals_index ) -} - -// PON test not passing because the tool expects all chromosomes in the PON file to -// be present in the reference genome. -workflow test_parabricks_mutectcaller_pon { - input = [ - [ id:'test', tumor_id:'tumour' ], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - [], - [], - file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - ] - - fasta = [ - [ id: 'homo_sapiens' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - - panel_of_normals = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz'], checkIfExists: true) - panel_of_normals_index = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz_tbi'], checkIfExists: true) - - PARABRICKS_MUTECTCALLER_PON ( input, fasta, panel_of_normals, panel_of_normals_index ) -} diff --git a/tests/modules/nf-core/parabricks/mutectcaller/nextflow.config b/tests/modules/nf-core/parabricks/mutectcaller/nextflow.config deleted file mode 100644 index c3bfea0dc45..00000000000 --- a/tests/modules/nf-core/parabricks/mutectcaller/nextflow.config +++ /dev/null @@ -1,14 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: PARABRICKS_MUTECTCALLER_TN { - ext.args = { "--in-normal-bam $normal_bam --normal-name $meta.normal_id" } - } - withName: PARABRICKS_MUTECTCALLER_TN_INTERVALS { - ext.args = { "--in-normal-bam $normal_bam --normal-name $meta.normal_id" } - } - withName: PARABRICKS_MUTECTCALLER_PON { - ext.args = { "--pon $panel_of_normals" } - } -} diff --git a/tests/modules/nf-core/parabricks/mutectcaller/test.yml b/tests/modules/nf-core/parabricks/mutectcaller/test.yml deleted file mode 100644 index 8674fc02c58..00000000000 --- a/tests/modules/nf-core/parabricks/mutectcaller/test.yml +++ /dev/null @@ -1,61 +0,0 @@ -- name: parabricks mutectcaller test_parabricks_mutectcaller - command: nextflow run ./tests/modules/nf-core/parabricks/mutectcaller -entry test_parabricks_mutectcaller -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/mutectcaller/nextflow.config -stub-run - tags: - - parabricks/mutectcaller - - parabricks - files: - - path: output/parabricks/test.vcf.gz - should_exist: true - - path: output/parabricks/test.vcf.gz.stats - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks mutectcaller test_parabricks_mutectcaller_tn - command: nextflow run ./tests/modules/nf-core/parabricks/mutectcaller -entry test_parabricks_mutectcaller_tn -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/mutectcaller/nextflow.config -stub-run - tags: - - parabricks/mutectcaller - - parabricks - files: - - path: output/parabricks/test.vcf.gz - should_exist: true - - path: output/parabricks/test.vcf.gz.stats - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks mutectcaller test_parabricks_mutectcaller_intervals - command: nextflow run ./tests/modules/nf-core/parabricks/mutectcaller -entry test_parabricks_mutectcaller_intervals -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/mutectcaller/nextflow.config -stub-run - tags: - - parabricks/mutectcaller - - parabricks - files: - - path: output/parabricks/test.vcf.gz - should_exist: true - - path: output/parabricks/test.vcf.gz.stats - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks mutectcaller test_parabricks_mutectcaller_tn_intervals - command: nextflow run ./tests/modules/nf-core/parabricks/mutectcaller -entry test_parabricks_mutectcaller_tn_intervals -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/mutectcaller/nextflow.config -stub-run - tags: - - parabricks/mutectcaller - - parabricks - files: - - path: output/parabricks/test.vcf.gz - should_exist: true - - path: output/parabricks/test.vcf.gz.stats - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks mutectcaller test_parabricks_mutectcaller_pon - command: nextflow run ./tests/modules/nf-core/parabricks/mutectcaller -entry test_parabricks_mutectcaller_pon -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/mutectcaller/nextflow.config -stub-run - tags: - - parabricks/mutectcaller - - parabricks - files: - - path: output/parabricks/test.vcf.gz - should_exist: true - - path: output/parabricks/test_annotated.vcf.gz - should_exist: true - - path: output/parabricks/test.vcf.gz.stats - should_exist: true - - path: output/parabricks/versions.yml diff --git a/tests/modules/nf-core/parabricks/mutectcaller/test_GPU_config.txt b/tests/modules/nf-core/parabricks/mutectcaller/test_GPU_config.txt deleted file mode 100644 index 32b2011adef..00000000000 --- a/tests/modules/nf-core/parabricks/mutectcaller/test_GPU_config.txt +++ /dev/null @@ -1,18 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - memory = "15.GB" - cpus = 4 - accelerator = 1 - withName: PARABRICKS_MUTECTCALLER_TN { - ext.args = { "--in-normal-bam $normal_bam --normal-name $meta.normal_id" } - } - withName: PARABRICKS_MUTECTCALLER_TN_INTERVALS { - ext.args = { "--in-normal-bam $normal_bam --normal-name $meta.normal_id" } - } - withName: PARABRICKS_MUTECTCALLER_PON { - ext.args = { "--pon $panel_of_normals" } - } -} -docker.runOptions = "--gpus all" -singularity.runOptions = "--nv" \ No newline at end of file diff --git a/tests/modules/nf-core/parabricks/mutectcaller/test_GPU_yml.txt b/tests/modules/nf-core/parabricks/mutectcaller/test_GPU_yml.txt deleted file mode 100644 index d06202c8aaa..00000000000 --- a/tests/modules/nf-core/parabricks/mutectcaller/test_GPU_yml.txt +++ /dev/null @@ -1,62 +0,0 @@ -- name: parabricks mutectcaller test_parabricks_mutectcaller - command: nextflow run ./tests/modules/nf-core/parabricks/mutectcaller -entry test_parabricks_mutectcaller -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/mutectcaller/nextflow.config - tags: - - parabricks/mutectcaller - - parabricks - files: - - path: output/parabricks/test.vcf.gz - md5sum: 8c674cd93a83b9e66794db83c9b29926 - - path: output/parabricks/test.vcf.gz.stats - md5sum: c58bc062c6f18d38df3892d15548d8c8 - - path: output/parabricks/versions.yml - -- name: parabricks mutectcaller test_parabricks_mutectcaller_tn - command: nextflow run ./tests/modules/nf-core/parabricks/mutectcaller -entry test_parabricks_mutectcaller_tn -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/mutectcaller/nextflow.config - tags: - - parabricks/mutectcaller - - parabricks - files: - - path: output/parabricks/test.vcf.gz - should_exist: true - - path: output/parabricks/test.vcf.gz.stats - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks mutectcaller test_parabricks_mutectcaller_intervals - command: nextflow run ./tests/modules/nf-core/parabricks/mutectcaller -entry test_parabricks_mutectcaller_intervals -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/mutectcaller/nextflow.config - tags: - - parabricks/mutectcaller - - parabricks - files: - - path: output/parabricks/test.vcf.gz - md5sum: 37fb3c2e9c96df940b5201f66962c79f - - path: output/parabricks/test.vcf.gz.stats - md5sum: 730b6c6fd6c35aa7752c2455e9e50847 - - path: output/parabricks/versions.yml - -- name: parabricks mutectcaller test_parabricks_mutectcaller_tn_intervals - command: nextflow run ./tests/modules/nf-core/parabricks/mutectcaller -entry test_parabricks_mutectcaller_tn_intervals -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/mutectcaller/nextflow.config - tags: - - parabricks/mutectcaller - - parabricks - files: - - path: output/parabricks/test.vcf.gz - should_exist: true - - path: output/parabricks/test.vcf.gz.stats - should_exist: true - - path: output/parabricks/versions.yml - -- name: parabricks mutectcaller test_parabricks_mutectcaller_pon - command: nextflow run ./tests/modules/nf-core/parabricks/mutectcaller -entry test_parabricks_mutectcaller_pon -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/parabricks/mutectcaller/nextflow.config - tags: - - parabricks/mutectcaller - - parabricks - files: - - path: output/parabricks/test.vcf.gz - should_exist: true - - path: output/parabricks/test_annotated.vcf.gz - should_exist: true - - path: output/parabricks/test.vcf.gz.stats - should_exist: true - - path: output/parabricks/versions.yml - \ No newline at end of file From 47c8910da373ed978d27ea8d9c1dd0747d02f89b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Wed, 13 Nov 2024 12:16:15 +0100 Subject: [PATCH 17/33] change conf --- modules/nf-core/parabricks/mutectcaller/tests/main.nf.test | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test index efa3e4e5ce8..20940ede4ec 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -3,7 +3,6 @@ nextflow_process { name "Test Process PARABRICKS_MUTECTCALLER" script "../main.nf" process "PARABRICKS_MUTECTCALLER" - config "./nextflow.config" tag "modules" tag "parabricks/mutectcaller" From d7f5501e267e191e2c92eaea640958d13c1eca90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Wed, 13 Nov 2024 12:24:05 +0100 Subject: [PATCH 18/33] add num_gpu --- modules/nf-core/parabricks/mutectcaller/main.nf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/nf-core/parabricks/mutectcaller/main.nf b/modules/nf-core/parabricks/mutectcaller/main.nf index 4758cb14671..0e3ac694e89 100644 --- a/modules/nf-core/parabricks/mutectcaller/main.nf +++ b/modules/nf-core/parabricks/mutectcaller/main.nf @@ -1,6 +1,7 @@ process PARABRICKS_MUTECTCALLER { tag "$meta.id" label 'process_high' + label 'process_gpu' container "nvcr.io/nvidia/clara/clara-parabricks:4.3.0-1" @@ -30,6 +31,7 @@ process PARABRICKS_MUTECTCALLER { def interval_file_command = interval_file ? interval_file.collect{"--interval-file $it"}.join(' ') : "" def prepon_command = panel_of_normals ? "cp -L $panel_of_normals_index `readlink -f $panel_of_normals`.tbi && pbrun prepon --in-pon-file $panel_of_normals" : "" def postpon_command = panel_of_normals ? "pbrun postpon --in-vcf ${prefix}.vcf.gz --in-pon-file $panel_of_normals --out-vcf ${prefix}_annotated.vcf.gz" : "" + def num_gpus = task.accelerator ? "--num-gpus $task.accelerator.request" : '' """ # if panel of normals specified, run prepon @@ -42,7 +44,7 @@ process PARABRICKS_MUTECTCALLER { --tumor-name ${meta.tumor_id} \\ --out-vcf ${prefix}.vcf.gz \\ $interval_file_command \\ - --num-gpus $task.accelerator.request \\ + $num_gpus \\ $args # if panel of normals specified, run postpon From 16d1f20778976f68ecec2408da805e450d1dd40c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Wed, 13 Nov 2024 12:28:18 +0100 Subject: [PATCH 19/33] comment out some tests --- .../nf-core/parabricks/mutectcaller/main.nf | 2 +- .../mutectcaller/tests/main.nf.test | 274 +++++++++--------- 2 files changed, 138 insertions(+), 138 deletions(-) diff --git a/modules/nf-core/parabricks/mutectcaller/main.nf b/modules/nf-core/parabricks/mutectcaller/main.nf index 0e3ac694e89..813184f5107 100644 --- a/modules/nf-core/parabricks/mutectcaller/main.nf +++ b/modules/nf-core/parabricks/mutectcaller/main.nf @@ -3,7 +3,7 @@ process PARABRICKS_MUTECTCALLER { label 'process_high' label 'process_gpu' - container "nvcr.io/nvidia/clara/clara-parabricks:4.3.0-1" + container "nvcr.io/nvidia/clara/clara-parabricks:4.4.0-1" input: tuple val(meta), path(tumor_bam), path(tumor_bam_index), path(normal_bam), path(normal_bam_index), path(interval_file) diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test index 20940ede4ec..e77115ca539 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -41,143 +41,143 @@ nextflow_process { } - test("human - bam - tn") { - // tumor-normal calling not passing because of issue with readgroups in the test files - // [PB Error][src/readers.cpp:1314] ID simulation01 maps to tm_simulation01, but PU is nm_simulation01 (different platform), exiting. - - config "./tn.config" - - when { - process { - """ - input[0] = [ - [ id:'test', tumor_id:'tumor', normal_id:'normal' ], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - [] - ] - input[1] = [ // fasta - [ id: 'reference' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - input[2] = [] // pon - input[3] = [] // pon index - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot( process.out ).match() } - ) - } - - } - - test("human - bam - intervals") { - - when { - process { - """ - input[0] = [ - [ id:'test', tumor_id:'tumor' ], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - [], - [], - file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - ] - input[1] = [ // fasta - [ id: 'reference' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - input[2] = [] // pon - input[3] = [] // pon index - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot( process.out ).match() } - ) - } - - } - - test("human - bam - tn - intervals") { - - config "./tn.config" - - when { - process { - """ - input[0] = [ - [ id:'test', tumor_id:'tumor', normal_id:'normal'], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - ] - input[1] = [ // fasta - [ id: 'reference' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - input[2] = [] // pon - input[3] = [] // pon index - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot( process.out ).match() } - ) - } - - } - - test("human - bam - pon") { - // PON test not passing because the tool expects all chromosomes in the PON file to - // be present in the reference genome. - - config "./pon.config" - - when { - process { - """ - input[0] = [ - [ id:'test', tumor_id:'tumour' ], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - [], - [], - file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - ] - input[1] = [ // fasta - [ id: 'reference' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - input[2] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz'], checkIfExists: true) - input[3] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz_tbi'], checkIfExists: true) - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot( process.out ).match() } - ) - } - - } + // test("human - bam - tn") { + // // tumor-normal calling not passing because of issue with readgroups in the test files + // // [PB Error][src/readers.cpp:1314] ID simulation01 maps to tm_simulation01, but PU is nm_simulation01 (different platform), exiting. + + // config "./tn.config" + + // when { + // process { + // """ + // input[0] = [ + // [ id:'test', tumor_id:'tumor', normal_id:'normal' ], + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // [] + // ] + // input[1] = [ // fasta + // [ id: 'reference' ], + // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + // ] + // input[2] = [] // pon + // input[3] = [] // pon index + // """ + // } + // } + + // then { + // assertAll( + // { assert process.success }, + // { assert snapshot( process.out ).match() } + // ) + // } + + // } + + // test("human - bam - intervals") { + + // when { + // process { + // """ + // input[0] = [ + // [ id:'test', tumor_id:'tumor' ], + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // [], + // [], + // file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + // ] + // input[1] = [ // fasta + // [ id: 'reference' ], + // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + // ] + // input[2] = [] // pon + // input[3] = [] // pon index + // """ + // } + // } + + // then { + // assertAll( + // { assert process.success }, + // { assert snapshot( process.out ).match() } + // ) + // } + + // } + + // test("human - bam - tn - intervals") { + + // config "./tn.config" + + // when { + // process { + // """ + // input[0] = [ + // [ id:'test', tumor_id:'tumor', normal_id:'normal'], + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + // ] + // input[1] = [ // fasta + // [ id: 'reference' ], + // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + // ] + // input[2] = [] // pon + // input[3] = [] // pon index + // """ + // } + // } + + // then { + // assertAll( + // { assert process.success }, + // { assert snapshot( process.out ).match() } + // ) + // } + + // } + + // test("human - bam - pon") { + // // PON test not passing because the tool expects all chromosomes in the PON file to + // // be present in the reference genome. + + // config "./pon.config" + + // when { + // process { + // """ + // input[0] = [ + // [ id:'test', tumor_id:'tumour' ], + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // [], + // [], + // file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + // ] + // input[1] = [ // fasta + // [ id: 'reference' ], + // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + // ] + // input[2] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz'], checkIfExists: true) + // input[3] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz_tbi'], checkIfExists: true) + // """ + // } + // } + + // then { + // assertAll( + // { assert process.success }, + // { assert snapshot( process.out ).match() } + // ) + // } + + // } test("human - bam - stub") { From d738f102af568a8b42092f9e097ad9a0afa6df2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Wed, 13 Nov 2024 12:32:01 +0100 Subject: [PATCH 20/33] comment out some tests --- modules/nf-core/parabricks/mutectcaller/main.nf | 2 +- modules/nf-core/parabricks/mutectcaller/tests/main.nf.test | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/parabricks/mutectcaller/main.nf b/modules/nf-core/parabricks/mutectcaller/main.nf index 813184f5107..eb5a8b6a0df 100644 --- a/modules/nf-core/parabricks/mutectcaller/main.nf +++ b/modules/nf-core/parabricks/mutectcaller/main.nf @@ -31,7 +31,7 @@ process PARABRICKS_MUTECTCALLER { def interval_file_command = interval_file ? interval_file.collect{"--interval-file $it"}.join(' ') : "" def prepon_command = panel_of_normals ? "cp -L $panel_of_normals_index `readlink -f $panel_of_normals`.tbi && pbrun prepon --in-pon-file $panel_of_normals" : "" def postpon_command = panel_of_normals ? "pbrun postpon --in-vcf ${prefix}.vcf.gz --in-pon-file $panel_of_normals --out-vcf ${prefix}_annotated.vcf.gz" : "" - def num_gpus = task.accelerator ? "--num-gpus $task.accelerator.request" : '' + def num_gpus = task.accelerator ? "--num-gpus $task.accelerator.request" : "" """ # if panel of normals specified, run prepon diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test index e77115ca539..23eb3ca65bc 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -15,7 +15,7 @@ nextflow_process { process { """ input[0] = [ - [ id:'test', tumor_id:'tumor' ], + [ id:'test', tumor_id:'tumour' ], file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), [], // index only neeeded if using intervals or tumor-normal calling [], @@ -187,7 +187,7 @@ nextflow_process { process { """ input[0] = [ - [ id:'test', tumor_id:'tumor' ], + [ id:'test', tumor_id:'tumour' ], file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), [], // index only neeeded if using intervals or tumor-normal calling [], From 0a70e996bbfd6c6da3e9fa653d0fcdcbcdf5aa52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Wed, 13 Nov 2024 12:34:12 +0100 Subject: [PATCH 21/33] only stub --- .../mutectcaller/tests/main.nf.test | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test index 23eb3ca65bc..6113577c0b9 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -9,37 +9,37 @@ nextflow_process { tag "modules_nfcore" tag "parabricks" - test("human - bam") { + // test("human - bam") { - when { - process { - """ - input[0] = [ - [ id:'test', tumor_id:'tumour' ], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - [], // index only neeeded if using intervals or tumor-normal calling - [], - [], - [] - ] - input[1] = [ // fasta - [ id: 'reference' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - input[2] = [] // pon - input[3] = [] // pon index - """ - } - } + // when { + // process { + // """ + // input[0] = [ + // [ id:'test', tumor_id:'tumour' ], + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // [], // index only neeeded if using intervals or tumor-normal calling + // [], + // [], + // [] + // ] + // input[1] = [ // fasta + // [ id: 'reference' ], + // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + // ] + // input[2] = [] // pon + // input[3] = [] // pon index + // """ + // } + // } - then { - assertAll( - { assert process.success }, - { assert snapshot( process.out ).match() } - ) - } + // then { + // assertAll( + // { assert process.success }, + // { assert snapshot( process.out ).match() } + // ) + // } - } + // } // test("human - bam - tn") { // // tumor-normal calling not passing because of issue with readgroups in the test files From 79373997a42c1d93153c1c0464d03229c2537f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Wed, 13 Nov 2024 12:36:22 +0100 Subject: [PATCH 22/33] only stub --- modules/nf-core/parabricks/mutectcaller/main.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/parabricks/mutectcaller/main.nf b/modules/nf-core/parabricks/mutectcaller/main.nf index eb5a8b6a0df..1d5589e1cd0 100644 --- a/modules/nf-core/parabricks/mutectcaller/main.nf +++ b/modules/nf-core/parabricks/mutectcaller/main.nf @@ -59,9 +59,9 @@ process PARABRICKS_MUTECTCALLER { stub: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def postpon_command = panel_of_normals ? "touch ${prefix}_annotated.vcf.gz" : "" + def postpon_command = panel_of_normals ? "echo '' | gzip > ${prefix}_annotated.vcf.gz" : "" """ - touch ${prefix}.vcf.gz + echo "" | gzip > ${prefix}.vcf.gz touch ${prefix}.vcf.gz.stats $postpon_command From 28451501f88ac8e4ef78e0dff9da08c5958b47d0 Mon Sep 17 00:00:00 2001 From: famosab Date: Wed, 13 Nov 2024 12:40:54 +0100 Subject: [PATCH 23/33] stub snap works --- .../mutectcaller/tests/main.nf.test.snap | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap new file mode 100644 index 00000000000..32d281a6e1c --- /dev/null +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap @@ -0,0 +1,55 @@ +{ + "human - bam - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "tumor_id": "tumour" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test", + "tumor_id": "tumour" + }, + "test.vcf.gz.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,ce8c692a50f9b07c076f2e48a29d12bb" + ], + "stats": [ + [ + { + "id": "test", + "tumor_id": "tumour" + }, + "test.vcf.gz.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test", + "tumor_id": "tumour" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,ce8c692a50f9b07c076f2e48a29d12bb" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-13T12:37:04.215535795" + } +} \ No newline at end of file From 46618742a4e43fea30c8f17f94b0193bb27cb1c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Wed, 13 Nov 2024 12:41:20 +0100 Subject: [PATCH 24/33] add normal test --- .../mutectcaller/tests/main.nf.test | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test index 6113577c0b9..23eb3ca65bc 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -9,37 +9,37 @@ nextflow_process { tag "modules_nfcore" tag "parabricks" - // test("human - bam") { + test("human - bam") { - // when { - // process { - // """ - // input[0] = [ - // [ id:'test', tumor_id:'tumour' ], - // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - // [], // index only neeeded if using intervals or tumor-normal calling - // [], - // [], - // [] - // ] - // input[1] = [ // fasta - // [ id: 'reference' ], - // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - // ] - // input[2] = [] // pon - // input[3] = [] // pon index - // """ - // } - // } + when { + process { + """ + input[0] = [ + [ id:'test', tumor_id:'tumour' ], + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + [], // index only neeeded if using intervals or tumor-normal calling + [], + [], + [] + ] + input[1] = [ // fasta + [ id: 'reference' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [] // pon + input[3] = [] // pon index + """ + } + } - // then { - // assertAll( - // { assert process.success }, - // { assert snapshot( process.out ).match() } - // ) - // } + then { + assertAll( + { assert process.success }, + { assert snapshot( process.out ).match() } + ) + } - // } + } // test("human - bam - tn") { // // tumor-normal calling not passing because of issue with readgroups in the test files From d404aa910bf173b052109382550c2c779aac6e90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Wed, 13 Nov 2024 12:55:58 +0100 Subject: [PATCH 25/33] low mem --- .../nf-core/parabricks/mutectcaller/tests/lowmem.config | 7 +++++++ modules/nf-core/parabricks/mutectcaller/tests/main.nf.test | 2 ++ modules/nf-core/parabricks/mutectcaller/tests/pon.config | 2 +- modules/nf-core/parabricks/mutectcaller/tests/tn.config | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 modules/nf-core/parabricks/mutectcaller/tests/lowmem.config diff --git a/modules/nf-core/parabricks/mutectcaller/tests/lowmem.config b/modules/nf-core/parabricks/mutectcaller/tests/lowmem.config new file mode 100644 index 00000000000..c2e11ba7832 --- /dev/null +++ b/modules/nf-core/parabricks/mutectcaller/tests/lowmem.config @@ -0,0 +1,7 @@ +process { + + withName: PARABRICKS_MUTECTCALLER { + ext.args = { "--mutect-low-memory" } + } + +} diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test index 23eb3ca65bc..2aab3c85433 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -11,6 +11,8 @@ nextflow_process { test("human - bam") { + config "./lowmem.config" + when { process { """ diff --git a/modules/nf-core/parabricks/mutectcaller/tests/pon.config b/modules/nf-core/parabricks/mutectcaller/tests/pon.config index 6a9e8c8462c..640c18a3a9f 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/pon.config +++ b/modules/nf-core/parabricks/mutectcaller/tests/pon.config @@ -1,6 +1,6 @@ process { withName: PARABRICKS_MUTECTCALLER { - ext.args = { "--pon $panel_of_normals" } + ext.args = { "--pon $panel_of_normals --mutect-low-memory" } } } diff --git a/modules/nf-core/parabricks/mutectcaller/tests/tn.config b/modules/nf-core/parabricks/mutectcaller/tests/tn.config index df119772170..36e89803a54 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/tn.config +++ b/modules/nf-core/parabricks/mutectcaller/tests/tn.config @@ -1,7 +1,7 @@ process { withName: PARABRICKS_MUTECTCALLER { - ext.args = { "--in-normal-bam $normal_bam --normal-name $meta.normal_id" } + ext.args = { "--in-normal-bam $normal_bam --normal-name $meta.normal_id --mutect-low-memory" } } } From bc93c651d5188d29dc8ecbc131f0cf46ffe56165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Wed, 13 Nov 2024 13:01:39 +0100 Subject: [PATCH 26/33] add more tests --- .../mutectcaller/tests/main.nf.test | 165 ++++++++++++------ 1 file changed, 107 insertions(+), 58 deletions(-) diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test index 2aab3c85433..05a22a7ae70 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -37,7 +37,11 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( process.out ).match() } + { assert snapshot( + path(process.out.vcf[0][1]).vcf.variantsMD5, + process.out.stats, + process.out.versions + ).match() } ) } @@ -79,71 +83,81 @@ nextflow_process { // } - // test("human - bam - intervals") { + test("human - bam - intervals") { - // when { - // process { - // """ - // input[0] = [ - // [ id:'test', tumor_id:'tumor' ], - // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - // [], - // [], - // file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - // ] - // input[1] = [ // fasta - // [ id: 'reference' ], - // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - // ] - // input[2] = [] // pon - // input[3] = [] // pon index - // """ - // } - // } + config "./lowmem.config" - // then { - // assertAll( - // { assert process.success }, - // { assert snapshot( process.out ).match() } - // ) - // } + when { + process { + """ + input[0] = [ + [ id:'test', tumor_id:'tumor' ], + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [], + [], + file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + ] + input[1] = [ // fasta + [ id: 'reference' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [] // pon + input[3] = [] // pon index + """ + } + } - // } + then { + assertAll( + { assert process.success }, + { assert snapshot( + path(process.out.vcf[0][1]).vcf.variantsMD5, + process.out.stats, + process.out.versions + ).match() } + ) + } - // test("human - bam - tn - intervals") { + } - // config "./tn.config" + test("human - bam - tn - intervals") { - // when { - // process { - // """ - // input[0] = [ - // [ id:'test', tumor_id:'tumor', normal_id:'normal'], - // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - // file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - // ] - // input[1] = [ // fasta - // [ id: 'reference' ], - // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - // ] - // input[2] = [] // pon - // input[3] = [] // pon index - // """ - // } - // } + config "./tn.config" - // then { - // assertAll( - // { assert process.success }, - // { assert snapshot( process.out ).match() } - // ) - // } + when { + process { + """ + input[0] = [ + [ id:'test', tumor_id:'tumor', normal_id:'normal'], + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + ] + input[1] = [ // fasta + [ id: 'reference' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [] // pon + input[3] = [] // pon index + """ + } + } - // } + then { + assertAll( + { assert process.success }, + { assert snapshot( + path(process.out.vcf[0][1]).vcf.variantsMD5, + process.out.stats, + process.out.versions + ).match() } + ) + } + + } // test("human - bam - pon") { // // PON test not passing because the tool expects all chromosomes in the PON file to @@ -215,4 +229,39 @@ nextflow_process { } + test("human - bam - pon - stub") { + + config "./pon.config" + options '-stub' + + when { + process { + """ + input[0] = [ + [ id:'test', tumor_id:'tumour' ], + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [], + [], + file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + ] + input[1] = [ // fasta + [ id: 'reference' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz'], checkIfExists: true) + input[3] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz_tbi'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( process.out ).match() } + ) + } + + } + } From acf65aff2ebe5fef4125f491162807e938e649bf Mon Sep 17 00:00:00 2001 From: famosab Date: Thu, 14 Nov 2024 11:38:39 +0100 Subject: [PATCH 27/33] wip --- .../mutectcaller/tests/main.nf.test | 164 ++++++++++-------- .../mutectcaller/tests/main.nf.test.snap | 110 ++++++++++++ 2 files changed, 197 insertions(+), 77 deletions(-) diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test index 05a22a7ae70..a17ce908813 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -47,59 +47,26 @@ nextflow_process { } - // test("human - bam - tn") { - // // tumor-normal calling not passing because of issue with readgroups in the test files - // // [PB Error][src/readers.cpp:1314] ID simulation01 maps to tm_simulation01, but PU is nm_simulation01 (different platform), exiting. + test("human - bam - tn") { + // tumor-normal calling not passing because of issue with readgroups in the test files + // [PB Error][src/readers.cpp:1314] ID simulation01 maps to tm_simulation01, but PU is nm_simulation01 (different platform), exiting. - // config "./tn.config" - - // when { - // process { - // """ - // input[0] = [ - // [ id:'test', tumor_id:'tumor', normal_id:'normal' ], - // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - // [] - // ] - // input[1] = [ // fasta - // [ id: 'reference' ], - // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - // ] - // input[2] = [] // pon - // input[3] = [] // pon index - // """ - // } - // } - - // then { - // assertAll( - // { assert process.success }, - // { assert snapshot( process.out ).match() } - // ) - // } - - // } - - test("human - bam - intervals") { - - config "./lowmem.config" + config "./tn.config" when { process { """ input[0] = [ - [ id:'test', tumor_id:'tumor' ], + [ id:'test', tumor_id:'tumour', normal_id:'normal' ], file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - [], - [], - file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [] ] input[1] = [ // fasta - [ id: 'reference' ], + [ id: 'reference' ], //genomics/homo_sapiens/genome/chr21/sequence/genome.fasta + // file() file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) ] input[2] = [] // pon @@ -121,43 +88,82 @@ nextflow_process { } - test("human - bam - tn - intervals") { + // test("human - bam - intervals") { + // // fails because bai is not in stage dir with bam - config "./tn.config" + // config "./lowmem.config" - when { - process { - """ - input[0] = [ - [ id:'test', tumor_id:'tumor', normal_id:'normal'], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - ] - input[1] = [ // fasta - [ id: 'reference' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - input[2] = [] // pon - input[3] = [] // pon index - """ - } - } + // when { + // process { + // """ + // input[0] = [ + // [ id:'test', tumor_id:'tumor' ], + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // [], + // [], + // file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + // ] + // input[1] = [ // fasta + // [ id: 'reference' ], + // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + // ] + // input[2] = [] // pon + // input[3] = [] // pon index + // """ + // } + // } - then { - assertAll( - { assert process.success }, - { assert snapshot( - path(process.out.vcf[0][1]).vcf.variantsMD5, - process.out.stats, - process.out.versions - ).match() } - ) - } + // then { + // assertAll( + // { assert process.success }, + // { assert snapshot( + // path(process.out.vcf[0][1]).vcf.variantsMD5, + // process.out.stats, + // process.out.versions + // ).match() } + // ) + // } - } + // } + + // test("human - bam - tn - intervals") { + + // config "./tn.config" + + // when { + // process { + // """ + // input[0] = [ + // [ id:'test', tumor_id:'tumor', normal_id:'normal'], + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + // ] + // input[1] = [ // fasta + // [ id: 'reference' ], + // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + // ] + // input[2] = [] // pon + // input[3] = [] // pon index + // """ + // } + // } + + // then { + // assertAll( + // { assert process.success }, + // { assert snapshot( + // path(process.out.vcf[0][1]).vcf.variantsMD5, + // process.out.stats, + // process.out.versions + // ).match() } + // ) + // } + + // } // test("human - bam - pon") { // // PON test not passing because the tool expects all chromosomes in the PON file to @@ -189,7 +195,11 @@ nextflow_process { // then { // assertAll( // { assert process.success }, - // { assert snapshot( process.out ).match() } + // { assert snapshot( + // path(process.out.vcf[0][1]).vcf.variantsMD5, + // process.out.stats, + // process.out.versions + // ).match() } // ) // } diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap index 32d281a6e1c..8a7ae38ff3f 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap @@ -1,4 +1,63 @@ { + "human - bam - pon - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "tumor_id": "tumour" + }, + [ + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_annotated.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "tumor_id": "tumour" + }, + "test.vcf.gz.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,ce8c692a50f9b07c076f2e48a29d12bb" + ], + "stats": [ + [ + { + "id": "test", + "tumor_id": "tumour" + }, + "test.vcf.gz.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test", + "tumor_id": "tumour" + }, + [ + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_annotated.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "versions": [ + "versions.yml:md5,ce8c692a50f9b07c076f2e48a29d12bb" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-13T13:03:28.202892679" + }, "human - bam - stub": { "content": [ { @@ -51,5 +110,56 @@ "nextflow": "24.10.0" }, "timestamp": "2024-11-13T12:37:04.215535795" + }, + "human - bam - tn": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "2": [ + + ], + "stats": [ + + ], + "vcf": [ + + ], + "versions": [ + + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-14T11:17:09.23366103" + }, + "human - bam": { + "content": [ + "e9e77b557c40e868547a34dfca4fbd45", + [ + [ + { + "id": "test", + "tumor_id": "tumour" + }, + "test.vcf.gz.stats:md5,c58bc062c6f18d38df3892d15548d8c8" + ] + ], + [ + "versions.yml:md5,ce8c692a50f9b07c076f2e48a29d12bb" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-13T13:02:31.029364594" } } \ No newline at end of file From a2faa76949480062b5fea212f270ac52b9759336 Mon Sep 17 00:00:00 2001 From: famosab Date: Thu, 14 Nov 2024 11:55:24 +0100 Subject: [PATCH 28/33] add working tests --- .../mutectcaller/tests/lowmem.config | 1 + .../mutectcaller/tests/main.nf.test | 99 ++++++++++--------- .../mutectcaller/tests/main.nf.test.snap | 35 +++---- .../parabricks/mutectcaller/tests/tn.config | 1 + 4 files changed, 66 insertions(+), 70 deletions(-) diff --git a/modules/nf-core/parabricks/mutectcaller/tests/lowmem.config b/modules/nf-core/parabricks/mutectcaller/tests/lowmem.config index c2e11ba7832..c71ebb536ef 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/lowmem.config +++ b/modules/nf-core/parabricks/mutectcaller/tests/lowmem.config @@ -2,6 +2,7 @@ process { withName: PARABRICKS_MUTECTCALLER { ext.args = { "--mutect-low-memory" } + stageInMode = 'copy' } } diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test index a17ce908813..fa70eb120c0 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -47,65 +47,26 @@ nextflow_process { } - test("human - bam - tn") { - // tumor-normal calling not passing because of issue with readgroups in the test files - // [PB Error][src/readers.cpp:1314] ID simulation01 maps to tm_simulation01, but PU is nm_simulation01 (different platform), exiting. + // test("human - bam - tn") { + // // tumor-normal calling not passing because of issue with readgroups in the test files + // // [PB Error][src/readers.cpp:1314] ID simulation01 maps to tm_simulation01, but PU is nm_simulation01 (different platform), exiting. - config "./tn.config" - - when { - process { - """ - input[0] = [ - [ id:'test', tumor_id:'tumour', normal_id:'normal' ], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - [] - ] - input[1] = [ // fasta - [ id: 'reference' ], //genomics/homo_sapiens/genome/chr21/sequence/genome.fasta - // file() - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - input[2] = [] // pon - input[3] = [] // pon index - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot( - path(process.out.vcf[0][1]).vcf.variantsMD5, - process.out.stats, - process.out.versions - ).match() } - ) - } - - } - - // test("human - bam - intervals") { - // // fails because bai is not in stage dir with bam - - // config "./lowmem.config" + // config "./tn.config" // when { // process { // """ // input[0] = [ - // [ id:'test', tumor_id:'tumor' ], + // [ id:'test', tumor_id:'tumour', normal_id:'normal' ], // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - // [], - // [], - // file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // [] // ] // input[1] = [ // fasta - // [ id: 'reference' ], + // [ id: 'reference' ], //genomics/homo_sapiens/genome/chr21/sequence/genome.fasta + // // file() // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) // ] // input[2] = [] // pon @@ -127,7 +88,47 @@ nextflow_process { // } + test("human - bam - intervals") { + + config "./lowmem.config" + + when { + process { + """ + input[0] = [ + [ id:'test', tumor_id:'tumour' ], + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [], + [], + file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + ] + input[1] = [ // fasta + [ id: 'reference' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [] // pon + input[3] = [] // pon index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + path(process.out.vcf[0][1]).vcf.variantsMD5, + process.out.stats, + process.out.versions + ).match() } + ) + } + + } + // test("human - bam - tn - intervals") { + // // tumor-normal calling not passing because of issue with readgroups in the test files + // // [PB Error][src/readers.cpp:1314] ID simulation01 maps to tm_simulation01, but PU is nm_simulation01 (different platform), exiting. // config "./tn.config" diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap index 8a7ae38ff3f..7a84586d618 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap @@ -111,34 +111,27 @@ }, "timestamp": "2024-11-13T12:37:04.215535795" }, - "human - bam - tn": { + "human - bam - intervals": { "content": [ - { - "0": [ - - ], - "1": [ - - ], - "2": [ - - ], - "stats": [ - - ], - "vcf": [ - - ], - "versions": [ - + "e7a67bdfa88e542bc73b02bce45be059", + [ + [ + { + "id": "test", + "tumor_id": "tumour" + }, + "test.vcf.gz.stats:md5,730b6c6fd6c35aa7752c2455e9e50847" ] - } + ], + [ + "versions.yml:md5,ce8c692a50f9b07c076f2e48a29d12bb" + ] ], "meta": { "nf-test": "0.9.2", "nextflow": "24.10.0" }, - "timestamp": "2024-11-14T11:17:09.23366103" + "timestamp": "2024-11-14T11:51:57.596573105" }, "human - bam": { "content": [ diff --git a/modules/nf-core/parabricks/mutectcaller/tests/tn.config b/modules/nf-core/parabricks/mutectcaller/tests/tn.config index 36e89803a54..ed4de17f475 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/tn.config +++ b/modules/nf-core/parabricks/mutectcaller/tests/tn.config @@ -2,6 +2,7 @@ process { withName: PARABRICKS_MUTECTCALLER { ext.args = { "--in-normal-bam $normal_bam --normal-name $meta.normal_id --mutect-low-memory" } + stageInMode = 'copy' } } From 8b6eced735b7047bfd0901bca192ccd02da6f9cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Fri, 15 Nov 2024 09:46:35 +0100 Subject: [PATCH 29/33] update test --- .../mutectcaller/tests/main.nf.test | 90 ++++++++++++------- 1 file changed, 57 insertions(+), 33 deletions(-) diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test index fa70eb120c0..e33a032617e 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -88,44 +88,68 @@ nextflow_process { // } - test("human - bam - intervals") { + // test("human - bam - intervals") { - config "./lowmem.config" + // config "./lowmem.config" - when { - process { - """ - input[0] = [ - [ id:'test', tumor_id:'tumour' ], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - [], - [], - file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - ] - input[1] = [ // fasta - [ id: 'reference' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - input[2] = [] // pon - input[3] = [] // pon index - """ - } - } + // when { + // process { + // """ + // input[0] = [ + // [ id:'test', tumor_id:'tumor' ], + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // [], + // [], + // file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + // ] + // input[1] = [ // fasta + // [ id: 'reference' ], + // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + // ] + // input[2] = [] // pon + // input[3] = [] // pon index + // """ + // } + // } - then { - assertAll( - { assert process.success }, - { assert snapshot( - path(process.out.vcf[0][1]).vcf.variantsMD5, - process.out.stats, - process.out.versions - ).match() } - ) - } + // then { + // assertAll( + // { assert process.success }, + // { assert snapshot( + // path(process.out.vcf[0][1]).vcf.variantsMD5, + // process.out.stats, + // process.out.versions + // ).match() } + // ) + // } - } + // } + // test("human - bam - tn - intervals") { + + // config "./tn.config" + + // when { + // process { + // """ + // input[0] = [ + // [ id:'test', tumor_id:'tumor', normal_id:'normal'], + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + // file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + // ] + // input[1] = [ // fasta + // [ id: 'reference' ], + // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + // ] + // input[2] = [] // pon + // input[3] = [] // pon index + // """ + // } + // } // test("human - bam - tn - intervals") { // // tumor-normal calling not passing because of issue with readgroups in the test files // // [PB Error][src/readers.cpp:1314] ID simulation01 maps to tm_simulation01, but PU is nm_simulation01 (different platform), exiting. From 64111125bf55d2bba7fde135e2c34ffb53faebe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Mon, 2 Dec 2024 13:45:25 +0100 Subject: [PATCH 30/33] add to conda_skip --- .github/conda_skip.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/conda_skip.yml b/.github/conda_skip.yml index 2ef7216da3e..942dc4bf23b 100644 --- a/.github/conda_skip.yml +++ b/.github/conda_skip.yml @@ -182,3 +182,5 @@ exclude: path: modules/nf-core/xeniumranger/resegment - profile: conda path: modules/nf-core/xeniumranger/import-segmentation + - profile: conda + path: modules/nf-core/parabricks/mutectcaller From 99eee96ceda812346d905d30b0fcae0cf588b212 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Mon, 2 Dec 2024 13:55:13 +0100 Subject: [PATCH 31/33] add tag gpu --- modules/nf-core/parabricks/mutectcaller/tests/main.nf.test | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test index 72ae2eccd1b..8ac31273025 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -8,6 +8,7 @@ nextflow_process { tag "parabricks/mutectcaller" tag "modules_nfcore" tag "parabricks" + tag "gpu" test("human - bam") { From 8a96f48b60af40252432032f6a1f5be49025c7e5 Mon Sep 17 00:00:00 2001 From: famosab Date: Mon, 9 Dec 2024 15:44:27 +0100 Subject: [PATCH 32/33] update snap --- .../mutectcaller/tests/main.nf.test | 30 ------------------- .../mutectcaller/tests/main.nf.test.snap | 22 -------------- 2 files changed, 52 deletions(-) diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test index 8ac31273025..478b23a93a0 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -134,36 +134,6 @@ nextflow_process { // ) // } - } - - // test("human - bam - tn - intervals") { - - // config "./nextflow.config" - - // when { - // params { - // module_args = "--in-normal-bam $normal_bam --normal-name $meta.normal_id --mutect-low-memory" - // } - // process { - // """ - // input[0] = [ - // [ id:'test', tumor_id:'tumor', normal_id:'normal'], - // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - // file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), - // file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), - // file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - // ] - // input[1] = [ // fasta - // [ id: 'reference' ], - // file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - // ] - // input[2] = [] // pon - // input[3] = [] // pon index - // """ - // } - // } - // } // test("human - bam - tn - intervals") { diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap index 7a84586d618..960bdfae0ed 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap @@ -111,28 +111,6 @@ }, "timestamp": "2024-11-13T12:37:04.215535795" }, - "human - bam - intervals": { - "content": [ - "e7a67bdfa88e542bc73b02bce45be059", - [ - [ - { - "id": "test", - "tumor_id": "tumour" - }, - "test.vcf.gz.stats:md5,730b6c6fd6c35aa7752c2455e9e50847" - ] - ], - [ - "versions.yml:md5,ce8c692a50f9b07c076f2e48a29d12bb" - ] - ], - "meta": { - "nf-test": "0.9.2", - "nextflow": "24.10.0" - }, - "timestamp": "2024-11-14T11:51:57.596573105" - }, "human - bam": { "content": [ "e9e77b557c40e868547a34dfca4fbd45", From 51b03d7dca6ea93b37b051c38742e0f4023d453b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20B=C3=A4uerle?= <45968370+famosab@users.noreply.github.com> Date: Wed, 11 Dec 2024 14:24:53 +0100 Subject: [PATCH 33/33] Apply suggestions from code review --- modules/nf-core/parabricks/mutectcaller/main.nf | 1 + modules/nf-core/parabricks/mutectcaller/tests/nextflow.config | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/parabricks/mutectcaller/main.nf b/modules/nf-core/parabricks/mutectcaller/main.nf index 1d5589e1cd0..cb26790e95f 100644 --- a/modules/nf-core/parabricks/mutectcaller/main.nf +++ b/modules/nf-core/parabricks/mutectcaller/main.nf @@ -2,6 +2,7 @@ process PARABRICKS_MUTECTCALLER { tag "$meta.id" label 'process_high' label 'process_gpu' + stageInMode 'copy' // needed by the module to work properly - can be removed once fixed upstream container "nvcr.io/nvidia/clara/clara-parabricks:4.4.0-1" diff --git a/modules/nf-core/parabricks/mutectcaller/tests/nextflow.config b/modules/nf-core/parabricks/mutectcaller/tests/nextflow.config index 992aa311e49..1335bf3108f 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/nextflow.config +++ b/modules/nf-core/parabricks/mutectcaller/tests/nextflow.config @@ -2,7 +2,6 @@ process { withName: PARABRICKS_MUTECTCALLER { ext.args = params.module_args - stageInMode = 'copy' } }