From 199ba086a259e1933d6e0ab7596e4a977bbd483a Mon Sep 17 00:00:00 2001 From: Luke Paul Buttigieg Date: Thu, 21 Mar 2024 09:23:48 +0000 Subject: [PATCH 01/18] 5234 Migrate deepvariant pytest to NF test (#5269) * 5192 Adding nf-test files * 5234 Adding nf-tests * 5234 Removed pytest files and traces * 5234 fixed formatting * 5234 Updated nf-test * 5234 Tweaked file paths for test data * 5234 Corrected nf-test file * 5234 Corrected config * 5234 Corrected main.ff.test * 5192 Corrected tag file * 5234 fixing snapshot * 5234 fixing snapshot * 5234 fixing snapshot * 5234 fixing snapshot * 5234 Added missing tag * Update modules/nf-core/deepvariant/tests/nextflow-intervals.config Co-authored-by: Maxime U Garcia * 5234 Added missing lines * 5234 Removed publishing of report --------- Co-authored-by: Maxime U Garcia --- .../nf-core/deepvariant/tests/main.nf.test | 117 ++++++++ .../deepvariant/tests/main.nf.test.snap | 269 ++++++++++++++++++ .../tests/nextflow-intervals.config | 8 + .../nf-core/deepvariant/tests/nextflow.config | 8 + modules/nf-core/deepvariant/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 - tests/modules/nf-core/deepvariant/main.nf | 65 ----- .../nf-core/deepvariant/nextflow.config | 14 - tests/modules/nf-core/deepvariant/test.yml | 44 --- 9 files changed, 404 insertions(+), 126 deletions(-) create mode 100644 modules/nf-core/deepvariant/tests/main.nf.test create mode 100644 modules/nf-core/deepvariant/tests/main.nf.test.snap create mode 100644 modules/nf-core/deepvariant/tests/nextflow-intervals.config create mode 100644 modules/nf-core/deepvariant/tests/nextflow.config create mode 100644 modules/nf-core/deepvariant/tests/tags.yml delete mode 100644 tests/modules/nf-core/deepvariant/main.nf delete mode 100644 tests/modules/nf-core/deepvariant/nextflow.config delete mode 100644 tests/modules/nf-core/deepvariant/test.yml diff --git a/modules/nf-core/deepvariant/tests/main.nf.test b/modules/nf-core/deepvariant/tests/main.nf.test new file mode 100644 index 00000000000..91612c1e282 --- /dev/null +++ b/modules/nf-core/deepvariant/tests/main.nf.test @@ -0,0 +1,117 @@ +nextflow_process { + + name "Test Process DEEPVARIANT" + script "../main.nf" + process "DEEPVARIANT" + + tag "deepvariant" + tag "modules" + tag "modules_nfcore" + + test("homo_sapiens - [bam, bai] - fasta - fai") { + when { + config "./nextflow.config" + + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + [] + ] + input[1] = [ + [ id:'genome'], + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + input[2] = [ + [ id:'genome'], + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ] + input[3] = [ + [],[] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("homo_sapiens - [cram, crai, genome_bed] - fasta - fai") { + config "./nextflow-intervals.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true), + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.bed', checkIfExists: true) + ] + input[1] = [ + [ id:'genome'], + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + input[2] = [ + [ id:'genome'], + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ] + input[3] = [ + [],[] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("homo_sapiens - [bam, bai] - fasta_gz - fasta_gz_fai") { + when { + config "./nextflow.config" + + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + [] + ] + input[1] = [ + [ id:'genome'], + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.fasta.gz', checkIfExists: true) + ] + input[2] = [ + [ id:'genome'], + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.fasta.gz.fai', checkIfExists: true) + ] + input[3] = [ + [ id:'genome'], + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.fasta.gz.gzi', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + +} \ No newline at end of file diff --git a/modules/nf-core/deepvariant/tests/main.nf.test.snap b/modules/nf-core/deepvariant/tests/main.nf.test.snap new file mode 100644 index 00000000000..6ad76ae4c3f --- /dev/null +++ b/modules/nf-core/deepvariant/tests/main.nf.test.snap @@ -0,0 +1,269 @@ +{ + "homo_sapiens - [bam, bai] - fasta_gz - fasta_gz_fai": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz:md5,7cba1516f7cf0888765d5ee8caf275f4" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz.tbi:md5,02a78562bc83520a51010a01fb06f217" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz:md5,8d6ac08997bfd848a0a4d9d295e76952" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz.tbi:md5,37e2d8f4cca0a21113cede608f54885a" + ] + ], + "4": [ + "versions.yml:md5,4678f778b58276933b165fe3e84afc6a" + ], + "gvcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz:md5,8d6ac08997bfd848a0a4d9d295e76952" + ] + ], + "gvcf_tbi": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz.tbi:md5,37e2d8f4cca0a21113cede608f54885a" + ] + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz:md5,7cba1516f7cf0888765d5ee8caf275f4" + ] + ], + "vcf_tbi": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz.tbi:md5,02a78562bc83520a51010a01fb06f217" + ] + ], + "versions": [ + "versions.yml:md5,4678f778b58276933b165fe3e84afc6a" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T13:54:42.757335334" + }, + "homo_sapiens - [bam, bai] - fasta - fai": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz:md5,7cba1516f7cf0888765d5ee8caf275f4" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz.tbi:md5,02a78562bc83520a51010a01fb06f217" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz:md5,8d6ac08997bfd848a0a4d9d295e76952" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz.tbi:md5,37e2d8f4cca0a21113cede608f54885a" + ] + ], + "4": [ + "versions.yml:md5,4678f778b58276933b165fe3e84afc6a" + ], + "gvcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz:md5,8d6ac08997bfd848a0a4d9d295e76952" + ] + ], + "gvcf_tbi": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz.tbi:md5,37e2d8f4cca0a21113cede608f54885a" + ] + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz:md5,7cba1516f7cf0888765d5ee8caf275f4" + ] + ], + "vcf_tbi": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz.tbi:md5,02a78562bc83520a51010a01fb06f217" + ] + ], + "versions": [ + "versions.yml:md5,4678f778b58276933b165fe3e84afc6a" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T13:54:18.409489045" + }, + "homo_sapiens - [cram, crai, genome_bed] - fasta - fai": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz:md5,7cba1516f7cf0888765d5ee8caf275f4" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz.tbi:md5,02a78562bc83520a51010a01fb06f217" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz:md5,8d6ac08997bfd848a0a4d9d295e76952" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz.tbi:md5,37e2d8f4cca0a21113cede608f54885a" + ] + ], + "4": [ + "versions.yml:md5,4678f778b58276933b165fe3e84afc6a" + ], + "gvcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz:md5,8d6ac08997bfd848a0a4d9d295e76952" + ] + ], + "gvcf_tbi": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.g.vcf.gz.tbi:md5,37e2d8f4cca0a21113cede608f54885a" + ] + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz:md5,7cba1516f7cf0888765d5ee8caf275f4" + ] + ], + "vcf_tbi": [ + [ + { + "id": "test", + "single_end": false + }, + "test_out.vcf.gz.tbi:md5,02a78562bc83520a51010a01fb06f217" + ] + ], + "versions": [ + "versions.yml:md5,4678f778b58276933b165fe3e84afc6a" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T13:54:30.523871801" + } +} diff --git a/modules/nf-core/deepvariant/tests/nextflow-intervals.config b/modules/nf-core/deepvariant/tests/nextflow-intervals.config new file mode 100644 index 00000000000..6d135f9f109 --- /dev/null +++ b/modules/nf-core/deepvariant/tests/nextflow-intervals.config @@ -0,0 +1,8 @@ +process { + + withName: DEEPVARIANT { + ext.args = '--model_type=WGS ' + ext.prefix = { "${meta.id}_out" } + } + +} diff --git a/modules/nf-core/deepvariant/tests/nextflow.config b/modules/nf-core/deepvariant/tests/nextflow.config new file mode 100644 index 00000000000..d335d30b54f --- /dev/null +++ b/modules/nf-core/deepvariant/tests/nextflow.config @@ -0,0 +1,8 @@ +process { + + withName: DEEPVARIANT { + ext.args = ' --regions=\"chr22:0-40001\" --model_type=WGS ' + ext.prefix = { "${meta.id}_out" } + } + +} diff --git a/modules/nf-core/deepvariant/tests/tags.yml b/modules/nf-core/deepvariant/tests/tags.yml new file mode 100644 index 00000000000..8e838c7ba2a --- /dev/null +++ b/modules/nf-core/deepvariant/tests/tags.yml @@ -0,0 +1,2 @@ +deepvariant: + - modules/nf-core/deepvariant/** diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index a0041246518..af3dafe25bb 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -516,9 +516,6 @@ deeptools/plotpca: deeptools/plotprofile: - modules/nf-core/deeptools/plotprofile/** - tests/modules/nf-core/deeptools/plotprofile/** -deepvariant: - - modules/nf-core/deepvariant/** - - tests/modules/nf-core/deepvariant/** delly/call: - modules/nf-core/delly/call/** - tests/modules/nf-core/delly/call/** diff --git a/tests/modules/nf-core/deepvariant/main.nf b/tests/modules/nf-core/deepvariant/main.nf deleted file mode 100644 index 98b57707c25..00000000000 --- a/tests/modules/nf-core/deepvariant/main.nf +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { DEEPVARIANT } from '../../../../modules/nf-core/deepvariant/main.nf' -include { DEEPVARIANT as DEEPVARIANT_INTERVALS } from '../../../../modules/nf-core/deepvariant/main.nf' - -workflow test_deepvariant { - - bam_tuple_ch = Channel.of([ [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true), - [] - ]) - - fasta = [ [id:'genome'], - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - ] - - fai = [ [id:'genome'], - file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) - ] - - DEEPVARIANT ( bam_tuple_ch, fasta, fai, [[],[]] ) -} - -workflow test_deepvariant_cram_intervals { - - cram_tuple_ch = Channel.of([[ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) - ]) - - fasta = [ [id:'genome'], - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - ] - - fai = [ [id:'genome'], - file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) - ] - - DEEPVARIANT_INTERVALS ( cram_tuple_ch, fasta, fai, [[],[]] ) -} - -workflow test_deepvariant_fasta_gz { - - bam_tuple_ch = Channel.of([ [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true), - [] - ]) - - fasta_gz = [ [id:'genome'], - file(params.test_data['homo_sapiens']['genome']['genome_fasta_gz'], checkIfExists: true) - ] - fasta_gz_fai = [ [id:'genome'], - file(params.test_data['homo_sapiens']['genome']['genome_fasta_gz_fai'], checkIfExists: true) - ] - fasta_gz_gzi = [ [id:'genome'], - file(params.test_data['homo_sapiens']['genome']['genome_fasta_gz_gzi'], checkIfExists: true) - ] - - DEEPVARIANT ( bam_tuple_ch, fasta_gz, fasta_gz_fai, fasta_gz_gzi ) -} diff --git a/tests/modules/nf-core/deepvariant/nextflow.config b/tests/modules/nf-core/deepvariant/nextflow.config deleted file mode 100644 index a7e90c827e3..00000000000 --- a/tests/modules/nf-core/deepvariant/nextflow.config +++ /dev/null @@ -1,14 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: DEEPVARIANT { - ext.args = ' --regions=\"chr22:0-40001\" --model_type=WGS ' - ext.prefix = { "${meta.id}_out" } - } - withName: DEEPVARIANT_INTERVALS { - ext.args = '--model_type=WGS ' - ext.prefix = { "${meta.id}_out" } - } - -} diff --git a/tests/modules/nf-core/deepvariant/test.yml b/tests/modules/nf-core/deepvariant/test.yml deleted file mode 100644 index 8d0ababd446..00000000000 --- a/tests/modules/nf-core/deepvariant/test.yml +++ /dev/null @@ -1,44 +0,0 @@ -- name: deepvariant test_deepvariant - command: nextflow run ./tests/modules/nf-core/deepvariant -entry test_deepvariant -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/deepvariant/nextflow.config - tags: - - deepvariant - files: - - path: output/deepvariant/test_out.g.vcf.gz - md5sum: 7e618a71bfa3bbcec8ba65776b76aabf - - path: output/deepvariant/test_out.g.vcf.gz.tbi - md5sum: 37e2d8f4cca0a21113cede608f54885a - - path: output/deepvariant/test_out.vcf.gz - md5sum: 1d64665ff190619ef84789ebd58002a8 - - path: output/deepvariant/test_out.vcf.gz.tbi - md5sum: 02a78562bc83520a51010a01fb06f217 - - path: output/deepvariant/versions.yml - -- name: deepvariant test_deepvariant_cram_intervals - command: nextflow run ./tests/modules/nf-core/deepvariant -entry test_deepvariant_cram_intervals -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/deepvariant/nextflow.config - tags: - - deepvariant - files: - - path: output/deepvariant/test_out.g.vcf.gz - md5sum: 7e618a71bfa3bbcec8ba65776b76aabf - - path: output/deepvariant/test_out.g.vcf.gz.tbi - md5sum: 37e2d8f4cca0a21113cede608f54885a - - path: output/deepvariant/test_out.vcf.gz - md5sum: 1d64665ff190619ef84789ebd58002a8 - - path: output/deepvariant/test_out.vcf.gz.tbi - md5sum: 02a78562bc83520a51010a01fb06f217 - - path: output/deepvariant/versions.yml - -- name: deepvariant test_deepvariant_fasta_gz - command: nextflow run ./tests/modules/nf-core/deepvariant -entry test_deepvariant_fasta_gz -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/deepvariant/nextflow.config - tags: - - deepvariant - files: - - path: output/deepvariant/test_out.g.vcf.gz - md5sum: 7e618a71bfa3bbcec8ba65776b76aabf - - path: output/deepvariant/test_out.g.vcf.gz.tbi - md5sum: 37e2d8f4cca0a21113cede608f54885a - - path: output/deepvariant/test_out.vcf.gz - md5sum: 1d64665ff190619ef84789ebd58002a8 - - path: output/deepvariant/test_out.vcf.gz.tbi - md5sum: 02a78562bc83520a51010a01fb06f217 - - path: output/deepvariant/versions.yml From 4df6c65b8e185a6b690fabafdc44e663c3f6483f Mon Sep 17 00:00:00 2001 From: Xichen Wu <102925032+wxicu@users.noreply.github.com> Date: Thu, 21 Mar 2024 18:16:38 +0800 Subject: [PATCH 02/18] add popscle/dscpileup module (#5336) * add dscpileup * update tests 1. add file exsistance test 2. change test data path * fix test and add snapshot * align --------- Co-authored-by: Xichen Wu --- .../nf-core/popscle/dscpileup/environment.yml | 9 +++ modules/nf-core/popscle/dscpileup/main.nf | 57 +++++++++++++ modules/nf-core/popscle/dscpileup/meta.yml | 79 +++++++++++++++++++ .../popscle/dscpileup/tests/main.nf.test | 68 ++++++++++++++++ .../popscle/dscpileup/tests/main.nf.test.snap | 26 ++++++ .../nf-core/popscle/dscpileup/tests/tags.yml | 2 + 6 files changed, 241 insertions(+) create mode 100644 modules/nf-core/popscle/dscpileup/environment.yml create mode 100644 modules/nf-core/popscle/dscpileup/main.nf create mode 100644 modules/nf-core/popscle/dscpileup/meta.yml create mode 100644 modules/nf-core/popscle/dscpileup/tests/main.nf.test create mode 100644 modules/nf-core/popscle/dscpileup/tests/main.nf.test.snap create mode 100644 modules/nf-core/popscle/dscpileup/tests/tags.yml diff --git a/modules/nf-core/popscle/dscpileup/environment.yml b/modules/nf-core/popscle/dscpileup/environment.yml new file mode 100644 index 00000000000..469927670a3 --- /dev/null +++ b/modules/nf-core/popscle/dscpileup/environment.yml @@ -0,0 +1,9 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +name: "popscle_dscpileup" +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - "bioconda::popscle=0.1" diff --git a/modules/nf-core/popscle/dscpileup/main.nf b/modules/nf-core/popscle/dscpileup/main.nf new file mode 100644 index 00000000000..2f7fbf3a7fe --- /dev/null +++ b/modules/nf-core/popscle/dscpileup/main.nf @@ -0,0 +1,57 @@ +process POPSCLE_DSCPILEUP { + tag "$meta.id" + label 'process_medium' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/popscle:0.1beta--h2c78cec_0' : + 'biocontainers/popscle:0.1beta--h2c78cec_0' }" + + input: + tuple val(meta), path(bam), path(vcf) + + output: + tuple val(meta), path('*.cel.gz'), emit: cel + tuple val(meta), path('*.plp.gz'), emit: plp + tuple val(meta), path('*.var.gz'), emit: var + tuple val(meta), path('*.umi.gz'), emit: umi + path 'versions.yml' , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '0.1' // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. + + """ + popscle dsc-pileup \\ + --sam $bam \\ + --vcf $vcf \\ + --out $prefix \\ + $args \\ + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + popscle dsc-pileup: $VERSION + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '0.1' // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. + + """ + touch ${prefix}.cel.gz + touch ${prefix}.var.gz + touch ${prefix}.plp.gz + touch ${prefix}.umi.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + popscle dsc-pileup: $VERSION + END_VERSIONS + """ +} diff --git a/modules/nf-core/popscle/dscpileup/meta.yml b/modules/nf-core/popscle/dscpileup/meta.yml new file mode 100644 index 00000000000..234a1830759 --- /dev/null +++ b/modules/nf-core/popscle/dscpileup/meta.yml @@ -0,0 +1,79 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "popscle_dscpileup" +description: Software to pileup reads and corresponding base quality for each overlapping SNPs and each barcode. +keywords: + - popscle + - demultiplexing + - genotype-based deconvoltion + - single cell + - pile up +tools: + - "popscle": + description: "A suite of population scale analysis tools for single-cell genomics data including implementation of Demuxlet / Freemuxlet methods and auxilary tools" + homepage: "https://github.com/statgen/popscle" + documentation: "https://github.com/statgen/popscle" + tool_dev_url: "https://github.com/statgen/popscle" + doi: "10.1038/nbt.4042" + licence: ["Apache-2.0"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + + - bam: + type: file + description: Input SAM/BAM/CRAM file produced by the standard 10x sequencing platform, or any other barcoded single cell RNA-seq. + pattern: "*.{bam,cram,sam}" + + - vcf: + type: file + description: Input VCF/BCF file files containing (AC) and (AN) from referenced population (e.g. 1000g). + pattern: "*.{vcf,bcf}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1']` + + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + + - cel: + type: file + description: Contains the relation between numerated barcode ID and barcode and the number of SNP and number of UMI for each barcoded droplet. + pattern: "*.cel.gz" + + - plp: + type: file + description: Contains the overlapping SNP and the corresponding read and base quality for each barcode ID. + pattern: "*.plp.gz" + + - var: + type: file + description: Contains the position, reference allele and allele frequency for each SNP. + pattern: "*.var.gz" + + - umi: + type: file + description: Contains the position covered by each umi. + pattern: "*.umi.gz" + +authors: + - "@mari-ga" + - "@maxozo" + - "@wxicu" + - "@Zethson" + +maintainers: + - "@mari-ga" + - "@maxozo" + - "@wxicu" + - "@Zethson" diff --git a/modules/nf-core/popscle/dscpileup/tests/main.nf.test b/modules/nf-core/popscle/dscpileup/tests/main.nf.test new file mode 100644 index 00000000000..7c3334b3ce8 --- /dev/null +++ b/modules/nf-core/popscle/dscpileup/tests/main.nf.test @@ -0,0 +1,68 @@ +nextflow_process { + + name "Test Process POPSCLE_DSCPILEUP" + script "../main.nf" + process "POPSCLE_DSCPILEUP" + + tag "modules" + tag "modules_nfcore" + tag "popscle" + tag "popscle/dscpileup" + + test("demultiplexing - bam") { + + when { + process { + """ + input[0] = [ + [ id:'sample1' ], // meta map + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/demultiplexing/chr21.bam', checkIfExists: true), + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/demultiplexing/donor_genotype_chr21.vcf', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions") }, + { assert path(process.out.cel.get(0).get(1)).exists() }, + { assert path(process.out.var.get(0).get(1)).exists() }, + { assert path(process.out.umi.get(0).get(1)).exists() }, + { assert path(process.out.plp.get(0).get(1)).exists() } + ) + } + + } + + test("demultiplexing - bam - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'sample1' ], // meta map + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/demultiplexing/chr21.bam', checkIfExists: true), + file(params.modules_testdata_base_path + '/genomics/homo_sapiens/demultiplexing/donor_genotype_chr21.vcf', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("stub-versions") }, + { assert path(process.out.cel.get(0).get(1)).exists() }, + { assert path(process.out.var.get(0).get(1)).exists() }, + { assert path(process.out.umi.get(0).get(1)).exists() }, + { assert path(process.out.plp.get(0).get(1)).exists() } + ) + } + + } + +} diff --git a/modules/nf-core/popscle/dscpileup/tests/main.nf.test.snap b/modules/nf-core/popscle/dscpileup/tests/main.nf.test.snap new file mode 100644 index 00000000000..ee6880b7a76 --- /dev/null +++ b/modules/nf-core/popscle/dscpileup/tests/main.nf.test.snap @@ -0,0 +1,26 @@ +{ + "versions": { + "content": [ + [ + "versions.yml:md5,b9f72a52f464ec5add0256467d30a5c3" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-21T07:03:50.053780794" + }, + "stub-versions": { + "content": [ + [ + "versions.yml:md5,b9f72a52f464ec5add0256467d30a5c3" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-21T08:23:22.002661876" + } +} \ No newline at end of file diff --git a/modules/nf-core/popscle/dscpileup/tests/tags.yml b/modules/nf-core/popscle/dscpileup/tests/tags.yml new file mode 100644 index 00000000000..79538bc98ff --- /dev/null +++ b/modules/nf-core/popscle/dscpileup/tests/tags.yml @@ -0,0 +1,2 @@ +popscle/dscpileup: + - "modules/nf-core/popscle/dscpileup/**" From 293accfc5449dc514d90bbbbf3e068905cd27e29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sara=20Kr=C3=A4ttli?= <154206790+skraettli@users.noreply.github.com> Date: Thu, 21 Mar 2024 11:19:29 +0100 Subject: [PATCH 03/18] Added module isoseq3/tag (#5324) Co-authored-by: Mauro Saporita <64437596+mauro-saporita@users.noreply.github.com> --- modules/nf-core/isoseq3/tag/environment.yml | 9 ++ modules/nf-core/isoseq3/tag/main.nf | 53 ++++++++++ modules/nf-core/isoseq3/tag/meta.yml | 55 ++++++++++ .../nf-core/isoseq3/tag/tests/main.nf.test | 67 ++++++++++++ .../isoseq3/tag/tests/main.nf.test.snap | 100 ++++++++++++++++++ modules/nf-core/isoseq3/tag/tests/tags.yml | 2 + tests/config/test_data.config | 1 + 7 files changed, 287 insertions(+) create mode 100644 modules/nf-core/isoseq3/tag/environment.yml create mode 100644 modules/nf-core/isoseq3/tag/main.nf create mode 100644 modules/nf-core/isoseq3/tag/meta.yml create mode 100644 modules/nf-core/isoseq3/tag/tests/main.nf.test create mode 100644 modules/nf-core/isoseq3/tag/tests/main.nf.test.snap create mode 100644 modules/nf-core/isoseq3/tag/tests/tags.yml diff --git a/modules/nf-core/isoseq3/tag/environment.yml b/modules/nf-core/isoseq3/tag/environment.yml new file mode 100644 index 00000000000..d773d60297e --- /dev/null +++ b/modules/nf-core/isoseq3/tag/environment.yml @@ -0,0 +1,9 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +name: "isoseq3_tag" +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - "bioconda::isoseq3=4.0.0" diff --git a/modules/nf-core/isoseq3/tag/main.nf b/modules/nf-core/isoseq3/tag/main.nf new file mode 100644 index 00000000000..c14c1e1f814 --- /dev/null +++ b/modules/nf-core/isoseq3/tag/main.nf @@ -0,0 +1,53 @@ +process ISOSEQ3_TAG { + tag "$meta.id" + label 'process_low' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/isoseq3:4.0.0--h9ee0642_0': + 'biocontainers/isoseq3:4.0.0--h9ee0642_0' }" + + input: + tuple val(meta), path(bam) + val design + + output: + tuple val(meta), path("*.flt.bam") , emit: bam + tuple val(meta), path("*.flt.bam.pbi") , emit: pbi + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def valid_design = ~/^(?:\d{1,2}[UBGX]-)+T$|^(?:\d{1,2}[UBGX]-)+T(?:-\d{1,2}[UBGX])+$|^T(?:-\d{1,2}[UBGX])+$/ + if ( !(design ==~ valid_design) ) { error "Invalid UMI/barcode design. Check https://isoseq.how/umi/umi-barcode-design.html for how to specify the design" } + """ + isoseq \\ + tag \\ + -j $task.cpus \\ + --design $design \\ + ${prefix}.5p--3p.bam \\ + ${prefix}.flt.bam \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + isoseq3: \$(isoseq tag --version | head -n 1 | sed 's/isoseq tag //g' | sed 's/ (.*//g' ) + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.flt.bam + touch ${prefix}.flt.bam.pbi + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + isoseq3: \$(isoseq tag --version | head -n 1 | sed 's/isoseq tag //g' | sed 's/ (.*//g' ) + END_VERSIONS + """ +} diff --git a/modules/nf-core/isoseq3/tag/meta.yml b/modules/nf-core/isoseq3/tag/meta.yml new file mode 100644 index 00000000000..55939a04c44 --- /dev/null +++ b/modules/nf-core/isoseq3/tag/meta.yml @@ -0,0 +1,55 @@ +--- +name: "isoseq3_tag" +description: Extract UMI and cell barcodes +keywords: + - isoseq + - tag + - pacbio + - UMI + - cell_barcodes +tools: + - "isoseq3": + description: "Iso-Seq - Scalable De Novo Isoform Discovery" + homepage: "https://github.com/PacificBiosciences/IsoSeq/tree/master" + documentation: "https://isoseq.how/" + tool_dev_url: "https://github.com/PacificBiosciences/IsoSeq/tree/master" + licence: ["BSD-3-clause-Clear"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - bam: + type: file + description: BAM file, one full-length CCS file generated by lima + pattern: "*.5p--3p.bam" + - design: + type: string + description: Barcoding design. Specifies which bases to use as cell/molecular barcodes. + pattern: "^(?:\\d{1,2}[UBGX]-)+T$|^(?:\\d{1,2}[UBGX]-)+T(?:-\\d{1,2}[UBGX])+$|^T(?:-\\d{1,2}[UBGX])+$" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1']` + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - bam: + type: file + description: BAM file with full-length tagged reads + pattern: "*.flt.bam" + - pbi: + type: file + description: Pacbio index file of full-length tagged reads + pattern: "*.flt.bam.pbi" + +authors: + - "@skraettli" +maintainers: + - "@skraettli" diff --git a/modules/nf-core/isoseq3/tag/tests/main.nf.test b/modules/nf-core/isoseq3/tag/tests/main.nf.test new file mode 100644 index 00000000000..55ea4fdb93d --- /dev/null +++ b/modules/nf-core/isoseq3/tag/tests/main.nf.test @@ -0,0 +1,67 @@ +nextflow_process { + + name "Test Process ISOSEQ3_TAG" + script "../main.nf" + process "ISOSEQ3_TAG" + + tag "modules" + tag "modules_nfcore" + tag "isoseq3" + tag "isoseq3/tag" + + test("isoseq tag - bam") { + when { + process { + """ + input[0] = [ + [ id:'mini'], // meta map + file(params.test_data['homo_sapiens']['pacbio']['tag'], checkIfExists: true) + ] + input[1] = "T-12U-16B" + """ + } + } + + then { + assertAll( + { assert process.success }, + + { assert process.out.bam[0][1] ==~ ".*/mini.flt.bam" }, + { assert process.out.pbi[0][1] ==~ ".*/mini.flt.bam.pbi" }, + + { assert snapshot(process.out).match() } + ) + } + + } + + test("isoseq tag - bam - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'mini'], // meta map + file(params.test_data['homo_sapiens']['pacbio']['tag'], checkIfExists: true) + ] + input[1] = "T-12U-16B" + """ + } + } + + then { + assertAll( + { assert process.success }, + + { assert process.out.bam[0][1] ==~ ".*/mini.flt.bam" }, + { assert process.out.pbi[0][1] ==~ ".*/mini.flt.bam.pbi" }, + + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/isoseq3/tag/tests/main.nf.test.snap b/modules/nf-core/isoseq3/tag/tests/main.nf.test.snap new file mode 100644 index 00000000000..0f6d5c23ac9 --- /dev/null +++ b/modules/nf-core/isoseq3/tag/tests/main.nf.test.snap @@ -0,0 +1,100 @@ +{ + "isoseq tag - bam": { + "content": [ + { + "0": [ + [ + { + "id": "mini" + }, + "mini.flt.bam:md5,8f934bb1f7235a31be9fa0f817fc38db" + ] + ], + "1": [ + [ + { + "id": "mini" + }, + "mini.flt.bam.pbi:md5,31b86ebb0bce3af1510ea95ccb722f28" + ] + ], + "2": [ + "versions.yml:md5,7b39b292bafe11dabfb14a96dc72e938" + ], + "bam": [ + [ + { + "id": "mini" + }, + "mini.flt.bam:md5,8f934bb1f7235a31be9fa0f817fc38db" + ] + ], + "pbi": [ + [ + { + "id": "mini" + }, + "mini.flt.bam.pbi:md5,31b86ebb0bce3af1510ea95ccb722f28" + ] + ], + "versions": [ + "versions.yml:md5,7b39b292bafe11dabfb14a96dc72e938" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T13:38:50.930732282" + }, + "isoseq tag - bam - stub": { + "content": [ + { + "0": [ + [ + { + "id": "mini" + }, + "mini.flt.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "mini" + }, + "mini.flt.bam.pbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,7b39b292bafe11dabfb14a96dc72e938" + ], + "bam": [ + [ + { + "id": "mini" + }, + "mini.flt.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "pbi": [ + [ + { + "id": "mini" + }, + "mini.flt.bam.pbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,7b39b292bafe11dabfb14a96dc72e938" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T13:38:57.58333136" + } +} \ No newline at end of file diff --git a/modules/nf-core/isoseq3/tag/tests/tags.yml b/modules/nf-core/isoseq3/tag/tests/tags.yml new file mode 100644 index 00000000000..516c28e0619 --- /dev/null +++ b/modules/nf-core/isoseq3/tag/tests/tags.yml @@ -0,0 +1,2 @@ +isoseq3/tag: + - "modules/nf-core/isoseq3/tag/**" diff --git a/tests/config/test_data.config b/tests/config/test_data.config index 179061e1901..8fc66237c33 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -560,6 +560,7 @@ params { genemodel1 = "${params.test_data_base}/data/genomics/homo_sapiens/pacbio/bed/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.clustered.singletons.merged.aligned_tc.bed" genemodel2 = "${params.test_data_base}/data/genomics/homo_sapiens/pacbio/bed/alz.ccs.fl.NEB_5p--NEB_Clontech_3p.flnc.clustered.singletons.merged.aligned_tc.2.bed" filelist = "${params.test_data_base}/data/genomics/homo_sapiens/pacbio/txt/filelist.txt" + tag = "${params.test_data_base}/data/genomics/homo_sapiens/pacbio/bam/mini.5p--3p.bam" } 'popgen' { plink_case_control_bed = "${params.test_data_base}/data/genomics/homo_sapiens/popgen/plink_simulated.bed" From 1d2f7e4c0b32dbfd9290e509af47eb0da0343b1b Mon Sep 17 00:00:00 2001 From: Suzanne Jin Date: Thu, 21 Mar 2024 11:25:57 +0100 Subject: [PATCH 04/18] new module: Pymygene (#5271) * created the quickgo module. It works, and passes the tests. However, it can only handle uniprot ids as input * added module pymygene * Delete genes.txt * run prettier * solved lint * removed quickgo that stayed by error * removed whitespace * conda uses python 3.12.2 whereas the docker container uses 3.9.2 * small errata * updated snapshot * solved linting * added more tests and added more optional arguments * removed trailing whitespace * modified some comments * modified mygene functions to parse go info and gene centric info separately * removed trailing whitespaces --- modules/nf-core/mygene/environment.yml | 7 + modules/nf-core/mygene/main.nf | 23 ++ modules/nf-core/mygene/meta.yml | 54 +++ modules/nf-core/mygene/templates/mygene.py | 307 ++++++++++++++++++ .../nf-core/mygene/tests/default_tsv.config | 3 + .../nf-core/mygene/tests/go_category.config | 3 + .../nf-core/mygene/tests/go_evidence.config | 3 + modules/nf-core/mygene/tests/main.nf.test | 106 ++++++ .../nf-core/mygene/tests/main.nf.test.snap | 135 ++++++++ modules/nf-core/mygene/tests/tags.yml | 2 + 10 files changed, 643 insertions(+) create mode 100644 modules/nf-core/mygene/environment.yml create mode 100644 modules/nf-core/mygene/main.nf create mode 100644 modules/nf-core/mygene/meta.yml create mode 100644 modules/nf-core/mygene/templates/mygene.py create mode 100644 modules/nf-core/mygene/tests/default_tsv.config create mode 100644 modules/nf-core/mygene/tests/go_category.config create mode 100644 modules/nf-core/mygene/tests/go_evidence.config create mode 100644 modules/nf-core/mygene/tests/main.nf.test create mode 100644 modules/nf-core/mygene/tests/main.nf.test.snap create mode 100644 modules/nf-core/mygene/tests/tags.yml diff --git a/modules/nf-core/mygene/environment.yml b/modules/nf-core/mygene/environment.yml new file mode 100644 index 00000000000..45442c49eda --- /dev/null +++ b/modules/nf-core/mygene/environment.yml @@ -0,0 +1,7 @@ +name: mygene +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::mygene=3.2.2 diff --git a/modules/nf-core/mygene/main.nf b/modules/nf-core/mygene/main.nf new file mode 100644 index 00000000000..25a21d8f094 --- /dev/null +++ b/modules/nf-core/mygene/main.nf @@ -0,0 +1,23 @@ +process MYGENE { + tag "$meta.id" + label 'process_low' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mygene:3.2.2--pyh5e36f6f_0': + 'biocontainers/mygene:3.2.2--pyh5e36f6f_0' }" + + input: + tuple val(meta), path(gene_list) + + output: + tuple val(meta), path("*.gmt"), emit: gmt + tuple val(meta), path("*.tsv"), emit: tsv , optional: true + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + template "mygene.py" +} diff --git a/modules/nf-core/mygene/meta.yml b/modules/nf-core/mygene/meta.yml new file mode 100644 index 00000000000..f7aaa455613 --- /dev/null +++ b/modules/nf-core/mygene/meta.yml @@ -0,0 +1,54 @@ +name: "mygene" +description: Fetch the GO concepts for a list of genes +keywords: + - mygene + - go + - annotation +tools: + - "mygene": + description: "A python wrapper to query/retrieve gene annotation data from Mygene.info." + homepage: "https://mygene.info/" + documentation: "https://docs.mygene.info/projects/mygene-py/en/latest/" + tool_dev_url: "https://github.com/biothings/mygene.py" + doi: "10.1093/nar/gks1114" + licence: ["Apache-2.0"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - gene_list: + type: file + description: A tsv/csv file that contains a list of gene ids in one of the columns. + By default, the column name should be "gene_id", but this can be changed + by using "--columname gene_id" in ext.args. + pattern: "*.{csv,tsv}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - gmt: + type: file + description: | + Each row contains the GO id, a description, and a list of gene ids. + pattern: "*.gmt" + - tsv: + type: file + description: | + (optional) A tsv file with the following columns: + query, mygene_id, go_id, go_term, go_evidence, go_category, symbol, name, taxid + pattern: "*.tsv" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@suzannejin" +maintainers: + - "@suzannejin" diff --git a/modules/nf-core/mygene/templates/mygene.py b/modules/nf-core/mygene/templates/mygene.py new file mode 100644 index 00000000000..6ba80d91533 --- /dev/null +++ b/modules/nf-core/mygene/templates/mygene.py @@ -0,0 +1,307 @@ +#!/usr/bin/env python3 +import argparse +import mygene +import shlex + + +""" +This python script uses the mygene module to query the MyGene.info API and +retrieve the go terms associated with a list of gene ids. The gene ids should +ideally be Ensembl or Entrez ids. The script generates two outputs: + 1. A tsv file containing information related to each query. The columns + include query, mygene_id, go_id, go_term, go_evidence, go_category, + symbol, name, and taxid. + 2. A gmt file containing information related to each go term. Each row + includes the go id, go term, and the genes associated with that go term. + +Author: Suzanne Jin +License: Apache 2.0 (same as the mygene library) +""" + + +class Arguments: + """ + Parses the argments, including the ones coming from $task.ext.args. + """ + def __init__(self) -> None: + self.input = "$gene_list" + self.prefix = ( + "$task.ext.prefix" + if "$task.ext.prefix" != "null" + else "$meta.id" + ) + self.output_gmt = self.prefix + ".gmt" + self.output_tsv = self.prefix + ".tsv" + self.parse_ext_args("$task.ext.args") + + def parse_ext_args(self, args_string: str) -> None: + """ + It parses the extended arguments. + """ + # skip when there are no extended arguments + if args_string == "null": + args_string = "" + + # Parse the extended arguments + args_list = shlex.split(args_string) # Split the string into a list of arguments + parser = argparse.ArgumentParser() + # input parameters + parser.add_argument('--columname', default='gene_id', help='Name of the column where the gene ids are stored in the input file. Default: gene_id') + # filtering parameters + parser.add_argument('--species', default=None, help="Comma separated of common name of the species or taxon ids") + parser.add_argument('--go_category', default=None, help="Comma separated list of GO categories to keep. Default: all") + parser.add_argument('--go_evidence', default=None, help="Comma separated list of GO evidence codes to keep. Default: all") + # additional parameters for querymany + parser.add_argument('--scopes', default=None, help="Comma separated list of scopes to search for.") + parser.add_argument('--entrezonly', default=False, help="When true, the query returns only the hits with valid Entrez gene ids. Default: false.") + parser.add_argument('--ensemblonly', default=False, help="When true, the query returns only the hits with valid Ensembl gene ids. Default: False") + # output parameters + parser.add_argument('--generate_tsv', default=False, help="Also generate a tsv file with the gene based information. Default: False") + args = parser.parse_args(args_list) + + # Convert "null" values to default values + # convert true to True and false to False + for attr in vars(args): + value = getattr(args, attr) + if value == "null": + setattr(args, attr, parser.get_default(attr)) + elif value == "true": + setattr(args, attr, True) + elif value == "false": + setattr(args, attr, False) + + # check if the arguments are valid + if args.go_category: + args.go_category = args.go_category.upper() + for category in args.go_category.split(","): + if category not in ["BP", "MF", "CC"]: + raise ValueError("The GO category should be one of BP, MF, or CC.") + if args.go_evidence: + args.go_evidence = args.go_evidence.upper() + + # Assign args attributes to self attributes + for attr in vars(args): + setattr(self, attr, getattr(args, attr)) + + def print_args(self) -> None: + """ + Print the arguments. + """ + for attr in vars(self): + print(f"{attr}: {getattr(self, attr)}") + + +class Version: + """ + Parse the versions of the modules used in the script. + """ + + @staticmethod + def get_versions(modules: list) -> dict: + """ + This function takes a list of modules and returns a dictionary with the + versions of each module. + """ + return {module.__name__: module.__version__ for module in modules} + + @staticmethod + def format_yaml_like(data: dict, indent: int = 0) -> str: + """ + Formats a dictionary to a YAML-like string. + + Args: + data (dict): The dictionary to format. + indent (int): The current indentation level. + + Returns: + yaml_str: A string formatted as YAML. + """ + yaml_str = "" + for key, value in data.items(): + spaces = " " * indent + if isinstance(value, dict): + yaml_str += f"{spaces}{key}:\\n{Version.format_yaml_like(value, indent + 1)}" + else: + yaml_str += f"{spaces}{key}: {value}\\n" + return yaml_str + + +class MyGene: + """ + This class will query the MyGene.info API and retrieve the go terms + associated with a list of gene ids. + + In concrete, if first queries the mygene API to get the mygene ids for each + of the query gene. Then, it queries for the annotations, and parses the go + terms all together with all the other information. + """ + def __init__(self, query: list, species: str, scopes: str, entrezonly: bool, ensemblonly: bool, go_category: str = None, go_evidence: str = None) -> None: + self.query = query + self.fields = "go,symbol,name,taxid" + self.species = species + self.scopes = scopes + self.entrezonly = entrezonly + self.ensemblonly = ensemblonly + self.go_category = go_category + self.go_evidence = go_evidence + self.mg = mygene.MyGeneInfo() + self.idmap = self.query2idmap() + print(f"fetched {len(self.idmap)} ids from {len(self.query)} queries") + + def query2idmap(self) -> dict: + """ + It returns a dictionary with the mygene ids as keys and the query ids as values. + """ + q = self.mg.querymany( + self.query, + scopes=self.scopes, + species=self.species, + entrezonly=self.entrezonly, + ensemblonly=self.ensemblonly, + returnall=True + ) + return {dic['_id']: dic['query'] for dic in q['out'] if '_id' in dic} + + def id2info(self) -> list: + """ + It returns a list of dictionaries with the info returned from getgenes for all the query ids. + Each dictionary contains the annotations for the corresponding query gene. + """ + return self.mg.getgenes(list(set(self.idmap)), fields=self.fields, species=self.species) + + def parse_go_based_info(self) -> dict: + """ + It queries the annotations for all query ids and then parses a go + centric dictionary. It is a dictionary of dictionaries with the + following format: {{go_id1: [go_term, gene1, gene2, ...]}, ...} + """ + info = {} + for dic in self.id2info(): + + if 'go' not in dic: + continue + if self.go_category: + dic['go'] = {category: dic['go'][category] for category in self.go_category.split(",") if category in dic['go']} + for category, go_list in dic['go'].items(): + if not isinstance(go_list, list): + go_list = [go_list] + for go in go_list: + if (self.go_evidence) and (go['evidence'] not in self.go_evidence.split(",")): + continue + + if go['id'] not in info: + info[go['id']] = [go['term'], self.idmap[dic['_id']]] + else: + info[go['id']].append(self.idmap[dic['_id']]) + return info + + def parse_gene_based_info(self) -> dict: + """ + It queries the annotations for all query ids and then parses a go + centric dictionary. + + At the end it returns a dictionary {query gene: {}} of dictionaries + with the following keys: query, mygene_id, go_id, go_term, go_evidence, + go_category, symbol, name, taxid. + """ + info = {} + for dic in self.id2info(): + + if 'go' not in dic: + continue + if self.go_category: + dic['go'] = {category: dic['go'][category] for category in self.go_category.split(",") if category in dic['go']} + for category, go_list in dic['go'].items(): + if not isinstance(go_list, list): + go_list = [go_list] + for go in go_list: + if (self.go_evidence) and (go['evidence'] not in self.go_evidence.split(",")): + continue + + current_info = { + 'query': self.idmap[dic['_id']], + 'mygene_id': dic['_id'], + 'go_id': go['id'], + 'go_term': go['term'], + 'go_evidence': go['evidence'], + 'go_category': category, + 'symbol': dic['symbol'], + 'name': dic['name'], + 'taxid': dic['taxid'] + } + info[self.idmap[dic['_id']]] = current_info + return info + + def parse_and_save_to_gmt(self, filename: str) -> list: + """ + It parses and saves go centric information to a gmt file. + The final gmt output will be sorted following the go id order. + """ + info = self.parse_go_based_info() + info = dict(sorted(info.items(), key=lambda x: x[0])) + with open(filename, 'w') as f: + for go_id, go_list in info.items(): + tmp = sorted(go_list[1:]) + f.write(go_id + "\\t" + go_list[0] + "\\t" + "\\t".join(tmp) + "\\n") + print(f"saved {len(info)} go terms to {filename}") + + def parse_and_save_to_tsv(self, filename: str) -> None: + """ + It parses and saves gene centric information in a tsv file. + The final tsv output will be sorted following the input query gene list order. + """ + info = self.parse_gene_based_info() + with open(filename, 'w') as f: + f.write("\\t".join(info[self.query[0]].keys()) + "\\n") + for gene in self.query: # sorted by query gene list + if gene in info: + f.write("\\t".join([str(val) for val in info[gene].values()]) + "\\n") + print(f"saved {len(info)} gene centric info to {filename}") + + +def load_list(filename: str, columname: str) -> list: + """ + It loads the list of gene ids from a file. + The columname is the name of the column where the gene ids are stored. + """ + if filename.split('.')[-1] == 'tsv': + sep = "\\t" + elif filename.split('.')[-1] == 'csv': + sep = "," + else: + raise ValueError("The input file extension should be either tsv or csv.") + with open(filename, 'r') as f: + idx = f.readline().strip().split(sep).index(columname) + return [line.strip().split(sep)[idx] for line in f] + + +if __name__ == "__main__": + + # parse and print arguments + args = Arguments() + args.print_args() + + # load gene list + gene_list = load_list(args.input, args.columname) + + # run mygene api + mg = MyGene( + gene_list, + species=args.species, + scopes=args.scopes, + entrezonly=args.entrezonly, + ensemblonly=args.ensemblonly, + go_category=args.go_category, + go_evidence=args.go_evidence + ) + + # parse annotations and save output files + mg.parse_and_save_to_gmt(args.output_gmt) + if args.generate_tsv: + mg.parse_and_save_to_tsv(args.output_tsv) + + # write versions to file + versions_this_module = {} + versions_this_module["${task.process}"] = Version.get_versions([argparse, mygene]) + with open("versions.yml", "w") as f: + f.write(Version.format_yaml_like(versions_this_module)) diff --git a/modules/nf-core/mygene/tests/default_tsv.config b/modules/nf-core/mygene/tests/default_tsv.config new file mode 100644 index 00000000000..08bd6fac225 --- /dev/null +++ b/modules/nf-core/mygene/tests/default_tsv.config @@ -0,0 +1,3 @@ +process{ + ext.args = "--generate_tsv true" +} \ No newline at end of file diff --git a/modules/nf-core/mygene/tests/go_category.config b/modules/nf-core/mygene/tests/go_category.config new file mode 100644 index 00000000000..771f8f4dc89 --- /dev/null +++ b/modules/nf-core/mygene/tests/go_category.config @@ -0,0 +1,3 @@ +process { + ext.args = "--go_category bp,mf" +} \ No newline at end of file diff --git a/modules/nf-core/mygene/tests/go_evidence.config b/modules/nf-core/mygene/tests/go_evidence.config new file mode 100644 index 00000000000..b19de214f6a --- /dev/null +++ b/modules/nf-core/mygene/tests/go_evidence.config @@ -0,0 +1,3 @@ +process { + ext.args = "--go_evidence EXP,IDA" +} \ No newline at end of file diff --git a/modules/nf-core/mygene/tests/main.nf.test b/modules/nf-core/mygene/tests/main.nf.test new file mode 100644 index 00000000000..e5ba64caa3b --- /dev/null +++ b/modules/nf-core/mygene/tests/main.nf.test @@ -0,0 +1,106 @@ +nextflow_process { + + name "Test Process MYGENE" + script "../main.nf" + process "MYGENE" + + tag "modules" + tag "modules_nfcore" + tag "mygene" + + test("mygene - default options") { + + tag "default" + + when { + process { + """ + input[0] = [ + [id : 'test'], + file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/mus_musculus/rnaseq_expression/SRP254919.gene_meta.tsv") + ] + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.gmt).match("mygene - default options - gmt") }, + { assert snapshot(process.out.versions).match("mygene - default options - versions") } + ) + } + } + + test("mygene - default with tsv file") { + + tag "default_with_tsv" + config "./default_tsv.config" + + when { + process { + """ + input[0] = [ + [id : 'test'], + file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/mus_musculus/rnaseq_expression/SRP254919.gene_meta.tsv") + ] + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.gmt).match("mygene - default with tsv file - gmt") }, + { assert snapshot(process.out.tsv).match("mygene - default with tsv file - tsv") }, + { assert snapshot(process.out.versions).match("mygene - default with tsv file - versions") } + ) + } + } + + test("mygene - filter by go category") { + + tag "filter_by_go_category" + config "./go_category.config" + + when { + process { + """ + input[0] = [ + [id : 'test'], + file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/mus_musculus/rnaseq_expression/SRP254919.gene_meta.tsv") + ] + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.gmt).match("mygene - filter by go category - gmt") }, + { assert snapshot(process.out.versions).match("mygene - filter by go category - versions") } + ) + } + } + + test("mygene - filter by go evidence") { + + tag "filter_by_go_evidence" + config "./go_evidence.config" + + when { + process { + """ + input[0] = [ + [id : 'test'], + file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/mus_musculus/rnaseq_expression/SRP254919.gene_meta.tsv") + ] + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.gmt).match("mygene - filter by go evidence - gmt") }, + { assert snapshot(process.out.versions).match("mygene - filter by go evidence - versions") } + ) + } + } +} diff --git a/modules/nf-core/mygene/tests/main.nf.test.snap b/modules/nf-core/mygene/tests/main.nf.test.snap new file mode 100644 index 00000000000..d6a334c7ed6 --- /dev/null +++ b/modules/nf-core/mygene/tests/main.nf.test.snap @@ -0,0 +1,135 @@ +{ + "mygene - filter by go evidence - versions": { + "content": [ + [ + "versions.yml:md5,09d72645c3ae7e886af6e8bd2876c72b" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T17:20:31.854823" + }, + "mygene - default options - versions": { + "content": [ + [ + "versions.yml:md5,09d72645c3ae7e886af6e8bd2876c72b" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T17:19:43.081388" + }, + "mygene - default with tsv file - versions": { + "content": [ + [ + "versions.yml:md5,09d72645c3ae7e886af6e8bd2876c72b" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T17:20:01.837699" + }, + "mygene - default options - gmt": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.gmt:md5,d76d4d06dad199c5e3ecef7060876834" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T17:19:43.060437" + }, + "mygene - filter by go category - versions": { + "content": [ + [ + "versions.yml:md5,09d72645c3ae7e886af6e8bd2876c72b" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T17:20:17.233994" + }, + "mygene - filter by go evidence - gmt": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.gmt:md5,da6b31a5f889e3aedb16b4154f9652af" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T17:20:31.827798" + }, + "mygene - default with tsv file - tsv": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.tsv:md5,018e23173b224cbf328751006593900e" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T17:20:01.81872" + }, + "mygene - default with tsv file - gmt": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.gmt:md5,d76d4d06dad199c5e3ecef7060876834" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T17:20:01.79811" + }, + "mygene - filter by go category - gmt": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.gmt:md5,213c1d1d2345df8ea51d67cb1670f4f7" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T17:20:17.208509" + } +} \ No newline at end of file diff --git a/modules/nf-core/mygene/tests/tags.yml b/modules/nf-core/mygene/tests/tags.yml new file mode 100644 index 00000000000..c867c978afa --- /dev/null +++ b/modules/nf-core/mygene/tests/tags.yml @@ -0,0 +1,2 @@ +mygene: + - "modules/nf-core/mygene/**" From 9269b7b5cbe26815d84e9af3db9b78ed4cfe0b19 Mon Sep 17 00:00:00 2001 From: Damon-Lee Pointon <51855558+DLBPointon@users.noreply.github.com> Date: Thu, 21 Mar 2024 13:54:34 +0000 Subject: [PATCH 05/18] Dp24 pretextmap update (#5245) * Adding the nf-test files * Adding the nf-test files * Remove pytest and add MORE tests * Remove pytest reference * Update to snapshot * Update to snapshot * Updates to add a cram and no fai test as well as add '.' do meta.yml * small fixes --- modules/nf-core/pretextmap/main.nf | 14 +- modules/nf-core/pretextmap/meta.yml | 13 ++ modules/nf-core/pretextmap/tests/main.nf.test | 148 +++++++++++++++++ .../pretextmap/tests/main.nf.test.snap | 157 ++++++++++++++++++ modules/nf-core/pretextmap/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 - tests/modules/nf-core/pretextmap/main.nf | 37 ----- .../nf-core/pretextmap/nextflow.config | 5 - tests/modules/nf-core/pretextmap/test.yml | 29 ---- 9 files changed, 327 insertions(+), 81 deletions(-) create mode 100644 modules/nf-core/pretextmap/tests/main.nf.test create mode 100644 modules/nf-core/pretextmap/tests/main.nf.test.snap create mode 100644 modules/nf-core/pretextmap/tests/tags.yml delete mode 100644 tests/modules/nf-core/pretextmap/main.nf delete mode 100644 tests/modules/nf-core/pretextmap/nextflow.config delete mode 100644 tests/modules/nf-core/pretextmap/test.yml diff --git a/modules/nf-core/pretextmap/main.nf b/modules/nf-core/pretextmap/main.nf index 4d7b1347bd4..b1a4a3f7396 100644 --- a/modules/nf-core/pretextmap/main.nf +++ b/modules/nf-core/pretextmap/main.nf @@ -10,19 +10,19 @@ process PRETEXTMAP { input: tuple val(meta), path(input) - path fasta + tuple val(meta2), path(fasta), path(fai) output: - tuple val(meta), path("*.pretext"), emit: pretext - path "versions.yml" , emit: versions + tuple val(meta), path("*.pretext") , emit: pretext + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - def reference = fasta ? "--reference ${fasta}" : "" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def reference = fasta ? "--reference ${fasta}" : "" """ if [[ $input == *.pairs.gz ]]; then @@ -47,7 +47,7 @@ process PRETEXTMAP { """ stub: - def prefix = task.ext.prefix ?: "${meta.id}" + def prefix = task.ext.prefix ?: "${meta.id}" """ touch ${prefix}.pretext diff --git a/modules/nf-core/pretextmap/meta.yml b/modules/nf-core/pretextmap/meta.yml index 1d0d950c86d..97158cda0d5 100644 --- a/modules/nf-core/pretextmap/meta.yml +++ b/modules/nf-core/pretextmap/meta.yml @@ -20,6 +20,19 @@ input: type: file description: BAM/CRAM/SAM file or pairs formatted reads file pattern: "*.{bam,cram,sam,pairs.gz}" + - input: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test2', single_end:false ] + - input: + type: file + description: FASTA file + pattern: "*.{fasta,fa,fna}" + - input: + type: file + description: Fasta index + pattern: "*.fai" output: - meta: type: map diff --git a/modules/nf-core/pretextmap/tests/main.nf.test b/modules/nf-core/pretextmap/tests/main.nf.test new file mode 100644 index 00000000000..1bb679c04ae --- /dev/null +++ b/modules/nf-core/pretextmap/tests/main.nf.test @@ -0,0 +1,148 @@ +nextflow_process { + + name "Test Process PRETEXTMAP" + script "../main.nf" + process "PRETEXTMAP" + + tag "modules" + tag "modules_nfcore" + tag "pretext" + tag "pretextmap" + + test("homo_cram_map") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true) + ] + + input[1] = [ + [ id: 'test2', single_end: false ], + file(params.test_data['homo_sapiens']['genome']['genome_fasta']), + file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai']) + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("homo_cram_map_nofai") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true) + ] + + input[1] = [ + [ id: 'test2', single_end: false ], + file(params.test_data['homo_sapiens']['genome']['genome_fasta']), + [] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("homo_bam_map") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + + input[1] = [ + [ id: 'test2', single_end: false ], + file(params.test_data['homo_sapiens']['genome']['genome_fasta']), + file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai']) + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("mapped_pairs_map") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file("https://raw.githubusercontent.com/4dn-dcic/pairix/master/samples/test_4dn.pairs.gz", checkIfExists: true) + ] + + input[1] = [ + [], + [], + [] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("homo_cram_map_stub") { + options "-stub" + when { + process { + """ + input[0] = [ + [ id:'test', single_end: false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true) + ] + + input[1] = [ + [ id: 'test2', single_end: false ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta']), + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai']) + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/pretextmap/tests/main.nf.test.snap b/modules/nf-core/pretextmap/tests/main.nf.test.snap new file mode 100644 index 00000000000..48697af80c3 --- /dev/null +++ b/modules/nf-core/pretextmap/tests/main.nf.test.snap @@ -0,0 +1,157 @@ +{ + "homo_cram_map": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.pretext:md5,ae0f18b472e39de970fdc1aebc0f3f8d" + ] + ], + "1": [ + "versions.yml:md5,894afb81509c847f7d9a58885e086b5c" + ], + "pretext": [ + [ + { + "id": "test", + "single_end": false + }, + "test.pretext:md5,ae0f18b472e39de970fdc1aebc0f3f8d" + ] + ], + "versions": [ + "versions.yml:md5,894afb81509c847f7d9a58885e086b5c" + ] + } + ], + "timestamp": "2024-03-21T10:53:43.322902" + }, + "homo_cram_map_stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.pretext:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,894afb81509c847f7d9a58885e086b5c" + ], + "pretext": [ + [ + { + "id": "test", + "single_end": false + }, + "test.pretext:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,894afb81509c847f7d9a58885e086b5c" + ] + } + ], + "timestamp": "2024-03-21T11:07:44.32508" + }, + "homo_cram_map_nofai": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.pretext:md5,ae0f18b472e39de970fdc1aebc0f3f8d" + ] + ], + "1": [ + "versions.yml:md5,894afb81509c847f7d9a58885e086b5c" + ], + "pretext": [ + [ + { + "id": "test", + "single_end": false + }, + "test.pretext:md5,ae0f18b472e39de970fdc1aebc0f3f8d" + ] + ], + "versions": [ + "versions.yml:md5,894afb81509c847f7d9a58885e086b5c" + ] + } + ], + "timestamp": "2024-03-21T10:58:16.804287" + }, + "mapped_pairs_map": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.pretext:md5,b47be7fd285a2de68643f73f85ba84f1" + ] + ], + "1": [ + "versions.yml:md5,894afb81509c847f7d9a58885e086b5c" + ], + "pretext": [ + [ + { + "id": "test", + "single_end": false + }, + "test.pretext:md5,b47be7fd285a2de68643f73f85ba84f1" + ] + ], + "versions": [ + "versions.yml:md5,894afb81509c847f7d9a58885e086b5c" + ] + } + ], + "timestamp": "2024-03-21T11:07:32.047007" + }, + "homo_bam_map": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.pretext:md5,ae0f18b472e39de970fdc1aebc0f3f8d" + ] + ], + "1": [ + "versions.yml:md5,894afb81509c847f7d9a58885e086b5c" + ], + "pretext": [ + [ + { + "id": "test", + "single_end": false + }, + "test.pretext:md5,ae0f18b472e39de970fdc1aebc0f3f8d" + ] + ], + "versions": [ + "versions.yml:md5,894afb81509c847f7d9a58885e086b5c" + ] + } + ], + "timestamp": "2024-03-21T11:02:50.120033" + } +} \ No newline at end of file diff --git a/modules/nf-core/pretextmap/tests/tags.yml b/modules/nf-core/pretextmap/tests/tags.yml new file mode 100644 index 00000000000..70f7eefc8e8 --- /dev/null +++ b/modules/nf-core/pretextmap/tests/tags.yml @@ -0,0 +1,2 @@ +pretextmap: + - "modules/nf-core/pretextmap/**" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index af3dafe25bb..17f07368cc4 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1657,9 +1657,6 @@ porechop/abi: preseq/ccurve: - modules/nf-core/preseq/ccurve/** - tests/modules/nf-core/preseq/ccurve/** -pretextmap: - - modules/nf-core/pretextmap/** - - tests/modules/nf-core/pretextmap/** pretextsnapshot: - modules/nf-core/pretextsnapshot/** - tests/modules/nf-core/pretextsnapshot/** diff --git a/tests/modules/nf-core/pretextmap/main.nf b/tests/modules/nf-core/pretextmap/main.nf deleted file mode 100644 index 1ab3abaff00..00000000000 --- a/tests/modules/nf-core/pretextmap/main.nf +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { PRETEXTMAP } from '../../../../modules/nf-core/pretextmap/main.nf' - -workflow test_pretextmap_bam { - - input = [ - [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) - ] - - PRETEXTMAP ( input, [] ) -} - -workflow test_pretextmap_cram { - - input = [ - [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true) - ] - - fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - - PRETEXTMAP ( input, fasta ) -} - -workflow test_pretextmap_pairs_gz { - - input = [ - [ id:'test', single_end:false ], // meta map - file("https://raw.githubusercontent.com/4dn-dcic/pairix/master/samples/test_4dn.pairs.gz", checkIfExists: true) - ] - - PRETEXTMAP ( input, [] ) -} diff --git a/tests/modules/nf-core/pretextmap/nextflow.config b/tests/modules/nf-core/pretextmap/nextflow.config deleted file mode 100644 index 50f50a7a357..00000000000 --- a/tests/modules/nf-core/pretextmap/nextflow.config +++ /dev/null @@ -1,5 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - -} \ No newline at end of file diff --git a/tests/modules/nf-core/pretextmap/test.yml b/tests/modules/nf-core/pretextmap/test.yml deleted file mode 100644 index 9d0b81af346..00000000000 --- a/tests/modules/nf-core/pretextmap/test.yml +++ /dev/null @@ -1,29 +0,0 @@ -- name: "pretextmap_bam" - command: nextflow run ./tests/modules/nf-core/pretextmap -entry test_pretextmap_bam -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/pretextmap/nextflow.config - tags: - - "pretextmap" - files: - - path: "output/pretextmap/test.pretext" - md5sum: ae0f18b472e39de970fdc1aebc0f3f8d - - path: "output/pretextmap/versions.yml" - md5sum: 6e148d693b1061694fc9b5a9aa806198 - -- name: "pretextmap_cram" - command: nextflow run ./tests/modules/nf-core/pretextmap -entry test_pretextmap_cram -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/pretextmap/nextflow.config - tags: - - "pretextmap" - files: - - path: "output/pretextmap/test.pretext" - md5sum: ae0f18b472e39de970fdc1aebc0f3f8d - - path: "output/pretextmap/versions.yml" - md5sum: 318fc06fd6d771fa31004cea03a2a71e - -- name: "pretextmap_pairs_gz" - command: nextflow run ./tests/modules/nf-core/pretextmap -entry test_pretextmap_pairs_gz -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/pretextmap/nextflow.config - tags: - - "pretextmap" - files: - - path: "output/pretextmap/test.pretext" - md5sum: b47be7fd285a2de68643f73f85ba84f1 - - path: "output/pretextmap/versions.yml" - md5sum: f9ef0be0308bbb9b2697b0f8e7e23919 From 8731a6221dd10fd9039e18518b390b43e14ef9ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20B=C3=A4uerle?= <45968370+famosab@users.noreply.github.com> Date: Thu, 21 Mar 2024 14:56:26 +0100 Subject: [PATCH 06/18] port `manta-tumoronly` to nf-test (#5363) * feat: add tumoronly tests * fix: adjust stub test for gz * fix remove old pytest files * snapshot * remove empty config --- modules/nf-core/manta/tumoronly/main.nf | 6 +- .../manta/tumoronly/tests/main.nf.test | 121 +++++++++++++++++ .../manta/tumoronly/tests/main.nf.test.snap | 123 ++++++++++++++++++ .../nf-core/manta/tumoronly/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 - tests/modules/nf-core/manta/tumoronly/main.nf | 47 ------- .../nf-core/manta/tumoronly/nextflow.config | 5 - .../modules/nf-core/manta/tumoronly/test.yml | 24 ---- 8 files changed, 249 insertions(+), 82 deletions(-) create mode 100644 modules/nf-core/manta/tumoronly/tests/main.nf.test create mode 100644 modules/nf-core/manta/tumoronly/tests/main.nf.test.snap create mode 100644 modules/nf-core/manta/tumoronly/tests/tags.yml delete mode 100644 tests/modules/nf-core/manta/tumoronly/main.nf delete mode 100644 tests/modules/nf-core/manta/tumoronly/nextflow.config delete mode 100644 tests/modules/nf-core/manta/tumoronly/test.yml diff --git a/modules/nf-core/manta/tumoronly/main.nf b/modules/nf-core/manta/tumoronly/main.nf index b0472995710..21459aa952f 100644 --- a/modules/nf-core/manta/tumoronly/main.nf +++ b/modules/nf-core/manta/tumoronly/main.nf @@ -64,11 +64,11 @@ process MANTA_TUMORONLY { stub: def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.candidate_small_indels.vcf.gz + echo "" | gzip > ${prefix}.candidate_small_indels.vcf.gz touch ${prefix}.candidate_small_indels.vcf.gz.tbi - touch ${prefix}.candidate_sv.vcf.gz + echo "" | gzip > ${prefix}.candidate_sv.vcf.gz touch ${prefix}.candidate_sv.vcf.gz.tbi - touch ${prefix}.tumor_sv.vcf.gz + echo "" | gzip > ${prefix}.tumor_sv.vcf.gz touch ${prefix}.tumor_sv.vcf.gz.tbi cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/manta/tumoronly/tests/main.nf.test b/modules/nf-core/manta/tumoronly/tests/main.nf.test new file mode 100644 index 00000000000..9d57b1d8f7f --- /dev/null +++ b/modules/nf-core/manta/tumoronly/tests/main.nf.test @@ -0,0 +1,121 @@ +nextflow_process { + + name "Test Process MANTA_TUMORONLY" + script "../main.nf" + process "MANTA_TUMORONLY" + + tag "modules" + tag "modules_nfcore" + tag "manta" + tag "manta/tumoronly" + + test("human - cram") { + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), + [], [] + ] + // fasta + input[1] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + ] + // fai + input[2] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + ] + // config + input[3] = Channel.of("[manta]", "enableRemoteReadRetrievalForInsertionsInGermlineCallingModes = 0") + .collectFile(name:"manta_options.ini", newLine:true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.candidate_small_indels_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.candidate_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.tumor_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert snapshot(process.out.version).match("version") } + ) + } + + } + + test("human - cram - bed") { + + when { + process { + """ + input[0] = [ [ id:'bed_test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed.gz.tbi', checkIfExists: true) + ] + // fasta + input[1] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + ] + // fai + input[2] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + ] + // config + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.candidate_small_indels_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.candidate_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.tumor_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert snapshot(process.out.version).match("bed_version") } + ) + } + + } + + test("human - cram - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), + [], [] + ] + // fasta + input[1] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + ] + // fai + input[2] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + ] + // config + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/manta/tumoronly/tests/main.nf.test.snap b/modules/nf-core/manta/tumoronly/tests/main.nf.test.snap new file mode 100644 index 00000000000..abeccd7ac5c --- /dev/null +++ b/modules/nf-core/manta/tumoronly/tests/main.nf.test.snap @@ -0,0 +1,123 @@ +{ + "human - cram - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.candidate_small_indels.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.candidate_small_indels.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test" + }, + "test.candidate_sv.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "3": [ + [ + { + "id": "test" + }, + "test.candidate_sv.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + { + "id": "test" + }, + "test.tumor_sv.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "5": [ + [ + { + "id": "test" + }, + "test.tumor_sv.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + "versions.yml:md5,ebbae8cb2fa4e5227b8358914674523c" + ], + "candidate_small_indels_vcf": [ + [ + { + "id": "test" + }, + "test.candidate_small_indels.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "candidate_small_indels_vcf_tbi": [ + [ + { + "id": "test" + }, + "test.candidate_small_indels.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "candidate_sv_vcf": [ + [ + { + "id": "test" + }, + "test.candidate_sv.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "candidate_sv_vcf_tbi": [ + [ + { + "id": "test" + }, + "test.candidate_sv.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "tumor_sv_vcf": [ + [ + { + "id": "test" + }, + "test.tumor_sv.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "tumor_sv_vcf_tbi": [ + [ + { + "id": "test" + }, + "test.tumor_sv.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,ebbae8cb2fa4e5227b8358914674523c" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-21T14:44:15.752887" + }, + "version": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-21T14:36:52.480477" + } +} \ No newline at end of file diff --git a/modules/nf-core/manta/tumoronly/tests/tags.yml b/modules/nf-core/manta/tumoronly/tests/tags.yml new file mode 100644 index 00000000000..cf38c242253 --- /dev/null +++ b/modules/nf-core/manta/tumoronly/tests/tags.yml @@ -0,0 +1,2 @@ +manta/tumoronly: + - "modules/nf-core/manta/tumoronly/**" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 17f07368cc4..49ba2b0102b 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1216,9 +1216,6 @@ manta/convertinversion: manta/germline: - modules/nf-core/manta/germline/** - tests/modules/nf-core/manta/germline/** -manta/tumoronly: - - modules/nf-core/manta/tumoronly/** - - tests/modules/nf-core/manta/tumoronly/** mapad/index: - modules/nf-core/mapad/index/** - tests/modules/nf-core/mapad/index/** diff --git a/tests/modules/nf-core/manta/tumoronly/main.nf b/tests/modules/nf-core/manta/tumoronly/main.nf deleted file mode 100644 index 11f52f2786b..00000000000 --- a/tests/modules/nf-core/manta/tumoronly/main.nf +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { MANTA_TUMORONLY } from '../../../../../modules/nf-core/manta/tumoronly/main.nf' - -workflow test_manta_tumoronly { - input = [ - [ id:'test'], // meta map - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_cram'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_cram_crai'], checkIfExists: true), - [], [] - ] - - fasta = [ [id:'genome'], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - - fai = [ [id:'genome'], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) - ] - - config = Channel.of("[manta]", "enableRemoteReadRetrievalForInsertionsInGermlineCallingModes = 0") - .collectFile(name:"manta_options.ini", newLine:true) - - MANTA_TUMORONLY ( input, fasta, fai, config ) -} - -workflow test_manta_tumoronly_target_bed { - input = [ - [ id:'test'], // meta map - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_cram'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_cram_crai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed_gz_tbi'], checkIfExists: true) - ] - - fasta = [ [id:'genome'], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) - ] - - fai = [ [id:'genome'], - file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) - ] - - MANTA_TUMORONLY ( input, fasta, fai, [] ) -} diff --git a/tests/modules/nf-core/manta/tumoronly/nextflow.config b/tests/modules/nf-core/manta/tumoronly/nextflow.config deleted file mode 100644 index 8730f1c4b93..00000000000 --- a/tests/modules/nf-core/manta/tumoronly/nextflow.config +++ /dev/null @@ -1,5 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - -} diff --git a/tests/modules/nf-core/manta/tumoronly/test.yml b/tests/modules/nf-core/manta/tumoronly/test.yml deleted file mode 100644 index e566c711bea..00000000000 --- a/tests/modules/nf-core/manta/tumoronly/test.yml +++ /dev/null @@ -1,24 +0,0 @@ -- name: manta tumoronly - command: nextflow run ./tests/modules/nf-core/manta/tumoronly -entry test_manta_tumoronly -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/manta/tumoronly/nextflow.config - tags: - - manta - - manta/tumoronly - files: - - path: output/manta/test.candidate_small_indels.vcf.gz - - path: output/manta/test.candidate_small_indels.vcf.gz.tbi - - path: output/manta/test.candidate_sv.vcf.gz - - path: output/manta/test.candidate_sv.vcf.gz.tbi - - path: output/manta/test.tumor_sv.vcf.gz - - path: output/manta/test.tumor_sv.vcf.gz.tbi -- name: manta tumoronly target bed - command: nextflow run ./tests/modules/nf-core/manta/tumoronly -entry test_manta_tumoronly_target_bed -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/manta/tumoronly/nextflow.config - tags: - - manta - - manta/tumoronly - files: - - path: output/manta/test.candidate_small_indels.vcf.gz - - path: output/manta/test.candidate_small_indels.vcf.gz.tbi - - path: output/manta/test.candidate_sv.vcf.gz - - path: output/manta/test.candidate_sv.vcf.gz.tbi - - path: output/manta/test.tumor_sv.vcf.gz - - path: output/manta/test.tumor_sv.vcf.gz.tbi From 1943aa60f7490c3d6740e8872e6e69122ccc8087 Mon Sep 17 00:00:00 2001 From: tomiles <116039+tomiles@users.noreply.github.com> Date: Thu, 21 Mar 2024 16:20:09 +0100 Subject: [PATCH 07/18] fix optional cram support in modules and migrate to nf-test (#5329) * fix GATK4_ESTIMATELIBRARYCOMPLEXITY * use reads as input for cram/bam/sam * fix markduplicates and split bam versus cram output ch. * fix check stability for cram * remove auto --CREATE_INDEX for bam files * update test and snaps --------- Co-authored-by: CMGG Cloud Team --- .../gatk4/estimatelibrarycomplexity/main.nf | 3 +- .../tests/main.nf.test | 113 ++++++++++++++++++ .../tests/main.nf.test.snap | 41 +++++++ .../estimatelibrarycomplexity/tests/tags.yml | 2 + .../picard/addorreplacereadgroups/main.nf | 19 +-- .../picard/addorreplacereadgroups/meta.yml | 6 +- .../addorreplacereadgroups/tests/bam.config | 1 + .../addorreplacereadgroups/tests/main.nf.test | 15 ++- .../tests/main.nf.test.snap | 51 ++------ modules/nf-core/picard/markduplicates/main.nf | 23 ++-- .../nf-core/picard/markduplicates/meta.yml | 10 +- .../picard/markduplicates/tests/main.nf.test | 22 +--- .../markduplicates/tests/main.nf.test.snap | 56 +++++++-- .../nf-core/bam_markduplicates_picard/main.nf | 28 +++-- .../bam_markduplicates_picard/meta.yml | 20 +++- .../tests/main.nf.test | 4 +- .../tests/main.nf.test.snap | 14 +-- tests/config/pytest_modules.yml | 3 - .../gatk4/estimatelibrarycomplexity/main.nf | 18 --- .../estimatelibrarycomplexity/nextflow.config | 5 - .../gatk4/estimatelibrarycomplexity/test.yml | 8 -- 21 files changed, 303 insertions(+), 159 deletions(-) create mode 100644 modules/nf-core/gatk4/estimatelibrarycomplexity/tests/main.nf.test create mode 100644 modules/nf-core/gatk4/estimatelibrarycomplexity/tests/main.nf.test.snap create mode 100644 modules/nf-core/gatk4/estimatelibrarycomplexity/tests/tags.yml delete mode 100644 tests/modules/nf-core/gatk4/estimatelibrarycomplexity/main.nf delete mode 100644 tests/modules/nf-core/gatk4/estimatelibrarycomplexity/nextflow.config delete mode 100644 tests/modules/nf-core/gatk4/estimatelibrarycomplexity/test.yml diff --git a/modules/nf-core/gatk4/estimatelibrarycomplexity/main.nf b/modules/nf-core/gatk4/estimatelibrarycomplexity/main.nf index 56a3a310503..e0744e16f7d 100644 --- a/modules/nf-core/gatk4/estimatelibrarycomplexity/main.nf +++ b/modules/nf-core/gatk4/estimatelibrarycomplexity/main.nf @@ -24,6 +24,7 @@ process GATK4_ESTIMATELIBRARYCOMPLEXITY { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def input_list = input.collect(){"--INPUT $it"}.join(" ") + def reference = fasta ? "--REFERENCE_SEQUENCE ${fasta}" : "" def avail_mem = 3072 if (!task.memory) { @@ -36,7 +37,7 @@ process GATK4_ESTIMATELIBRARYCOMPLEXITY { EstimateLibraryComplexity \\ $input_list \\ --OUTPUT ${prefix}.metrics \\ - --REFERENCE_SEQUENCE ${fasta} \\ + $reference \\ --TMP_DIR . \\ $args diff --git a/modules/nf-core/gatk4/estimatelibrarycomplexity/tests/main.nf.test b/modules/nf-core/gatk4/estimatelibrarycomplexity/tests/main.nf.test new file mode 100644 index 00000000000..e23b65573c9 --- /dev/null +++ b/modules/nf-core/gatk4/estimatelibrarycomplexity/tests/main.nf.test @@ -0,0 +1,113 @@ +nextflow_process { + + name "Test Process GATK4_ESTIMATELIBRARYCOMPLEXITY" + script "../main.nf" + process "GATK4_ESTIMATELIBRARYCOMPLEXITY" + + tag "modules" + tag "modules_nfcore" + tag "gatk4" + tag "gatk4/estimatelibrarycomplexity" + + test("homo_sapiens - bam") { + + when { + process { + """ + // [ meta, input ] + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam', checkIfExists: true) + ] + // fasta + input[1] = [] + // fai + input[2] = [] + // dict + input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict' , checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.metrics[0][1]).name, + process.out.versions + ).match() + } + ) + } + + } + + test("homo_sapiens - cram") { + + when { + process { + """ + // [ meta, input ] + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram', checkIfExists: true) + ] + // fasta + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta' , checkIfExists: true) + // fai + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai' , checkIfExists: true) + // dict + input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict' , checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.metrics[0][1]).name, + process.out.versions + ).match() + } + ) + } + + } + + test("sarscov2 - bam - stub") { + + options "-stub" + + when { + process { + """ + // [ meta, input ] + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam', checkIfExists: true) + ] + // fasta + input[1] = [] + // fai + input[2] = [] + // dict + input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict' , checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.metrics[0][1]).name, + process.out.versions + ).match() + } + ) + } + + } + +} diff --git a/modules/nf-core/gatk4/estimatelibrarycomplexity/tests/main.nf.test.snap b/modules/nf-core/gatk4/estimatelibrarycomplexity/tests/main.nf.test.snap new file mode 100644 index 00000000000..bbcef1471e0 --- /dev/null +++ b/modules/nf-core/gatk4/estimatelibrarycomplexity/tests/main.nf.test.snap @@ -0,0 +1,41 @@ +{ + "homo_sapiens - cram": { + "content": [ + "test.metrics", + [ + "versions.yml:md5,1d9c175d88b6c50c7dc999c1f70261a8" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T14:41:39.857566" + }, + "sarscov2 - bam - stub": { + "content": [ + "test.metrics", + [ + "versions.yml:md5,1d9c175d88b6c50c7dc999c1f70261a8" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T14:27:55.337569" + }, + "homo_sapiens - bam": { + "content": [ + "test.metrics", + [ + "versions.yml:md5,1d9c175d88b6c50c7dc999c1f70261a8" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T14:24:41.460191" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4/estimatelibrarycomplexity/tests/tags.yml b/modules/nf-core/gatk4/estimatelibrarycomplexity/tests/tags.yml new file mode 100644 index 00000000000..0949d08563b --- /dev/null +++ b/modules/nf-core/gatk4/estimatelibrarycomplexity/tests/tags.yml @@ -0,0 +1,2 @@ +gatk4/estimatelibrarycomplexity: + - "modules/nf-core/gatk4/estimatelibrarycomplexity/**" diff --git a/modules/nf-core/picard/addorreplacereadgroups/main.nf b/modules/nf-core/picard/addorreplacereadgroups/main.nf index 4ea018d56bd..4300ba7f8cf 100644 --- a/modules/nf-core/picard/addorreplacereadgroups/main.nf +++ b/modules/nf-core/picard/addorreplacereadgroups/main.nf @@ -8,7 +8,7 @@ process PICARD_ADDORREPLACEREADGROUPS { 'biocontainers/picard:3.1.1--hdfd78af_0' }" input: - tuple val(meta), path(bam) + tuple val(meta), path(reads) tuple val(meta2), path(fasta) tuple val(meta3), path(fasta_index) @@ -24,9 +24,8 @@ process PICARD_ADDORREPLACEREADGROUPS { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def suffix = task.ext.suffix ?: "${bam.getExtension()}" + def suffix = task.ext.suffix ?: "${reads.getExtension()}" def reference = fasta ? "--REFERENCE_SEQUENCE ${fasta}" : "" - def create_index = ( suffix == "bam" )? "--CREATE_INDEX" : "" def avail_mem = 3072 if (!task.memory) { log.info '[Picard AddOrReplaceReadGroups] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' @@ -34,7 +33,7 @@ process PICARD_ADDORREPLACEREADGROUPS { avail_mem = (task.memory.mega*0.8).intValue() } - if ("$bam" == "${prefix}.${suffix}") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" + if ("$reads" == "${prefix}.${suffix}") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" """ picard \\ @@ -42,8 +41,7 @@ process PICARD_ADDORREPLACEREADGROUPS { AddOrReplaceReadGroups \\ $args \\ $reference \\ - $create_index \\ - --INPUT ${bam} \\ + --INPUT ${reads} \\ --OUTPUT ${prefix}.${suffix} cat <<-END_VERSIONS > versions.yml @@ -54,15 +52,10 @@ process PICARD_ADDORREPLACEREADGROUPS { stub: def prefix = task.ext.prefix ?: "${meta.id}" - def suffix = task.ext.suffix ?: "${bam.getExtension()}" - if ("$bam" == "${prefix}.${suffix}") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" - def create_index = "" - if (suffix == "bam") { - create_index = "touch ${prefix}.${suffix}.bai" - } + def suffix = task.ext.suffix ?: "${reads.getExtension()}" + if ("$reads" == "${prefix}.${suffix}") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" """ touch ${prefix}.${suffix} - ${create_index} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/picard/addorreplacereadgroups/meta.yml b/modules/nf-core/picard/addorreplacereadgroups/meta.yml index 17110b7875f..efd5b86dc05 100644 --- a/modules/nf-core/picard/addorreplacereadgroups/meta.yml +++ b/modules/nf-core/picard/addorreplacereadgroups/meta.yml @@ -30,10 +30,10 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - bam: + - reads: type: file - description: Input BAM file - pattern: "*.{bam}" + description: Sequence reads file, can be SAM/BAM/CRAM format + pattern: "*.{bam,cram,sam}" - fasta: type: file description: Reference genome file diff --git a/modules/nf-core/picard/addorreplacereadgroups/tests/bam.config b/modules/nf-core/picard/addorreplacereadgroups/tests/bam.config index 8ce837e53f8..3f37c2fd9e1 100644 --- a/modules/nf-core/picard/addorreplacereadgroups/tests/bam.config +++ b/modules/nf-core/picard/addorreplacereadgroups/tests/bam.config @@ -2,6 +2,7 @@ process { withName: 'PICARD_ADDORREPLACEREADGROUPS'{ ext.prefix = { "${meta.id}.replaced"} ext.args = {[ + "--CREATE_INDEX", "-LB ${meta.id}", "-PL ILLUMINA", "-PU bc1", diff --git a/modules/nf-core/picard/addorreplacereadgroups/tests/main.nf.test b/modules/nf-core/picard/addorreplacereadgroups/tests/main.nf.test index 6d50cfe2689..9c029354f15 100644 --- a/modules/nf-core/picard/addorreplacereadgroups/tests/main.nf.test +++ b/modules/nf-core/picard/addorreplacereadgroups/tests/main.nf.test @@ -26,8 +26,12 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(file(process.out.bam[0][1]).name).match("bam_name") }, - { assert snapshot(file(process.out.bai[0][1]).name).match("bai_name") }, + { assert snapshot( + file(process.out.bam[0][1]).name, + file(process.out.bai[0][1]).name, + process.out.versions + ).match() + }, ) } @@ -53,8 +57,11 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(file(process.out.cram[0][1]).name).match("cram_name") }, - { assert snapshot(process.out.versions).match("versions") }, + { assert snapshot( + file(process.out.cram[0][1]).name, + process.out.versions + ).match() + }, ) } diff --git a/modules/nf-core/picard/addorreplacereadgroups/tests/main.nf.test.snap b/modules/nf-core/picard/addorreplacereadgroups/tests/main.nf.test.snap index f80eaba047d..63a55843cee 100644 --- a/modules/nf-core/picard/addorreplacereadgroups/tests/main.nf.test.snap +++ b/modules/nf-core/picard/addorreplacereadgroups/tests/main.nf.test.snap @@ -1,13 +1,16 @@ { - "bam_name": { + "homo_sapiens - cram": { "content": [ - "null.replaced.bam" + "test.replaced.cram", + [ + "versions.yml:md5,0a6f049f94501dcf23aabfbc0e272891" + ] ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T12:05:21.587215" + "timestamp": "2024-03-21T12:05:47.668865" }, "sarscov2 - bam - stub": { "content": [ @@ -21,12 +24,7 @@ ] ], "1": [ - [ - { - - }, - "null.replaced.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" - ] + ], "2": [ @@ -35,12 +33,7 @@ "versions.yml:md5,0a6f049f94501dcf23aabfbc0e272891" ], "bai": [ - [ - { - - }, - "null.replaced.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" - ] + ], "bam": [ [ @@ -62,10 +55,12 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T12:54:03.639457" + "timestamp": "2024-03-21T10:51:24.530553" }, - "versions": { + "sarscov2 - bam": { "content": [ + "null.replaced.bam", + "null.replaced.bai", [ "versions.yml:md5,0a6f049f94501dcf23aabfbc0e272891" ] @@ -74,26 +69,6 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-19T17:32:24.906639" - }, - "cram_name": { - "content": [ - "test.replaced.cram" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-03-20T12:06:05.10743" - }, - "bai_name": { - "content": [ - "null.replaced.bai" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-03-20T12:05:21.604866" + "timestamp": "2024-03-21T12:05:29.696728" } } \ No newline at end of file diff --git a/modules/nf-core/picard/markduplicates/main.nf b/modules/nf-core/picard/markduplicates/main.nf index 80930cc41b6..ad0b296361b 100644 --- a/modules/nf-core/picard/markduplicates/main.nf +++ b/modules/nf-core/picard/markduplicates/main.nf @@ -8,13 +8,14 @@ process PICARD_MARKDUPLICATES { 'biocontainers/picard:3.1.1--hdfd78af_0' }" input: - tuple val(meta), path(bam) + tuple val(meta), path(reads) tuple val(meta2), path(fasta) tuple val(meta3), path(fai) output: - tuple val(meta), path("*.bam") , emit: bam - tuple val(meta), path("*.bai") , optional:true, emit: bai + tuple val(meta), path("*.bam") , emit: bam, optional: true + tuple val(meta), path("*.bai") , emit: bai, optional: true + tuple val(meta), path("*.cram"), emit: cram, optional: true tuple val(meta), path("*.metrics.txt"), emit: metrics path "versions.yml" , emit: versions @@ -24,6 +25,8 @@ process PICARD_MARKDUPLICATES { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def suffix = task.ext.suffix ?: "${reads.getExtension()}" + def reference = fasta ? "--REFERENCE_SEQUENCE ${fasta}" : "" def avail_mem = 3072 if (!task.memory) { log.info '[Picard MarkDuplicates] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' @@ -31,16 +34,16 @@ process PICARD_MARKDUPLICATES { avail_mem = (task.memory.mega*0.8).intValue() } - if ("$bam" == "${prefix}.bam") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" + if ("$reads" == "${prefix}.${suffix}") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" """ picard \\ -Xmx${avail_mem}M \\ MarkDuplicates \\ $args \\ - --INPUT $bam \\ - --OUTPUT ${prefix}.bam \\ - --REFERENCE_SEQUENCE $fasta \\ + --INPUT $reads \\ + --OUTPUT ${prefix}.${suffix} \\ + $reference \\ --METRICS_FILE ${prefix}.MarkDuplicates.metrics.txt cat <<-END_VERSIONS > versions.yml @@ -51,10 +54,10 @@ process PICARD_MARKDUPLICATES { stub: def prefix = task.ext.prefix ?: "${meta.id}" - if ("$bam" == "${prefix}.bam") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" + def suffix = task.ext.suffix ?: "${reads.getExtension()}" + if ("$reads" == "${prefix}.${suffix}") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" """ - touch ${prefix}.bam - touch ${prefix}.bam.bai + touch ${prefix}.${suffix} touch ${prefix}.MarkDuplicates.metrics.txt cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/picard/markduplicates/meta.yml b/modules/nf-core/picard/markduplicates/meta.yml index 1ab90c07542..1f0ffe16c2f 100644 --- a/modules/nf-core/picard/markduplicates/meta.yml +++ b/modules/nf-core/picard/markduplicates/meta.yml @@ -21,9 +21,9 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - bam: + - reads: type: file - description: BAM file + description: Sequence reads file, can be SAM/BAM/CRAM format pattern: "*.{bam,cram,sam}" - meta2: type: map @@ -32,7 +32,7 @@ input: e.g. [ id:'genome' ] - fasta: type: file - description: Reference genome fasta file + description: Reference genome fasta file, required for CRAM input pattern: "*.{fasta,fa}" - meta3: type: map @@ -57,6 +57,10 @@ output: type: file description: An optional BAM index file. If desired, --CREATE_INDEX must be passed as a flag pattern: "*.{bai}" + - cram: + type: file + description: Output CRAM file + pattern: "*.{cram}" - metrics: type: file description: Duplicate metrics file generated by picard diff --git a/modules/nf-core/picard/markduplicates/tests/main.nf.test b/modules/nf-core/picard/markduplicates/tests/main.nf.test index c5a29b4bdd3..e3e97f6cc3a 100644 --- a/modules/nf-core/picard/markduplicates/tests/main.nf.test +++ b/modules/nf-core/picard/markduplicates/tests/main.nf.test @@ -18,14 +18,8 @@ nextflow_process { [ id:'test', single_end:false ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.bam', checkIfExists: true) ]) - input[1] = Channel.of([ - [ id:'genome' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ]) - input[2] = Channel.of([ - [ id:'genome' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) - ]) + input[1] = [ [:], [] ] + input[2] = [ [:], [] ] """ } } @@ -49,14 +43,8 @@ nextflow_process { [ id:'test', single_end:false ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true) ]) - input[1] = Channel.of([ - [ id:'genome' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ]) - input[2] = Channel.of([ - [ id:'genome' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) - ]) + input[1] = [ [:], [] ] + input[2] = [ [:], [] ] """ } } @@ -95,7 +83,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(file(process.out.bam[0][1]).name).match("cram_name") }, + { assert snapshot(file(process.out.cram[0][1]).name).match("cram_name") }, { assert snapshot(path(process.out.metrics.get(0).get(1)).readLines()[0..2]).match("cram_metrics") }, { assert snapshot(process.out.versions).match("cram_versions") } ) diff --git a/modules/nf-core/picard/markduplicates/tests/main.nf.test.snap b/modules/nf-core/picard/markduplicates/tests/main.nf.test.snap index 31c9130dc3d..eb17111e4c5 100644 --- a/modules/nf-core/picard/markduplicates/tests/main.nf.test.snap +++ b/modules/nf-core/picard/markduplicates/tests/main.nf.test.snap @@ -5,39 +5,59 @@ "versions.yml:md5,b699af51b1956f3810f8a7c066e0ab17" ] ], - "timestamp": "2024-01-19T10:26:45.092349" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T15:31:50.928021" }, "unsorted_bam_name": { "content": [ "test.marked.bam" ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, "timestamp": "2024-01-19T10:26:28.100755" }, "cram_metrics": { "content": [ [ "## htsjdk.samtools.metrics.StringHeader", - "# MarkDuplicates --INPUT test.paired_end.sorted.cram --OUTPUT test.marked.bam --METRICS_FILE test.marked.MarkDuplicates.metrics.txt --ASSUME_SORT_ORDER queryname --REFERENCE_SEQUENCE genome.fasta --MAX_SEQUENCES_FOR_DISK_READ_ENDS_MAP 50000 --MAX_FILE_HANDLES_FOR_READ_ENDS_MAP 8000 --SORTING_COLLECTION_SIZE_RATIO 0.25 --TAG_DUPLICATE_SET_MEMBERS false --REMOVE_SEQUENCING_DUPLICATES false --TAGGING_POLICY DontTag --CLEAR_DT true --DUPLEX_UMI false --FLOW_MODE false --FLOW_QUALITY_SUM_STRATEGY false --USE_END_IN_UNPAIRED_READS false --USE_UNPAIRED_CLIPPED_END false --UNPAIRED_END_UNCERTAINTY 0 --FLOW_SKIP_FIRST_N_FLOWS 0 --FLOW_Q_IS_KNOWN_END false --FLOW_EFFECTIVE_QUALITY_THRESHOLD 15 --ADD_PG_TAG_TO_READS true --REMOVE_DUPLICATES false --ASSUME_SORTED false --DUPLICATE_SCORING_STRATEGY SUM_OF_BASE_QUALITIES --PROGRAM_RECORD_ID MarkDuplicates --PROGRAM_GROUP_NAME MarkDuplicates --READ_NAME_REGEX --OPTICAL_DUPLICATE_PIXEL_DISTANCE 100 --MAX_OPTICAL_DUPLICATE_SET_SIZE 300000 --VERBOSITY INFO --QUIET false --VALIDATION_STRINGENCY STRICT --COMPRESSION_LEVEL 5 --MAX_RECORDS_IN_RAM 500000 --CREATE_INDEX false --CREATE_MD5_FILE false --help false --version false --showHidden false --USE_JDK_DEFLATER false --USE_JDK_INFLATER false", + "# MarkDuplicates --INPUT test.paired_end.sorted.cram --OUTPUT test.marked.cram --METRICS_FILE test.marked.MarkDuplicates.metrics.txt --ASSUME_SORT_ORDER queryname --REFERENCE_SEQUENCE genome.fasta --MAX_SEQUENCES_FOR_DISK_READ_ENDS_MAP 50000 --MAX_FILE_HANDLES_FOR_READ_ENDS_MAP 8000 --SORTING_COLLECTION_SIZE_RATIO 0.25 --TAG_DUPLICATE_SET_MEMBERS false --REMOVE_SEQUENCING_DUPLICATES false --TAGGING_POLICY DontTag --CLEAR_DT true --DUPLEX_UMI false --FLOW_MODE false --FLOW_QUALITY_SUM_STRATEGY false --USE_END_IN_UNPAIRED_READS false --USE_UNPAIRED_CLIPPED_END false --UNPAIRED_END_UNCERTAINTY 0 --FLOW_SKIP_FIRST_N_FLOWS 0 --FLOW_Q_IS_KNOWN_END false --FLOW_EFFECTIVE_QUALITY_THRESHOLD 15 --ADD_PG_TAG_TO_READS true --REMOVE_DUPLICATES false --ASSUME_SORTED false --DUPLICATE_SCORING_STRATEGY SUM_OF_BASE_QUALITIES --PROGRAM_RECORD_ID MarkDuplicates --PROGRAM_GROUP_NAME MarkDuplicates --READ_NAME_REGEX --OPTICAL_DUPLICATE_PIXEL_DISTANCE 100 --MAX_OPTICAL_DUPLICATE_SET_SIZE 300000 --VERBOSITY INFO --QUIET false --VALIDATION_STRINGENCY STRICT --COMPRESSION_LEVEL 5 --MAX_RECORDS_IN_RAM 500000 --CREATE_INDEX false --CREATE_MD5_FILE false --help false --version false --showHidden false --USE_JDK_DEFLATER false --USE_JDK_INFLATER false", "## htsjdk.samtools.metrics.StringHeader" ] ], - "timestamp": "2024-01-19T10:27:03.253071" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T15:25:47.518152" }, "sorted_bam_metrics": { "content": [ [ "## htsjdk.samtools.metrics.StringHeader", - "# MarkDuplicates --INPUT test.paired_end.sorted.bam --OUTPUT test.marked.bam --METRICS_FILE test.marked.MarkDuplicates.metrics.txt --ASSUME_SORT_ORDER queryname --REFERENCE_SEQUENCE genome.fasta --MAX_SEQUENCES_FOR_DISK_READ_ENDS_MAP 50000 --MAX_FILE_HANDLES_FOR_READ_ENDS_MAP 8000 --SORTING_COLLECTION_SIZE_RATIO 0.25 --TAG_DUPLICATE_SET_MEMBERS false --REMOVE_SEQUENCING_DUPLICATES false --TAGGING_POLICY DontTag --CLEAR_DT true --DUPLEX_UMI false --FLOW_MODE false --FLOW_QUALITY_SUM_STRATEGY false --USE_END_IN_UNPAIRED_READS false --USE_UNPAIRED_CLIPPED_END false --UNPAIRED_END_UNCERTAINTY 0 --FLOW_SKIP_FIRST_N_FLOWS 0 --FLOW_Q_IS_KNOWN_END false --FLOW_EFFECTIVE_QUALITY_THRESHOLD 15 --ADD_PG_TAG_TO_READS true --REMOVE_DUPLICATES false --ASSUME_SORTED false --DUPLICATE_SCORING_STRATEGY SUM_OF_BASE_QUALITIES --PROGRAM_RECORD_ID MarkDuplicates --PROGRAM_GROUP_NAME MarkDuplicates --READ_NAME_REGEX --OPTICAL_DUPLICATE_PIXEL_DISTANCE 100 --MAX_OPTICAL_DUPLICATE_SET_SIZE 300000 --VERBOSITY INFO --QUIET false --VALIDATION_STRINGENCY STRICT --COMPRESSION_LEVEL 5 --MAX_RECORDS_IN_RAM 500000 --CREATE_INDEX false --CREATE_MD5_FILE false --help false --version false --showHidden false --USE_JDK_DEFLATER false --USE_JDK_INFLATER false", + "# MarkDuplicates --INPUT test.paired_end.sorted.bam --OUTPUT test.marked.bam --METRICS_FILE test.marked.MarkDuplicates.metrics.txt --ASSUME_SORT_ORDER queryname --MAX_SEQUENCES_FOR_DISK_READ_ENDS_MAP 50000 --MAX_FILE_HANDLES_FOR_READ_ENDS_MAP 8000 --SORTING_COLLECTION_SIZE_RATIO 0.25 --TAG_DUPLICATE_SET_MEMBERS false --REMOVE_SEQUENCING_DUPLICATES false --TAGGING_POLICY DontTag --CLEAR_DT true --DUPLEX_UMI false --FLOW_MODE false --FLOW_QUALITY_SUM_STRATEGY false --USE_END_IN_UNPAIRED_READS false --USE_UNPAIRED_CLIPPED_END false --UNPAIRED_END_UNCERTAINTY 0 --FLOW_SKIP_FIRST_N_FLOWS 0 --FLOW_Q_IS_KNOWN_END false --FLOW_EFFECTIVE_QUALITY_THRESHOLD 15 --ADD_PG_TAG_TO_READS true --REMOVE_DUPLICATES false --ASSUME_SORTED false --DUPLICATE_SCORING_STRATEGY SUM_OF_BASE_QUALITIES --PROGRAM_RECORD_ID MarkDuplicates --PROGRAM_GROUP_NAME MarkDuplicates --READ_NAME_REGEX --OPTICAL_DUPLICATE_PIXEL_DISTANCE 100 --MAX_OPTICAL_DUPLICATE_SET_SIZE 300000 --VERBOSITY INFO --QUIET false --VALIDATION_STRINGENCY STRICT --COMPRESSION_LEVEL 5 --MAX_RECORDS_IN_RAM 500000 --CREATE_INDEX false --CREATE_MD5_FILE false --help false --version false --showHidden false --USE_JDK_DEFLATER false --USE_JDK_INFLATER false", "## htsjdk.samtools.metrics.StringHeader" ] ], - "timestamp": "2024-01-19T10:26:45.086503" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-21T11:39:10.318331" }, "cram_name": { "content": [ - "test.marked.bam" + "test.marked.cram" ], - "timestamp": "2024-01-19T10:27:03.241617" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T15:25:47.459663" }, "cram_versions": { "content": [ @@ -45,6 +65,10 @@ "versions.yml:md5,b699af51b1956f3810f8a7c066e0ab17" ] ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, "timestamp": "2024-01-19T10:27:03.26989" }, "unsorted_bam_versions": { @@ -53,22 +77,34 @@ "versions.yml:md5,b699af51b1956f3810f8a7c066e0ab17" ] ], - "timestamp": "2024-01-19T10:26:28.159071" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T15:31:24.040403" }, "unsorted_bam_metrics": { "content": [ [ "## htsjdk.samtools.metrics.StringHeader", - "# MarkDuplicates --INPUT test.paired_end.bam --OUTPUT test.marked.bam --METRICS_FILE test.marked.MarkDuplicates.metrics.txt --ASSUME_SORT_ORDER queryname --REFERENCE_SEQUENCE genome.fasta --MAX_SEQUENCES_FOR_DISK_READ_ENDS_MAP 50000 --MAX_FILE_HANDLES_FOR_READ_ENDS_MAP 8000 --SORTING_COLLECTION_SIZE_RATIO 0.25 --TAG_DUPLICATE_SET_MEMBERS false --REMOVE_SEQUENCING_DUPLICATES false --TAGGING_POLICY DontTag --CLEAR_DT true --DUPLEX_UMI false --FLOW_MODE false --FLOW_QUALITY_SUM_STRATEGY false --USE_END_IN_UNPAIRED_READS false --USE_UNPAIRED_CLIPPED_END false --UNPAIRED_END_UNCERTAINTY 0 --FLOW_SKIP_FIRST_N_FLOWS 0 --FLOW_Q_IS_KNOWN_END false --FLOW_EFFECTIVE_QUALITY_THRESHOLD 15 --ADD_PG_TAG_TO_READS true --REMOVE_DUPLICATES false --ASSUME_SORTED false --DUPLICATE_SCORING_STRATEGY SUM_OF_BASE_QUALITIES --PROGRAM_RECORD_ID MarkDuplicates --PROGRAM_GROUP_NAME MarkDuplicates --READ_NAME_REGEX --OPTICAL_DUPLICATE_PIXEL_DISTANCE 100 --MAX_OPTICAL_DUPLICATE_SET_SIZE 300000 --VERBOSITY INFO --QUIET false --VALIDATION_STRINGENCY STRICT --COMPRESSION_LEVEL 5 --MAX_RECORDS_IN_RAM 500000 --CREATE_INDEX false --CREATE_MD5_FILE false --help false --version false --showHidden false --USE_JDK_DEFLATER false --USE_JDK_INFLATER false", + "# MarkDuplicates --INPUT test.paired_end.bam --OUTPUT test.marked.bam --METRICS_FILE test.marked.MarkDuplicates.metrics.txt --ASSUME_SORT_ORDER queryname --MAX_SEQUENCES_FOR_DISK_READ_ENDS_MAP 50000 --MAX_FILE_HANDLES_FOR_READ_ENDS_MAP 8000 --SORTING_COLLECTION_SIZE_RATIO 0.25 --TAG_DUPLICATE_SET_MEMBERS false --REMOVE_SEQUENCING_DUPLICATES false --TAGGING_POLICY DontTag --CLEAR_DT true --DUPLEX_UMI false --FLOW_MODE false --FLOW_QUALITY_SUM_STRATEGY false --USE_END_IN_UNPAIRED_READS false --USE_UNPAIRED_CLIPPED_END false --UNPAIRED_END_UNCERTAINTY 0 --FLOW_SKIP_FIRST_N_FLOWS 0 --FLOW_Q_IS_KNOWN_END false --FLOW_EFFECTIVE_QUALITY_THRESHOLD 15 --ADD_PG_TAG_TO_READS true --REMOVE_DUPLICATES false --ASSUME_SORTED false --DUPLICATE_SCORING_STRATEGY SUM_OF_BASE_QUALITIES --PROGRAM_RECORD_ID MarkDuplicates --PROGRAM_GROUP_NAME MarkDuplicates --READ_NAME_REGEX --OPTICAL_DUPLICATE_PIXEL_DISTANCE 100 --MAX_OPTICAL_DUPLICATE_SET_SIZE 300000 --VERBOSITY INFO --QUIET false --VALIDATION_STRINGENCY STRICT --COMPRESSION_LEVEL 5 --MAX_RECORDS_IN_RAM 500000 --CREATE_INDEX false --CREATE_MD5_FILE false --help false --version false --showHidden false --USE_JDK_DEFLATER false --USE_JDK_INFLATER false", "## htsjdk.samtools.metrics.StringHeader" ] ], - "timestamp": "2024-01-19T10:26:28.143979" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-21T10:51:12.831787" }, "sorted_bam_name": { "content": [ "test.marked.bam" ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, "timestamp": "2024-01-19T10:26:45.080116" } } \ No newline at end of file diff --git a/subworkflows/nf-core/bam_markduplicates_picard/main.nf b/subworkflows/nf-core/bam_markduplicates_picard/main.nf index de8130fb512..2de059b84aa 100644 --- a/subworkflows/nf-core/bam_markduplicates_picard/main.nf +++ b/subworkflows/nf-core/bam_markduplicates_picard/main.nf @@ -9,7 +9,7 @@ include { BAM_STATS_SAMTOOLS } from '../bam_stats_samtools/main' workflow BAM_MARKDUPLICATES_PICARD { take: - ch_bam // channel: [ val(meta), path(bam) ] + ch_reads // channel: [ val(meta), path(reads) ] ch_fasta // channel: [ path(fasta) ] ch_fai // channel: [ path(fai) ] @@ -17,27 +17,33 @@ workflow BAM_MARKDUPLICATES_PICARD { ch_versions = Channel.empty() - PICARD_MARKDUPLICATES ( ch_bam, ch_fasta, ch_fai ) + PICARD_MARKDUPLICATES ( ch_reads, ch_fasta, ch_fai ) ch_versions = ch_versions.mix(PICARD_MARKDUPLICATES.out.versions.first()) - SAMTOOLS_INDEX ( PICARD_MARKDUPLICATES.out.bam ) + ch_markdup = PICARD_MARKDUPLICATES.out.bam.mix(PICARD_MARKDUPLICATES.out.cram) + + SAMTOOLS_INDEX ( ch_markdup ) ch_versions = ch_versions.mix(SAMTOOLS_INDEX.out.versions.first()) - ch_bam_bai = PICARD_MARKDUPLICATES.out.bam - .join(SAMTOOLS_INDEX.out.bai, by: [0], remainder: true) - .join(SAMTOOLS_INDEX.out.csi, by: [0], remainder: true) - .map{meta, bam, bai, csi -> - if (bai) [ meta, bam, bai ] - else [ meta, bam, csi ] + ch_reads_index = ch_markdup + .join(SAMTOOLS_INDEX.out.bai, by: [0], remainder: true) + .join(SAMTOOLS_INDEX.out.crai, by: [0], remainder: true) + .join(SAMTOOLS_INDEX.out.csi, by: [0], remainder: true) + .map{meta, reads, bai, crai, csi -> + if (bai) [ meta, reads, bai ] + else if (crai) [ meta, reads, crai ] + else [ meta, reads, csi ] } - BAM_STATS_SAMTOOLS ( ch_bam_bai, ch_fasta ) + BAM_STATS_SAMTOOLS ( ch_reads_index, ch_fasta ) ch_versions = ch_versions.mix(BAM_STATS_SAMTOOLS.out.versions) emit: bam = PICARD_MARKDUPLICATES.out.bam // channel: [ val(meta), path(bam) ] - metrics = PICARD_MARKDUPLICATES.out.metrics // channel: [ val(meta), path(bam) ] + cram = PICARD_MARKDUPLICATES.out.cram // channel: [ val(meta), path(cram) ] + metrics = PICARD_MARKDUPLICATES.out.metrics // channel: [ val(meta), path(metrics) ] bai = SAMTOOLS_INDEX.out.bai // channel: [ val(meta), path(bai) ] + crai = SAMTOOLS_INDEX.out.crai // channel: [ val(meta), path(crai) ] csi = SAMTOOLS_INDEX.out.csi // channel: [ val(meta), path(csi) ] stats = BAM_STATS_SAMTOOLS.out.stats // channel: [ val(meta), path(stats) ] diff --git a/subworkflows/nf-core/bam_markduplicates_picard/meta.yml b/subworkflows/nf-core/bam_markduplicates_picard/meta.yml index fe63068e693..433d35b2b89 100644 --- a/subworkflows/nf-core/bam_markduplicates_picard/meta.yml +++ b/subworkflows/nf-core/bam_markduplicates_picard/meta.yml @@ -14,13 +14,13 @@ components: - samtools/flagstat - bam_stats_samtools input: - - ch_bam: + - ch_reads: description: | - BAM/CRAM/SAM file - Structure: [ val(meta), path(bam) ] + Sequence reads in BAM/CRAM/SAM format + Structure: [ val(meta), path(reads) ] - ch_fasta: description: | - Reference genome fasta file + Reference genome fasta file required for CRAM input Structure: [ path(fasta) ] - ch_fasta: description: | @@ -29,12 +29,20 @@ input: output: - bam: description: | - processed BAM/CRAM/SAM file + processed BAM/SAM file Structure: [ val(meta), path(bam) ] - bai: description: | - BAM/CRAM/SAM samtools index + BAM/SAM samtools index Structure: [ val(meta), path(bai) ] + - cram: + description: | + processed CRAM file + Structure: [ val(meta), path(cram) ] + - crai: + description: | + CRAM samtools index + Structure: [ val(meta), path(crai) ] - csi: description: | CSI samtools index diff --git a/subworkflows/nf-core/bam_markduplicates_picard/tests/main.nf.test b/subworkflows/nf-core/bam_markduplicates_picard/tests/main.nf.test index d8d24290842..5ef337dc51a 100644 --- a/subworkflows/nf-core/bam_markduplicates_picard/tests/main.nf.test +++ b/subworkflows/nf-core/bam_markduplicates_picard/tests/main.nf.test @@ -79,8 +79,8 @@ nextflow_workflow { assertAll( { assert workflow.success}, { assert snapshot( - path(workflow.out.bam[0][1]), - path(workflow.out.bai[0][1]), + file(workflow.out.cram[0][1]).name, + path(workflow.out.crai[0][1]), path(workflow.out.flagstat[0][1]), path(workflow.out.idxstats[0][1]), path(workflow.out.stats[0][1]), diff --git a/subworkflows/nf-core/bam_markduplicates_picard/tests/main.nf.test.snap b/subworkflows/nf-core/bam_markduplicates_picard/tests/main.nf.test.snap index 2f02f747a07..caf4ac8ad18 100644 --- a/subworkflows/nf-core/bam_markduplicates_picard/tests/main.nf.test.snap +++ b/subworkflows/nf-core/bam_markduplicates_picard/tests/main.nf.test.snap @@ -1,17 +1,17 @@ { "homo_sapiens - cram": { "content": [ - "test.bam:md5,6641dc05efa8384a061f378d86d922cd", - "test.bam.bai:md5,c41c60d8a94adebe53b6df80b6e90d38", + "test.cram", + "test.cram.crai:md5,78d47ba01ac4e05f3ae1e353902a989e", "test.flagstat:md5,93b0ef463df947ede1f42ff60396c34d", "test.idxstats:md5,e179601fa7b8ebce81ac3765206f6c15", - "test.stats:md5,9ac28e327a7797d7bb6a5922fde59ed1" + "test.stats:md5,c2f74a4d9b2377bcf4f4f184da3801af" ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-13T16:46:16.302755774" + "timestamp": "2024-03-20T20:45:38.364189" }, "sarscov2 - bam": { "content": [ @@ -23,8 +23,8 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-13T16:46:02.942115679" + "timestamp": "2024-03-21T11:38:08.434529" } } \ No newline at end of file diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 49ba2b0102b..42c8e0b0c4e 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -724,9 +724,6 @@ gatk4/createsomaticpanelofnormals: gatk4/determinegermlinecontigploidy: - modules/nf-core/gatk4/determinegermlinecontigploidy/** - tests/modules/nf-core/gatk4/determinegermlinecontigploidy/** -gatk4/estimatelibrarycomplexity: - - modules/nf-core/gatk4/estimatelibrarycomplexity/** - - tests/modules/nf-core/gatk4/estimatelibrarycomplexity/** gatk4/fastqtosam: - modules/nf-core/gatk4/fastqtosam/** - tests/modules/nf-core/gatk4/fastqtosam/** diff --git a/tests/modules/nf-core/gatk4/estimatelibrarycomplexity/main.nf b/tests/modules/nf-core/gatk4/estimatelibrarycomplexity/main.nf deleted file mode 100644 index decc9114132..00000000000 --- a/tests/modules/nf-core/gatk4/estimatelibrarycomplexity/main.nf +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { GATK4_ESTIMATELIBRARYCOMPLEXITY } from '../../../../../modules/nf-core/gatk4/estimatelibrarycomplexity/main.nf' - -workflow test_gatk4_estimatelibrarycomplexity { - - input = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true) - ] - - fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - fai = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) - dict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) - - GATK4_ESTIMATELIBRARYCOMPLEXITY ( input, fasta, fai, dict ) -} diff --git a/tests/modules/nf-core/gatk4/estimatelibrarycomplexity/nextflow.config b/tests/modules/nf-core/gatk4/estimatelibrarycomplexity/nextflow.config deleted file mode 100644 index 8730f1c4b93..00000000000 --- a/tests/modules/nf-core/gatk4/estimatelibrarycomplexity/nextflow.config +++ /dev/null @@ -1,5 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - -} diff --git a/tests/modules/nf-core/gatk4/estimatelibrarycomplexity/test.yml b/tests/modules/nf-core/gatk4/estimatelibrarycomplexity/test.yml deleted file mode 100644 index b2288a6f67c..00000000000 --- a/tests/modules/nf-core/gatk4/estimatelibrarycomplexity/test.yml +++ /dev/null @@ -1,8 +0,0 @@ -- name: gatk4 estimatelibrarycomplexity test_gatk4_estimatelibrarycomplexity - command: nextflow run ./tests/modules/nf-core/gatk4/estimatelibrarycomplexity -entry test_gatk4_estimatelibrarycomplexity -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/gatk4/estimatelibrarycomplexity/nextflow.config - tags: - - gatk4/estimatelibrarycomplexity - - gatk4 - files: - - path: output/gatk4/test.metrics - - path: output/gatk4/versions.yml From c455770c0fca7e55427a666260524dc50521f2b1 Mon Sep 17 00:00:00 2001 From: NP Date: Thu, 21 Mar 2024 17:35:50 +0100 Subject: [PATCH 08/18] Decoupler module (#5317) * pytest * init nf core for decoupler * added first version * renamed file to avoid circular import * added docker container * fixed bug * fixed bug * fixed bug v3 * fixed space * Attempt of download test data for unit test * added testing * ignored csvs * added test dir * changed test * Removed deprecated testing * Updated test config file * Updated test script * Test running and passing (only check execution) * added testing * fixed bug * changed test * fixed escape tabs * Removed templates folder * Updated documentation * changed testing * Updated documentation * added indents * removed todo statements * added docker * removed lines * Revert "pytest" This reverts commit 0f5e2f94b82c4e90d2892652fad26031676dc64b. * rolled back .gitignore changes * All arguments passed as single arg now sad :( * removed quotations * Added documentation for arguments * changed decoupler to decoupler/decoupler * Fixed indentation in docs * changed decoupler to submodule of decoupler * changed format * changed test * Fixed cache of numba * Updated test snapshot * Fixed version incompatibility between conda and docker --------- Co-authored-by: Attila Gabor Co-authored-by: Victor Paton Co-authored-by: Victor Paton <67371346+vicpaton@users.noreply.github.com> --- modules/nf-core/decoupler/decoupler/main.nf | 71 ++++++++++++++++ modules/nf-core/decoupler/decoupler/meta.yml | 83 +++++++++++++++++++ .../decoupler/decoupler/tests/main.nf.test | 38 +++++++++ .../decoupler/tests/main.nf.test.snap | 71 ++++++++++++++++ .../decoupler/decoupler/tests/nextflow.config | 6 ++ .../decoupler/decoupler/tests/tags.yml | 2 + tests/config/test_data.config | 2 + 7 files changed, 273 insertions(+) create mode 100644 modules/nf-core/decoupler/decoupler/main.nf create mode 100644 modules/nf-core/decoupler/decoupler/meta.yml create mode 100644 modules/nf-core/decoupler/decoupler/tests/main.nf.test create mode 100644 modules/nf-core/decoupler/decoupler/tests/main.nf.test.snap create mode 100644 modules/nf-core/decoupler/decoupler/tests/nextflow.config create mode 100644 modules/nf-core/decoupler/decoupler/tests/tags.yml diff --git a/modules/nf-core/decoupler/decoupler/main.nf b/modules/nf-core/decoupler/decoupler/main.nf new file mode 100644 index 00000000000..9a88b499935 --- /dev/null +++ b/modules/nf-core/decoupler/decoupler/main.nf @@ -0,0 +1,71 @@ +process DECOUPLER { + tag "$meta.id" + label 'process_medium' + + conda "conda-forge::decoupler-py=1.6.0" + container = "ghcr.io/saezlab/publish-packages/decoupler:sha-5838309" + + input: + tuple val(meta), path(mat) + path(net) + + output: + tuple val(meta), path("*estimate__decoupler.tsv"), emit: dc_estimate + tuple val(meta), path("*pvals__decoupler.tsv"), emit: dc_pvals + path("versions.yml"), emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: "{}" + """ + #!/usr/bin/env python3 + import os + import pandas as pd + + os.environ["NUMBA_CACHE_DIR"] = "./tmp" + + import decoupler as dc + + methods = ['aucell', 'gsea', 'gsva', 'mdt', 'mlm', 'ora', 'udt', + 'ulm', 'viper', 'wmean', 'wsum'] + + mat = pd.read_csv("${mat}", sep="\t", index_col=0) + net = pd.read_csv("${net}", sep="\t", index_col=0) + + # Parsing arguments + args = ${args} + parsedargs = {'args': {}} + + for k, v in args.items(): + # Specific method argument + if k.split('_')[0] in methods: + meth = k.split('_')[0] + arg = '_'.join(k.split('_')[1:]) + + if meth not in args['args'].keys(): + parsedargs['args'][meth] = {arg: v} + else: + parsedargs['args'][meth].update({arg: v}) + + # Generic argument + else: + parsedargs[k] = v + + + results = dc.decouple( + mat=mat, + net=net, + **parsedargs + ) + + for result in results: + results[result].to_csv(result + "__decoupler.tsv", sep="\t") + + ## VERSIONS FILE + with open('versions.yml', 'a') as version_file: + version_file.write('"${task.process}":' + "\\n") + version_file.write("\tdecoupler-py: " + dc.__version__ + "\\n") + """ +} diff --git a/modules/nf-core/decoupler/decoupler/meta.yml b/modules/nf-core/decoupler/decoupler/meta.yml new file mode 100644 index 00000000000..4188611897b --- /dev/null +++ b/modules/nf-core/decoupler/decoupler/meta.yml @@ -0,0 +1,83 @@ +name: "decoupler" + +description: | + decoupler is a package containing different statistical methods + to extract biological activities from omics data within a unified framework. + It allows to flexibly test any enrichment method with any prior knowledge + resource and incorporates methods that take into account the sign and weight. + It can be used with any omic, as long as its features can be linked to a + biological process based on prior knowledge. For example, in transcriptomics + gene sets regulated by a transcription factor, or in phospho-proteomics + phosphosites that are targeted by a kinase. + +keywords: + - enrichment + - omics + - biological activity + - functional analysis + - prior knowledge + +tools: + - "decoupler": + description: "Ensemble of methods to infer biological activities from omics data" + homepage: "https://github.com/saezlab/decoupler-py" + documentation: "https://decoupler-py.readthedocs.io/en/latest/api.html" + tool_dev_url: "https://decoupler-py.readthedocs.io" + doi: "10.1093/bioadv/vbac016" + licence: ["GPL v3"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:‘test’, single_end ] + - mat: + type: file + description: | + Path to the matrix file (e.g. gene/protein expression, etc.). + Should be in in tab-separated format (`*.tab`) + pattern: "*.tsv" + - net: + type: file + description: | + The prior knowledge network linking the features of the + expression matrix to a process/component (e.g. gene set, + transcription factor, kinase, etc.) + pattern: "*.tsv" + - args: + type: string + description: | + Keyword arguments passed to `decoupler.decouple()` (see + documentation for more information here: + https://decoupler-py.readthedocs.io/en/latest/generated/decoupler.decouple.html#decoupler.decouple). + Arguments specific for a method must be specified with + the method name as a prefix e.g. `'gsea_batch_size'` + pattern: "{arg: val, ..., method_arg: val}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:‘test’, single_end ] + - dc_estimate: + type: file + description: | + The file containing the estimation results of the enrichment(s) + pattern: "*estimate__decoupler.tsv" + - dc_pvals: + type: file + description: | + The file containing the p-value associated to the estimation + results of the enrichment(s) + pattern: "*pvals__decoupler.tsv" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@gabora" + - "@vicpaton" + - "@Nic-Nic" diff --git a/modules/nf-core/decoupler/decoupler/tests/main.nf.test b/modules/nf-core/decoupler/decoupler/tests/main.nf.test new file mode 100644 index 00000000000..921ac3254e7 --- /dev/null +++ b/modules/nf-core/decoupler/decoupler/tests/main.nf.test @@ -0,0 +1,38 @@ +nextflow_process { + + name "Test Process DECOUPLER" + script "../main.nf" + config "./nextflow.config" + process "DECOUPLER" + + tag "modules" + tag "modules_nfcore" + tag "decoupler" + tag "decoupler/decoupler" + + test("decoupler_test") { + + when { + process { + """ + input[0] = [ + [ id: 'test' ], + file(params.test_data['generic']['tsv']['expression'], checkIfExists: true) + ] + input[1] = [ + file(params.test_data['generic']['tsv']['network'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/decoupler/decoupler/tests/main.nf.test.snap b/modules/nf-core/decoupler/decoupler/tests/main.nf.test.snap new file mode 100644 index 00000000000..e94e29f34f1 --- /dev/null +++ b/modules/nf-core/decoupler/decoupler/tests/main.nf.test.snap @@ -0,0 +1,71 @@ +{ + "decoupler_test": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "consensus_estimate__decoupler.tsv:md5,f762d3282a81c61b127e97d044e9ddd7", + "mlm_estimate__decoupler.tsv:md5,ce7ce3c710fe188035b6706512ffbf54", + "ulm_estimate__decoupler.tsv:md5,14773953134037a208fe3c95c893acae", + "wsum_estimate__decoupler.tsv:md5,2488716cfe85c1306cb76cf117808d97" + ] + ] + ], + "1": [ + [ + { + "id": "test" + }, + [ + "consensus_pvals__decoupler.tsv:md5,35850081a4308deba35d171a266bedd0", + "mlm_pvals__decoupler.tsv:md5,016a15c3dcf688fcdf3ccbd40e06d64f", + "ulm_pvals__decoupler.tsv:md5,531a3ed641bf3c1b0b105cfaee5864cd", + "wsum_pvals__decoupler.tsv:md5,fac9e18b9495ca8a9ae92a015eed3043" + ] + ] + ], + "2": [ + "versions.yml:md5,01a24ec9e3499a0d2f54e7fb173537be" + ], + "dc_estimate": [ + [ + { + "id": "test" + }, + [ + "consensus_estimate__decoupler.tsv:md5,f762d3282a81c61b127e97d044e9ddd7", + "mlm_estimate__decoupler.tsv:md5,ce7ce3c710fe188035b6706512ffbf54", + "ulm_estimate__decoupler.tsv:md5,14773953134037a208fe3c95c893acae", + "wsum_estimate__decoupler.tsv:md5,2488716cfe85c1306cb76cf117808d97" + ] + ] + ], + "dc_pvals": [ + [ + { + "id": "test" + }, + [ + "consensus_pvals__decoupler.tsv:md5,35850081a4308deba35d171a266bedd0", + "mlm_pvals__decoupler.tsv:md5,016a15c3dcf688fcdf3ccbd40e06d64f", + "ulm_pvals__decoupler.tsv:md5,531a3ed641bf3c1b0b105cfaee5864cd", + "wsum_pvals__decoupler.tsv:md5,fac9e18b9495ca8a9ae92a015eed3043" + ] + ] + ], + "versions": [ + "versions.yml:md5,01a24ec9e3499a0d2f54e7fb173537be" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-21T15:58:23.677564728" + } +} \ No newline at end of file diff --git a/modules/nf-core/decoupler/decoupler/tests/nextflow.config b/modules/nf-core/decoupler/decoupler/tests/nextflow.config new file mode 100644 index 00000000000..ed3ab576c55 --- /dev/null +++ b/modules/nf-core/decoupler/decoupler/tests/nextflow.config @@ -0,0 +1,6 @@ +process { + withName: "DECOUPLER" { + ext.prefix = 'test' + ext.args = "{'min_n': 1}" + } +} diff --git a/modules/nf-core/decoupler/decoupler/tests/tags.yml b/modules/nf-core/decoupler/decoupler/tests/tags.yml new file mode 100644 index 00000000000..3d5e5ab14ad --- /dev/null +++ b/modules/nf-core/decoupler/decoupler/tests/tags.yml @@ -0,0 +1,2 @@ +decoupler/decoupler: + - "modules/nf-core/decoupler/decoupler/**" diff --git a/tests/config/test_data.config b/tests/config/test_data.config index 8fc66237c33..e412f127b68 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -680,6 +680,8 @@ params { } 'tsv' { test_tsv = "${params.test_data_base}/data/generic/tsv/test.tsv" + expression = "${params.test_data_base}/data/generic/tsv/expression.tsv" + network = "${params.test_data_base}/data/generic/tsv/network.tsv" } 'txt' { hello = "${params.test_data_base}/data/generic/txt/hello.txt" From 6af4979ee1a57c986102175d9e1bb7ab834f3ae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20B=C3=A4uerle?= <45968370+famosab@users.noreply.github.com> Date: Fri, 22 Mar 2024 12:47:19 +0100 Subject: [PATCH 09/18] port `tiddit-sv` to nf-test and add `--threads` (#5371) * start porting * fix con * adjust tests and add snapshot * add threads argument * remove old pytest files * add bwa/index tag * fix meta for linting * update assertions to include more * modify meta map --- modules/nf-core/tiddit/sv/main.nf | 1 + modules/nf-core/tiddit/sv/meta.yml | 12 +- modules/nf-core/tiddit/sv/tests/main.nf.test | 193 ++++++++++++++++++ .../nf-core/tiddit/sv/tests/main.nf.test.snap | 99 +++++++++ .../nf-core/tiddit/sv/tests/nextflow.config | 5 + modules/nf-core/tiddit/sv/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 - tests/modules/nf-core/tiddit/sv/main.nf | 73 ------- .../modules/nf-core/tiddit/sv/nextflow.config | 9 - tests/modules/nf-core/tiddit/sv/test.yml | 43 ---- 10 files changed, 311 insertions(+), 129 deletions(-) create mode 100644 modules/nf-core/tiddit/sv/tests/main.nf.test create mode 100644 modules/nf-core/tiddit/sv/tests/main.nf.test.snap create mode 100644 modules/nf-core/tiddit/sv/tests/nextflow.config create mode 100644 modules/nf-core/tiddit/sv/tests/tags.yml delete mode 100644 tests/modules/nf-core/tiddit/sv/main.nf delete mode 100644 tests/modules/nf-core/tiddit/sv/nextflow.config delete mode 100644 tests/modules/nf-core/tiddit/sv/test.yml diff --git a/modules/nf-core/tiddit/sv/main.nf b/modules/nf-core/tiddit/sv/main.nf index 0f4bc7cb523..f350e314430 100644 --- a/modules/nf-core/tiddit/sv/main.nf +++ b/modules/nf-core/tiddit/sv/main.nf @@ -31,6 +31,7 @@ process TIDDIT_SV { tiddit \\ --sv \\ $args \\ + --threads $task.cpus \\ --bam $input \\ --ref $fasta \\ -o $prefix diff --git a/modules/nf-core/tiddit/sv/meta.yml b/modules/nf-core/tiddit/sv/meta.yml index b13ae5cdcb2..bfcbc4e3fd8 100644 --- a/modules/nf-core/tiddit/sv/meta.yml +++ b/modules/nf-core/tiddit/sv/meta.yml @@ -21,14 +21,24 @@ input: type: file description: BAM/CRAM file pattern: "*.{bam,cram}" - - index: + - input_index: type: file description: BAM/CRAM index file pattern: "*.{bai,crai}" + - meta2: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test_fasta']` - fasta: type: file description: Input FASTA file pattern: "*.{fasta,fa}" + - meta3: + type: map + description: | + Groovy Map containing sample information from bwa index + e.g. `[ id:'test_bwa-index' ]` - bwa_index: type: file description: BWA genome index files diff --git a/modules/nf-core/tiddit/sv/tests/main.nf.test b/modules/nf-core/tiddit/sv/tests/main.nf.test new file mode 100644 index 00000000000..6e32b9e1cf9 --- /dev/null +++ b/modules/nf-core/tiddit/sv/tests/main.nf.test @@ -0,0 +1,193 @@ +nextflow_process { + + name "Test Process TIDDIT_SV" + script "../main.nf" + process "TIDDIT_SV" + + tag "modules" + tag "modules_nfcore" + tag "tiddit" + tag "tiddit/sv" + tag "bwa/index" + + test("sarscov2 - bam - bwa") { + + setup { + + run("BWA_INDEX") { + script "../../../../nf-core/bwa/index/main.nf" + process { + """ + input[0] = [ [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + } + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + ] + // fasta + input[1] = [ [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + // bwa_index + input[2] = BWA_INDEX.out.index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.vcf.get(0).get(1)).readLines().contains("##fileformat=VCFv4.1") }, + { assert path(process.out.ploidy.get(0).get(1)).readLines().contains("Chromosome Ploidy Ploidy_rounded Mean_coverage") }, + { assert snapshot(process.out.versions).match("bam_bwa_version") } + ) + } + + } + + test("sarscov2 - bam - no_bwa") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + ] + // fasta + input[1] = [ [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + // bwa_index + input[2] = [ [], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.vcf.get(0).get(1)).readLines().contains("##fileformat=VCFv4.1") }, + { assert path(process.out.ploidy.get(0).get(1)).readLines().contains("Chromosome Ploidy Ploidy_rounded Mean_coverage") }, + { assert snapshot(process.out.versions).match("bam_version") } + ) + } + + } + + test("human - cram - bwa") { + + setup { + + run("BWA_INDEX") { + script "../../../../nf-core/bwa/index/main.nf" + process { + """ + input[0] = [ [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + } + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true) + ] + // fasta + input[1] = [ [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + // bwa_index + input[2] = BWA_INDEX.out.index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.vcf.get(0).get(1)).readLines().contains("##fileformat=VCFv4.1") }, + { assert path(process.out.ploidy.get(0).get(1)).readLines().contains("Chromosome Ploidy Ploidy_rounded Mean_coverage") }, + { assert snapshot(process.out.versions).match("cram_bwa_version") }) + } + + } + + test("human - cram - no_bwa") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true) + ] + // fasta + input[1] = [ [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + // bwa_index + input[2] = [ [], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.vcf.get(0).get(1)).readLines().contains("##fileformat=VCFv4.1") }, + { assert path(process.out.ploidy.get(0).get(1)).readLines().contains("Chromosome Ploidy Ploidy_rounded Mean_coverage") }, + { assert snapshot(process.out.versions).match("cram_version") }) + } + + } + + test("sarscov2 - bam - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + ] + // fasta + input[1] = [ [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + // bwa_index + input[2] = [ [], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/tiddit/sv/tests/main.nf.test.snap b/modules/nf-core/tiddit/sv/tests/main.nf.test.snap new file mode 100644 index 00000000000..541c48bbdd3 --- /dev/null +++ b/modules/nf-core/tiddit/sv/tests/main.nf.test.snap @@ -0,0 +1,99 @@ +{ + "cram_bwa_version": { + "content": [ + [ + "versions.yml:md5,0ffcce416e40bcc98da2243f1d7e348a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-22T10:33:01.300519" + }, + "cram_version": { + "content": [ + [ + "versions.yml:md5,0ffcce416e40bcc98da2243f1d7e348a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-22T10:27:12.52902" + }, + "sarscov2 - bam - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.ploidies.tab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,0ffcce416e40bcc98da2243f1d7e348a" + ], + "ploidy": [ + [ + { + "id": "test" + }, + "test.ploidies.tab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,0ffcce416e40bcc98da2243f1d7e348a" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-22T10:21:51.950503" + }, + "bam_bwa_version": { + "content": [ + [ + "versions.yml:md5,0ffcce416e40bcc98da2243f1d7e348a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-22T10:31:40.918479" + }, + "bam_version": { + "content": [ + [ + "versions.yml:md5,0ffcce416e40bcc98da2243f1d7e348a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-22T10:21:38.449053" + } +} \ No newline at end of file diff --git a/modules/nf-core/tiddit/sv/tests/nextflow.config b/modules/nf-core/tiddit/sv/tests/nextflow.config new file mode 100644 index 00000000000..9bbd0bee51d --- /dev/null +++ b/modules/nf-core/tiddit/sv/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: 'TIDDIT_SV' { + ext.args = '--skip_assembly' + } +} diff --git a/modules/nf-core/tiddit/sv/tests/tags.yml b/modules/nf-core/tiddit/sv/tests/tags.yml new file mode 100644 index 00000000000..aac5351ecc6 --- /dev/null +++ b/modules/nf-core/tiddit/sv/tests/tags.yml @@ -0,0 +1,2 @@ +tiddit/sv: + - "modules/nf-core/tiddit/sv/**" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 42c8e0b0c4e..a4b8ac9b98d 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -2192,9 +2192,6 @@ tbprofiler/profile: tiara/tiara: - modules/nf-core/tiara/tiara/** - tests/modules/nf-core/tiara/tiara/** -tiddit/sv: - - modules/nf-core/tiddit/sv/** - - tests/modules/nf-core/tiddit/sv/** topas/gencons: - modules/nf-core/topas/gencons/** - tests/modules/nf-core/topas/gencons/** diff --git a/tests/modules/nf-core/tiddit/sv/main.nf b/tests/modules/nf-core/tiddit/sv/main.nf deleted file mode 100644 index c4600df76b1..00000000000 --- a/tests/modules/nf-core/tiddit/sv/main.nf +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { BWA_INDEX } from '../../../../../modules/nf-core/bwa/index/main.nf' -include { TIDDIT_SV as TIDDIT_SV_BAM } from '../../../../../modules/nf-core/tiddit/sv/main.nf' -include { TIDDIT_SV as TIDDIT_SV_BAM_NO_BWA } from '../../../../../modules/nf-core/tiddit/sv/main.nf' -include { TIDDIT_SV as TIDDIT_SV_CRAM } from '../../../../../modules/nf-core/tiddit/sv/main.nf' -include { TIDDIT_SV as TIDDIT_SV_CRAM_NO_BWA } from '../../../../../modules/nf-core/tiddit/sv/main.nf' - -workflow test_tiddit_sv_bam { - input = [ - [ id:'test' ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], - [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] - ] - - fasta = [ - [id: 'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - - BWA_INDEX( fasta ) - - TIDDIT_SV_BAM ( input, fasta, BWA_INDEX.out.index) -} - -workflow test_tiddit_sv_bam_no_bwa { - input = [ - [ id:'test' ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], - [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true) ] - ] - - fasta = [ - [id: 'test'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - - TIDDIT_SV_BAM_NO_BWA ( input, fasta, [[],[]]) -} - -workflow test_tiddit_sv_cram { - input = [ - [ id:'test' ], // meta map - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true) ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true) ] - ] - - fasta = [ - [id: 'test'], - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - ] - - BWA_INDEX( fasta ) - - TIDDIT_SV_CRAM ( input, fasta, BWA_INDEX.out.index) -} - -workflow test_tiddit_sv_cram_no_bwa { - input = [ - [ id:'test' ], // meta map - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true) ], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true) ] - ] - - fasta = [ - [id: 'test'], - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - ] - - TIDDIT_SV_CRAM_NO_BWA ( input, fasta, [[],[]]) -} diff --git a/tests/modules/nf-core/tiddit/sv/nextflow.config b/tests/modules/nf-core/tiddit/sv/nextflow.config deleted file mode 100644 index 9e4480df1c2..00000000000 --- a/tests/modules/nf-core/tiddit/sv/nextflow.config +++ /dev/null @@ -1,9 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: 'TIDDIT_SV_BAM_NO_BWA|TIDDIT_SV_CRAM_NO_BWA' { - ext.args = '--skip_assembly' - } - -} diff --git a/tests/modules/nf-core/tiddit/sv/test.yml b/tests/modules/nf-core/tiddit/sv/test.yml deleted file mode 100644 index 586d1070389..00000000000 --- a/tests/modules/nf-core/tiddit/sv/test.yml +++ /dev/null @@ -1,43 +0,0 @@ -- name: tiddit sv test_tiddit_sv_bam - command: nextflow run ./tests/modules/nf-core/tiddit/sv -entry test_tiddit_sv_bam -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/tiddit/sv/nextflow.config - tags: - - tiddit - - tiddit/sv - files: - - path: output/tiddit/test.ploidies.tab - md5sum: c69e73fe090b260d379205935c64b63c - - path: output/tiddit/test.vcf - md5sum: 2ff97cdcd328c498fdb5aace82bc11e3 - -- name: tiddit sv test_tiddit_sv_bam_no_bwa - command: nextflow run ./tests/modules/nf-core/tiddit/sv -entry test_tiddit_sv_bam_no_bwa -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/tiddit/sv/nextflow.config - tags: - - tiddit - - tiddit/sv - files: - - path: output/tiddit/test.ploidies.tab - md5sum: c69e73fe090b260d379205935c64b63c - - path: output/tiddit/test.vcf - md5sum: f28d5d5e1a27117e8820d82afc09a4ec - -- name: tiddit sv test_tiddit_sv_cram - command: nextflow run ./tests/modules/nf-core/tiddit/sv -entry test_tiddit_sv_cram -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/tiddit/sv/nextflow.config - tags: - - tiddit - - tiddit/sv - files: - - path: output/tiddit/test.ploidies.tab - md5sum: 13c4762ede32d319e8582cf7d6d77b71 - - path: output/tiddit/test.vcf - md5sum: b778ea5e390bf3c8f140a92ab6ae1231 - -- name: tiddit sv test_tiddit_sv_cram_no_bwa - command: nextflow run ./tests/modules/nf-core/tiddit/sv -entry test_tiddit_sv_cram_no_bwa -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/tiddit/sv/nextflow.config - tags: - - tiddit - - tiddit/sv - files: - - path: output/tiddit/test.ploidies.tab - md5sum: 13c4762ede32d319e8582cf7d6d77b71 - - path: output/tiddit/test.vcf - md5sum: f6f06ffba6df0aecdd1974775a05cbe6 From ebc1733b77c702f19fe42076a5edfcbaa0d84f66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20B=C3=A4uerle?= <45968370+famosab@users.noreply.github.com> Date: Fri, 22 Mar 2024 14:12:12 +0100 Subject: [PATCH 10/18] port `manta-germline` to nf-test (#5362) * feat: add nf-test files for manta/germline * feat: remove old pytest files * feat: snapshot * fix commas * fix gz in stub * fix jointcalling test * new snapshot without filepaths * new snapshot --- modules/nf-core/manta/germline/main.nf | 6 +- .../nf-core/manta/germline/tests/main.nf.test | 162 ++++++++++++++++++ .../manta/germline/tests/main.nf.test.snap | 139 +++++++++++++++ .../manta/germline/tests/nextflow.config | 5 + modules/nf-core/manta/germline/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 - tests/modules/nf-core/manta/germline/main.nf | 63 ------- .../nf-core/manta/germline/nextflow.config | 9 - tests/modules/nf-core/manta/germline/test.yml | 36 ---- 9 files changed, 311 insertions(+), 114 deletions(-) create mode 100644 modules/nf-core/manta/germline/tests/main.nf.test create mode 100644 modules/nf-core/manta/germline/tests/main.nf.test.snap create mode 100644 modules/nf-core/manta/germline/tests/nextflow.config create mode 100644 modules/nf-core/manta/germline/tests/tags.yml delete mode 100644 tests/modules/nf-core/manta/germline/main.nf delete mode 100644 tests/modules/nf-core/manta/germline/nextflow.config delete mode 100644 tests/modules/nf-core/manta/germline/test.yml diff --git a/modules/nf-core/manta/germline/main.nf b/modules/nf-core/manta/germline/main.nf index 5d5666c6e5c..c1b339a95b1 100644 --- a/modules/nf-core/manta/germline/main.nf +++ b/modules/nf-core/manta/germline/main.nf @@ -66,11 +66,11 @@ process MANTA_GERMLINE { stub: def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.candidate_small_indels.vcf.gz + echo "" | gzip > ${prefix}.candidate_small_indels.vcf.gz touch ${prefix}.candidate_small_indels.vcf.gz.tbi - touch ${prefix}.candidate_sv.vcf.gz + echo "" | gzip > ${prefix}.candidate_sv.vcf.gz touch ${prefix}.candidate_sv.vcf.gz.tbi - touch ${prefix}.diploid_sv.vcf.gz + echo "" | gzip > ${prefix}.diploid_sv.vcf.gz touch ${prefix}.diploid_sv.vcf.gz.tbi cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/manta/germline/tests/main.nf.test b/modules/nf-core/manta/germline/tests/main.nf.test new file mode 100644 index 00000000000..1d49ad23a19 --- /dev/null +++ b/modules/nf-core/manta/germline/tests/main.nf.test @@ -0,0 +1,162 @@ +nextflow_process { + + name "Test Process MANTA_GERMLINE" + script "../main.nf" + process "MANTA_GERMLINE" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "manta" + tag "manta/germline" + + test("human - cram") { + + when { + process { + """ + input[0] = [ [ id:'test'], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true), + [],[] + ] + // fasta + input[1] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + // fai + input[2] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ] + // config + input[3] = Channel.of("[manta]", "enableRemoteReadRetrievalForInsertionsInGermlineCallingModes = 0") + .collectFile(name:"manta_options.ini", newLine:true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.candidate_small_indels_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.candidate_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.diploid_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert snapshot(process.out.version).match("version") } + ) + } + + } + + test("human - cram - bed") { + + when { + process { + """ + input[0] = [ [ id:'bed_test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed.gz.tbi', checkIfExists: true) + ] + // fasta + input[1] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + // fai + input[2] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ] + // config + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.candidate_small_indels_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.candidate_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.diploid_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert snapshot(process.out.version).match("bed_version") } + ) + } + + } + + test("human - cram - bed - jointcalling") { + + when { + process { + """ + input[0] = [ [ id:'bed_test', single_end:false ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.sorted.cram', checkIfExists: true) + ], + [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test2.paired_end.sorted.cram.crai', checkIfExists: true) + ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed.gz.tbi', checkIfExists: true) + ] + // fasta + input[1] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + // fai + input[2] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ] + // config + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.candidate_small_indels_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.candidate_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert path(process.out.diploid_sv_vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.1") }, + { assert snapshot(process.out.version).match("joint_version") } + ) + } + + } + test("human - cram - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test'], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true), + [],[] + ] + // fasta + input[1] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + // fai + input[2] = [ [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ] + // config + input[3] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/manta/germline/tests/main.nf.test.snap b/modules/nf-core/manta/germline/tests/main.nf.test.snap new file mode 100644 index 00000000000..79d5541e323 --- /dev/null +++ b/modules/nf-core/manta/germline/tests/main.nf.test.snap @@ -0,0 +1,139 @@ +{ + "human - cram - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.candidate_small_indels.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.candidate_small_indels.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test" + }, + "test.candidate_sv.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "3": [ + [ + { + "id": "test" + }, + "test.candidate_sv.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + { + "id": "test" + }, + "test.diploid_sv.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "5": [ + [ + { + "id": "test" + }, + "test.diploid_sv.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + "versions.yml:md5,18070b443a26855ef64dafa179dfba01" + ], + "candidate_small_indels_vcf": [ + [ + { + "id": "test" + }, + "test.candidate_small_indels.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "candidate_small_indels_vcf_tbi": [ + [ + { + "id": "test" + }, + "test.candidate_small_indels.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "candidate_sv_vcf": [ + [ + { + "id": "test" + }, + "test.candidate_sv.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "candidate_sv_vcf_tbi": [ + [ + { + "id": "test" + }, + "test.candidate_sv.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "diploid_sv_vcf": [ + [ + { + "id": "test" + }, + "test.diploid_sv.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "diploid_sv_vcf_tbi": [ + [ + { + "id": "test" + }, + "test.diploid_sv.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,18070b443a26855ef64dafa179dfba01" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-21T17:54:09.788372" + }, + "joint_version": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-21T15:03:07.745972" + }, + "bed_version": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-21T13:49:38.745653" + }, + "version": { + "content": null, + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-21T13:49:14.885769" + } +} \ No newline at end of file diff --git a/modules/nf-core/manta/germline/tests/nextflow.config b/modules/nf-core/manta/germline/tests/nextflow.config new file mode 100644 index 00000000000..22acb242657 --- /dev/null +++ b/modules/nf-core/manta/germline/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: MANTA_GERMLINE { + ext.args = '--exome ' + } +} diff --git a/modules/nf-core/manta/germline/tests/tags.yml b/modules/nf-core/manta/germline/tests/tags.yml new file mode 100644 index 00000000000..99d1a73ca3c --- /dev/null +++ b/modules/nf-core/manta/germline/tests/tags.yml @@ -0,0 +1,2 @@ +manta/germline: + - "modules/nf-core/manta/germline/**" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index a4b8ac9b98d..a8d39d32802 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1210,9 +1210,6 @@ mageck/test: manta/convertinversion: - modules/nf-core/manta/convertinversion/** - tests/modules/nf-core/manta/convertinversion/** -manta/germline: - - modules/nf-core/manta/germline/** - - tests/modules/nf-core/manta/germline/** mapad/index: - modules/nf-core/mapad/index/** - tests/modules/nf-core/mapad/index/** diff --git a/tests/modules/nf-core/manta/germline/main.nf b/tests/modules/nf-core/manta/germline/main.nf deleted file mode 100644 index b6be6c2d741..00000000000 --- a/tests/modules/nf-core/manta/germline/main.nf +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { MANTA_GERMLINE } from '../../../../../modules/nf-core/manta/germline/main.nf' - -workflow test_manta_germline { - input = [ [ id:'test'], // meta map - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true)], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true)], - [],[] - ] - fasta = [ [id:'genome'], - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - ] - - fai = [ [id:'genome'], - file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) - ] - - config = Channel.of("[manta]", "enableRemoteReadRetrievalForInsertionsInGermlineCallingModes = 0") - .collectFile(name:"manta_options.ini", newLine:true) - - MANTA_GERMLINE ( input, fasta, fai, config ) -} - -workflow test_manta_germline_target_bed { - input = [ [ id:'test'], // meta map - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true)], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true)], - file(params.test_data['homo_sapiens']['genome']['genome_bed_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_bed_gz_tbi'], checkIfExists: true), - ] - fasta = [ [id:'genome'], - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - ] - - fai = [ [id:'genome'], - file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) - ] - - MANTA_GERMLINE ( input, fasta, fai, [] ) -} - -workflow test_manta_germline_target_bed_jointcalling { - input = [ [ id:'test'], // meta map - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_cram'], checkIfExists: true)], - [ file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_cram_crai'], checkIfExists: true)], - file(params.test_data['homo_sapiens']['genome']['genome_bed_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_bed_gz_tbi'], checkIfExists: true), - ] - fasta = [ [id:'genome'], - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - ] - - fai = [ [id:'genome'], - file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) - ] - - MANTA_GERMLINE ( input, fasta, fai, [] ) -} diff --git a/tests/modules/nf-core/manta/germline/nextflow.config b/tests/modules/nf-core/manta/germline/nextflow.config deleted file mode 100644 index c82e3c5c479..00000000000 --- a/tests/modules/nf-core/manta/germline/nextflow.config +++ /dev/null @@ -1,9 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: MANTA_GERMLINE { - ext.args = '--exome ' - } - -} diff --git a/tests/modules/nf-core/manta/germline/test.yml b/tests/modules/nf-core/manta/germline/test.yml deleted file mode 100644 index 7a7b32402d7..00000000000 --- a/tests/modules/nf-core/manta/germline/test.yml +++ /dev/null @@ -1,36 +0,0 @@ -- name: manta germline - command: nextflow run ./tests/modules/nf-core/manta/germline -entry test_manta_germline -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/manta/germline/nextflow.config - tags: - - manta - - manta/germline - files: - - path: output/manta/test.candidate_small_indels.vcf.gz - - path: output/manta/test.candidate_small_indels.vcf.gz.tbi - - path: output/manta/test.candidate_sv.vcf.gz - - path: output/manta/test.candidate_sv.vcf.gz.tbi - - path: output/manta/test.diploid_sv.vcf.gz - - path: output/manta/test.diploid_sv.vcf.gz.tbi -- name: manta germline target bed - command: nextflow run ./tests/modules/nf-core/manta/germline -entry test_manta_germline_target_bed -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/manta/germline/nextflow.config - tags: - - manta - - manta/germline - files: - - path: output/manta/test.candidate_small_indels.vcf.gz - - path: output/manta/test.candidate_small_indels.vcf.gz.tbi - - path: output/manta/test.candidate_sv.vcf.gz - - path: output/manta/test.candidate_sv.vcf.gz.tbi - - path: output/manta/test.diploid_sv.vcf.gz - - path: output/manta/test.diploid_sv.vcf.gz.tbi -- name: manta germline target bed jointcalling - command: nextflow run ./tests/modules/nf-core/manta/germline -entry test_manta_germline_target_bed_jointcalling -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/manta/germline/nextflow.config - tags: - - manta - - manta/germline - files: - - path: output/manta/test.candidate_small_indels.vcf.gz - - path: output/manta/test.candidate_small_indels.vcf.gz.tbi - - path: output/manta/test.candidate_sv.vcf.gz - - path: output/manta/test.candidate_sv.vcf.gz.tbi - - path: output/manta/test.diploid_sv.vcf.gz - - path: output/manta/test.diploid_sv.vcf.gz.tbi From ac469916ecde2b68d2929691815b032e99d9c7d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20B=C3=A4uerle?= <45968370+famosab@users.noreply.github.com> Date: Fri, 22 Mar 2024 16:45:16 +0100 Subject: [PATCH 11/18] port `ensemblvep/download` to nf-test (#5373) * start porting vep dl * snapshot * remove pyest files, update snapshot --- .../ensemblvep/download/tests/main.nf.test | 74 ++++ .../download/tests/main.nf.test.snap | 322 ++++++++++++++++++ .../download/tests}/nextflow.config | 4 - .../ensemblvep/download/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 - .../nf-core/ensemblvep/download/main.nf | 14 - .../nf-core/ensemblvep/download/test.yml | 7 - 7 files changed, 398 insertions(+), 28 deletions(-) create mode 100644 modules/nf-core/ensemblvep/download/tests/main.nf.test create mode 100644 modules/nf-core/ensemblvep/download/tests/main.nf.test.snap rename {tests/modules/nf-core/ensemblvep/download => modules/nf-core/ensemblvep/download/tests}/nextflow.config (56%) create mode 100644 modules/nf-core/ensemblvep/download/tests/tags.yml delete mode 100644 tests/modules/nf-core/ensemblvep/download/main.nf delete mode 100644 tests/modules/nf-core/ensemblvep/download/test.yml diff --git a/modules/nf-core/ensemblvep/download/tests/main.nf.test b/modules/nf-core/ensemblvep/download/tests/main.nf.test new file mode 100644 index 00000000000..0c09c6f872e --- /dev/null +++ b/modules/nf-core/ensemblvep/download/tests/main.nf.test @@ -0,0 +1,74 @@ +nextflow_process { + + name "Test Process ENSEMBLVEP_DOWNLOAD" + script "../main.nf" + process "ENSEMBLVEP_DOWNLOAD" + + tag "modules" + tag "modules_nfcore" + tag "ensemblvep" + tag "ensemblvep/download" + + test("celegans - download") { + + config "./nextflow.config" + + when { + params { + vep_species = "caenorhabditis_elegans" + vep_genome = "WBcel235" + vep_cache_version = "110" + } + + process { + """ + input[0] = [ [id:"${params.vep_cache_version}_${params.vep_genome}"], + params.vep_genome, + params.vep_species, + params.vep_cache_version + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("celegans - download - stub") { + + options "-stub" + + when { + params { + vep_species = "caenorhabditis_elegans" + vep_genome = "WBcel235" + vep_cache_version = "110" + } + + process { + """ + input[0] = [ [id:"${params.vep_cache_version}_${params.vep_genome}"], + params.vep_genome, + params.vep_species, + params.vep_cache_version + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/ensemblvep/download/tests/main.nf.test.snap b/modules/nf-core/ensemblvep/download/tests/main.nf.test.snap new file mode 100644 index 00000000000..7aadba983ac --- /dev/null +++ b/modules/nf-core/ensemblvep/download/tests/main.nf.test.snap @@ -0,0 +1,322 @@ +{ + "celegans - download": { + "content": [ + { + "0": [ + [ + { + "id": "110_WBcel235" + }, + [ + [ + [ + [ + "1-1000000.gz:md5,583afc2dd5f7d25b3e7695bc8289b1f7", + "10000001-11000000.gz:md5,0be1e09275b1abc4edb4e175bd10e6ee", + "1000001-2000000.gz:md5,86be01237a4c21c0a1c3f2ef03339d06", + "11000001-12000000.gz:md5,b02908d912d1c9b1afcc8a192fd5e182", + "12000001-13000000.gz:md5,b869fb77ebc624a9e1c9ebd0bab82310", + "13000001-14000000.gz:md5,63bc4e028cf740dd71c5309196893d3c", + "14000001-15000000.gz:md5,e09d846e57ffb7fde0b4e98fb73bbf23", + "15000001-16000000.gz:md5,ede9395eb21e67982f20baece5205f8f", + "2000001-3000000.gz:md5,b46b68052100789a48c4c25904c06b9b", + "3000001-4000000.gz:md5,d2cc0a8e62b97356659d490023fbee4c", + "4000001-5000000.gz:md5,da2fef013649c81123573b2a8ffa8d92", + "5000001-6000000.gz:md5,5d0c436677f5d9b56a070070c6a68605", + "6000001-7000000.gz:md5,05805b48722c95942d301c0c7fa59915", + "7000001-8000000.gz:md5,e63cc3550c0dc6003b31e2a82f2a9746", + "8000001-9000000.gz:md5,f44e774d0dea2886a764bc4031d13db2", + "9000001-10000000.gz:md5,6336d271bda4d12de90051dcd09a1ec1" + ], + [ + "1-1000000.gz:md5,20001a99e5def3f8e2608d7b94a6f335", + "10000001-11000000.gz:md5,9dbc8366578e129c9679ecba10682741", + "1000001-2000000.gz:md5,375b3dae6f11a172beaecb7d4b00bed0", + "11000001-12000000.gz:md5,c43e3d71a06180f1dc516018d5e5336b", + "12000001-13000000.gz:md5,90f8710d166b66dfbac88c39de3523e3", + "13000001-14000000.gz:md5,a9088cb1b529a2cb078ceb4e8da98821", + "14000001-15000000.gz:md5,17ed1b01ce5215d911366d842c87cb91", + "15000001-16000000.gz:md5,24a7353536a82340bed7a1e0cf02c79e", + "2000001-3000000.gz:md5,dfb8451bcd00788c5f924c8bbe64248a", + "3000001-4000000.gz:md5,1881845ab903c7ebe64c0592af3eb252", + "4000001-5000000.gz:md5,48b35c3208d2687c178ecfc2401c07bc", + "5000001-6000000.gz:md5,ed8eb1cf74dfc61c0560481e4cc646ca", + "6000001-7000000.gz:md5,c67e04c089aac4e15829a629dc0073e8", + "7000001-8000000.gz:md5,dbba311d9a61aa2eb2e91ed5950ec449", + "8000001-9000000.gz:md5,fa103a066535ab348ae25f12e490336c", + "9000001-10000000.gz:md5,bf496c9a4f071b2a68fa4ac883111b76" + ], + [ + "1-1000000.gz:md5,4f2a80f1a1f8060e76e15df12a9ca8a3", + "10000001-11000000.gz:md5,d3015f342bc1bd402e0e4bcb9a0c5079", + "1000001-2000000.gz:md5,26e164d5ec338ff82cb4f4f29831325e", + "11000001-12000000.gz:md5,6bc5fb2893b826c57527f57779750f1f", + "12000001-13000000.gz:md5,212c279bd859b1ed842eb3bdc8e066a0", + "13000001-14000000.gz:md5,ab1fedf2e1e2c55d57c1946e87f96875", + "2000001-3000000.gz:md5,c9b3a8c8a622d065ba5caecc9007f7ce", + "3000001-4000000.gz:md5,78bfb96b00f4650e1e52948183c3aa6a", + "4000001-5000000.gz:md5,c5952f21400d399cbd11f52feae9900e", + "5000001-6000000.gz:md5,ac7f4096e94a231b7d36785551270d6f", + "6000001-7000000.gz:md5,74ccce6ff76ea01afc5a1a817e5954ef", + "7000001-8000000.gz:md5,340a4c394d927cf9254b87f79cea5ee9", + "8000001-9000000.gz:md5,a4d49771b14fc5ac6d878cdf69267e24", + "9000001-10000000.gz:md5,b0c1a3590d862b93fd8ea4027bacbfb6" + ], + [ + "1-1000000.gz:md5,b27d5333d9158316079e0499fbcbfbec", + "10000001-11000000.gz:md5,d0b15ff19af04030c98298ff40663865", + "1000001-2000000.gz:md5,90abbd3b0b98e6d457b098014c47d291", + "11000001-12000000.gz:md5,c8b8ae60a346800034a6bddeffa53f0b", + "12000001-13000000.gz:md5,ac488556d80dcae4d42236a711d9690e", + "13000001-14000000.gz:md5,028b542e5486b9d83982825f4125c83e", + "14000001-15000000.gz:md5,7f2c1b1b025ec77017b39b6b0891a942", + "15000001-16000000.gz:md5,1f034f22265608b4ede85befd5ba7a5f", + "16000001-17000000.gz:md5,eb61bc1f70ea20e976b147d7985ab941", + "17000001-18000000.gz:md5,cef7b278dbb00ea8ef944a5e7082cfcd", + "2000001-3000000.gz:md5,e781b8e704cb8c83af7f71c3cbac59c0", + "3000001-4000000.gz:md5,63d0132e8678a0c75b5f85eba4e73fb2", + "4000001-5000000.gz:md5,c6c23205c9b1bbc667aa531f1bb6ca96", + "5000001-6000000.gz:md5,7e8708dd1f260f67eeeea9bc8bd107ea", + "6000001-7000000.gz:md5,bae948a3ab3473b4367ad337e5c7d104", + "7000001-8000000.gz:md5,4836fbb1780c2bb6eb3c991f9ce10014", + "8000001-9000000.gz:md5,c30b56587b43b703f065a81f83ba5136", + "9000001-10000000.gz:md5,4ffad93b07b1177c5f84781f7858dee4" + ], + [ + "1-1000000.gz:md5,bb89b84c869b44f0a03f143dfcdd01e0" + ], + [ + "1-1000000.gz:md5,4c4e2a27a9f83b2c598bd28b068c12a4", + "10000001-11000000.gz:md5,1f1acd76206c9c374838fb919f5638a5", + "1000001-2000000.gz:md5,6ddd611ba692772465f620c8f4abe34f", + "11000001-12000000.gz:md5,f8ef9525f317b1dcd96c5c0632f45d85", + "12000001-13000000.gz:md5,dfcf6f1af7ad0fb5e7c34568ad93f943", + "13000001-14000000.gz:md5,14f8730e160840b557bbbb2d17e1539d", + "14000001-15000000.gz:md5,6f0a4cd6fc29d30b1a573ebcee240d53", + "15000001-16000000.gz:md5,5db25671056a7fa426190c42afeae7b4", + "16000001-17000000.gz:md5,4103332737b5c669261baf85c66be0bf", + "17000001-18000000.gz:md5,92ab0c8c8ba98397a711513063315ba2", + "18000001-19000000.gz:md5,bb6c3d0b4ad0b3b14b3392456c251f96", + "19000001-20000000.gz:md5,d85f0ac77ce2f4ce0d946ffca2f9cf52", + "20000001-21000000.gz:md5,9904ccc4ba904393a4c901acce502125", + "2000001-3000000.gz:md5,ee4f68141716a3abef91654776abaf22", + "3000001-4000000.gz:md5,a7cf02c764bd1c238e644178c91e210e", + "4000001-5000000.gz:md5,0a42103d48449752df803d7dd5a78e68", + "5000001-6000000.gz:md5,afa23a6a3de361ab9c099b46f964955c", + "6000001-7000000.gz:md5,b8b2093321c0317e578751435b7936eb", + "7000001-8000000.gz:md5,5a3dacc1e3493170b397df824de64d64", + "8000001-9000000.gz:md5,e22a6133b261f333e6c2d39422cea14f", + "9000001-10000000.gz:md5,c8655c03043a9b351089ab0b9f512ffc" + ], + [ + "1-1000000.gz:md5,73d105b83767991d351173bb340a9cc4", + "10000001-11000000.gz:md5,b7f0ec8b10eadc7150f897a58b8769e0", + "1000001-2000000.gz:md5,0034026b5434fd2530cd2ee97fffbadb", + "11000001-12000000.gz:md5,a0046b289b0eb88f00c5dd08e6645886", + "12000001-13000000.gz:md5,8aba1b3a489c9e3de88ba49fb133b401", + "13000001-14000000.gz:md5,5c0dc514504d69ac1a3522a2162c5026", + "14000001-15000000.gz:md5,e95fa7b8e851d17bd5f9964f25882a55", + "15000001-16000000.gz:md5,c9b8b56e32c9cdb938619f5267ad8d61", + "16000001-17000000.gz:md5,a479805e35e0b7b02aa2afc299caa83a", + "17000001-18000000.gz:md5,48b645e7986d0133d42ede43b8ba60fd", + "2000001-3000000.gz:md5,5c0db2a6ae15ba44586a7c3792d6c9e5", + "3000001-4000000.gz:md5,245c563d5ec574a22bf81baffa80d93a", + "4000001-5000000.gz:md5,62e74bd74a7ffba50875f96915327197", + "5000001-6000000.gz:md5,cfcf9ee2af6eb2d14ac4724e6a0285d0", + "6000001-7000000.gz:md5,e2ee5fb626828bc8c30bac724525ce45", + "7000001-8000000.gz:md5,a8da29f0b52f1011bff11034392ce940", + "8000001-9000000.gz:md5,ddeda7ec3b3888642e5510f0b83e8e6c", + "9000001-10000000.gz:md5,675936b84ccd24da892a5396c28a07f9" + ], + "chr_synonyms.txt:md5,8a6fce00cc7817ec727c49b7954f10bc", + "info.txt:md5,33ccb74a030a9a345051628c337cb8af" + ] + ] + ] + ] + ], + "1": [ + "versions.yml:md5,aa3b969e6e50b03b42b0322db7c3286a" + ], + "cache": [ + [ + { + "id": "110_WBcel235" + }, + [ + [ + [ + [ + "1-1000000.gz:md5,583afc2dd5f7d25b3e7695bc8289b1f7", + "10000001-11000000.gz:md5,0be1e09275b1abc4edb4e175bd10e6ee", + "1000001-2000000.gz:md5,86be01237a4c21c0a1c3f2ef03339d06", + "11000001-12000000.gz:md5,b02908d912d1c9b1afcc8a192fd5e182", + "12000001-13000000.gz:md5,b869fb77ebc624a9e1c9ebd0bab82310", + "13000001-14000000.gz:md5,63bc4e028cf740dd71c5309196893d3c", + "14000001-15000000.gz:md5,e09d846e57ffb7fde0b4e98fb73bbf23", + "15000001-16000000.gz:md5,ede9395eb21e67982f20baece5205f8f", + "2000001-3000000.gz:md5,b46b68052100789a48c4c25904c06b9b", + "3000001-4000000.gz:md5,d2cc0a8e62b97356659d490023fbee4c", + "4000001-5000000.gz:md5,da2fef013649c81123573b2a8ffa8d92", + "5000001-6000000.gz:md5,5d0c436677f5d9b56a070070c6a68605", + "6000001-7000000.gz:md5,05805b48722c95942d301c0c7fa59915", + "7000001-8000000.gz:md5,e63cc3550c0dc6003b31e2a82f2a9746", + "8000001-9000000.gz:md5,f44e774d0dea2886a764bc4031d13db2", + "9000001-10000000.gz:md5,6336d271bda4d12de90051dcd09a1ec1" + ], + [ + "1-1000000.gz:md5,20001a99e5def3f8e2608d7b94a6f335", + "10000001-11000000.gz:md5,9dbc8366578e129c9679ecba10682741", + "1000001-2000000.gz:md5,375b3dae6f11a172beaecb7d4b00bed0", + "11000001-12000000.gz:md5,c43e3d71a06180f1dc516018d5e5336b", + "12000001-13000000.gz:md5,90f8710d166b66dfbac88c39de3523e3", + "13000001-14000000.gz:md5,a9088cb1b529a2cb078ceb4e8da98821", + "14000001-15000000.gz:md5,17ed1b01ce5215d911366d842c87cb91", + "15000001-16000000.gz:md5,24a7353536a82340bed7a1e0cf02c79e", + "2000001-3000000.gz:md5,dfb8451bcd00788c5f924c8bbe64248a", + "3000001-4000000.gz:md5,1881845ab903c7ebe64c0592af3eb252", + "4000001-5000000.gz:md5,48b35c3208d2687c178ecfc2401c07bc", + "5000001-6000000.gz:md5,ed8eb1cf74dfc61c0560481e4cc646ca", + "6000001-7000000.gz:md5,c67e04c089aac4e15829a629dc0073e8", + "7000001-8000000.gz:md5,dbba311d9a61aa2eb2e91ed5950ec449", + "8000001-9000000.gz:md5,fa103a066535ab348ae25f12e490336c", + "9000001-10000000.gz:md5,bf496c9a4f071b2a68fa4ac883111b76" + ], + [ + "1-1000000.gz:md5,4f2a80f1a1f8060e76e15df12a9ca8a3", + "10000001-11000000.gz:md5,d3015f342bc1bd402e0e4bcb9a0c5079", + "1000001-2000000.gz:md5,26e164d5ec338ff82cb4f4f29831325e", + "11000001-12000000.gz:md5,6bc5fb2893b826c57527f57779750f1f", + "12000001-13000000.gz:md5,212c279bd859b1ed842eb3bdc8e066a0", + "13000001-14000000.gz:md5,ab1fedf2e1e2c55d57c1946e87f96875", + "2000001-3000000.gz:md5,c9b3a8c8a622d065ba5caecc9007f7ce", + "3000001-4000000.gz:md5,78bfb96b00f4650e1e52948183c3aa6a", + "4000001-5000000.gz:md5,c5952f21400d399cbd11f52feae9900e", + "5000001-6000000.gz:md5,ac7f4096e94a231b7d36785551270d6f", + "6000001-7000000.gz:md5,74ccce6ff76ea01afc5a1a817e5954ef", + "7000001-8000000.gz:md5,340a4c394d927cf9254b87f79cea5ee9", + "8000001-9000000.gz:md5,a4d49771b14fc5ac6d878cdf69267e24", + "9000001-10000000.gz:md5,b0c1a3590d862b93fd8ea4027bacbfb6" + ], + [ + "1-1000000.gz:md5,b27d5333d9158316079e0499fbcbfbec", + "10000001-11000000.gz:md5,d0b15ff19af04030c98298ff40663865", + "1000001-2000000.gz:md5,90abbd3b0b98e6d457b098014c47d291", + "11000001-12000000.gz:md5,c8b8ae60a346800034a6bddeffa53f0b", + "12000001-13000000.gz:md5,ac488556d80dcae4d42236a711d9690e", + "13000001-14000000.gz:md5,028b542e5486b9d83982825f4125c83e", + "14000001-15000000.gz:md5,7f2c1b1b025ec77017b39b6b0891a942", + "15000001-16000000.gz:md5,1f034f22265608b4ede85befd5ba7a5f", + "16000001-17000000.gz:md5,eb61bc1f70ea20e976b147d7985ab941", + "17000001-18000000.gz:md5,cef7b278dbb00ea8ef944a5e7082cfcd", + "2000001-3000000.gz:md5,e781b8e704cb8c83af7f71c3cbac59c0", + "3000001-4000000.gz:md5,63d0132e8678a0c75b5f85eba4e73fb2", + "4000001-5000000.gz:md5,c6c23205c9b1bbc667aa531f1bb6ca96", + "5000001-6000000.gz:md5,7e8708dd1f260f67eeeea9bc8bd107ea", + "6000001-7000000.gz:md5,bae948a3ab3473b4367ad337e5c7d104", + "7000001-8000000.gz:md5,4836fbb1780c2bb6eb3c991f9ce10014", + "8000001-9000000.gz:md5,c30b56587b43b703f065a81f83ba5136", + "9000001-10000000.gz:md5,4ffad93b07b1177c5f84781f7858dee4" + ], + [ + "1-1000000.gz:md5,bb89b84c869b44f0a03f143dfcdd01e0" + ], + [ + "1-1000000.gz:md5,4c4e2a27a9f83b2c598bd28b068c12a4", + "10000001-11000000.gz:md5,1f1acd76206c9c374838fb919f5638a5", + "1000001-2000000.gz:md5,6ddd611ba692772465f620c8f4abe34f", + "11000001-12000000.gz:md5,f8ef9525f317b1dcd96c5c0632f45d85", + "12000001-13000000.gz:md5,dfcf6f1af7ad0fb5e7c34568ad93f943", + "13000001-14000000.gz:md5,14f8730e160840b557bbbb2d17e1539d", + "14000001-15000000.gz:md5,6f0a4cd6fc29d30b1a573ebcee240d53", + "15000001-16000000.gz:md5,5db25671056a7fa426190c42afeae7b4", + "16000001-17000000.gz:md5,4103332737b5c669261baf85c66be0bf", + "17000001-18000000.gz:md5,92ab0c8c8ba98397a711513063315ba2", + "18000001-19000000.gz:md5,bb6c3d0b4ad0b3b14b3392456c251f96", + "19000001-20000000.gz:md5,d85f0ac77ce2f4ce0d946ffca2f9cf52", + "20000001-21000000.gz:md5,9904ccc4ba904393a4c901acce502125", + "2000001-3000000.gz:md5,ee4f68141716a3abef91654776abaf22", + "3000001-4000000.gz:md5,a7cf02c764bd1c238e644178c91e210e", + "4000001-5000000.gz:md5,0a42103d48449752df803d7dd5a78e68", + "5000001-6000000.gz:md5,afa23a6a3de361ab9c099b46f964955c", + "6000001-7000000.gz:md5,b8b2093321c0317e578751435b7936eb", + "7000001-8000000.gz:md5,5a3dacc1e3493170b397df824de64d64", + "8000001-9000000.gz:md5,e22a6133b261f333e6c2d39422cea14f", + "9000001-10000000.gz:md5,c8655c03043a9b351089ab0b9f512ffc" + ], + [ + "1-1000000.gz:md5,73d105b83767991d351173bb340a9cc4", + "10000001-11000000.gz:md5,b7f0ec8b10eadc7150f897a58b8769e0", + "1000001-2000000.gz:md5,0034026b5434fd2530cd2ee97fffbadb", + "11000001-12000000.gz:md5,a0046b289b0eb88f00c5dd08e6645886", + "12000001-13000000.gz:md5,8aba1b3a489c9e3de88ba49fb133b401", + "13000001-14000000.gz:md5,5c0dc514504d69ac1a3522a2162c5026", + "14000001-15000000.gz:md5,e95fa7b8e851d17bd5f9964f25882a55", + "15000001-16000000.gz:md5,c9b8b56e32c9cdb938619f5267ad8d61", + "16000001-17000000.gz:md5,a479805e35e0b7b02aa2afc299caa83a", + "17000001-18000000.gz:md5,48b645e7986d0133d42ede43b8ba60fd", + "2000001-3000000.gz:md5,5c0db2a6ae15ba44586a7c3792d6c9e5", + "3000001-4000000.gz:md5,245c563d5ec574a22bf81baffa80d93a", + "4000001-5000000.gz:md5,62e74bd74a7ffba50875f96915327197", + "5000001-6000000.gz:md5,cfcf9ee2af6eb2d14ac4724e6a0285d0", + "6000001-7000000.gz:md5,e2ee5fb626828bc8c30bac724525ce45", + "7000001-8000000.gz:md5,a8da29f0b52f1011bff11034392ce940", + "8000001-9000000.gz:md5,ddeda7ec3b3888642e5510f0b83e8e6c", + "9000001-10000000.gz:md5,675936b84ccd24da892a5396c28a07f9" + ], + "chr_synonyms.txt:md5,8a6fce00cc7817ec727c49b7954f10bc", + "info.txt:md5,33ccb74a030a9a345051628c337cb8af" + ] + ] + ] + ] + ], + "versions": [ + "versions.yml:md5,aa3b969e6e50b03b42b0322db7c3286a" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-22T12:05:07.2862" + }, + "celegans - download - stub": { + "content": [ + { + "0": [ + [ + { + "id": "110_WBcel235" + }, + [ + + ] + ] + ], + "1": [ + "versions.yml:md5,aa3b969e6e50b03b42b0322db7c3286a" + ], + "cache": [ + [ + { + "id": "110_WBcel235" + }, + [ + + ] + ] + ], + "versions": [ + "versions.yml:md5,aa3b969e6e50b03b42b0322db7c3286a" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-22T12:43:38.447524" + } +} \ No newline at end of file diff --git a/tests/modules/nf-core/ensemblvep/download/nextflow.config b/modules/nf-core/ensemblvep/download/tests/nextflow.config similarity index 56% rename from tests/modules/nf-core/ensemblvep/download/nextflow.config rename to modules/nf-core/ensemblvep/download/tests/nextflow.config index 28c8e007ff9..8e88821d3f1 100644 --- a/tests/modules/nf-core/ensemblvep/download/nextflow.config +++ b/modules/nf-core/ensemblvep/download/tests/nextflow.config @@ -1,9 +1,5 @@ process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - withName: ENSEMBLVEP_DOWNLOAD { ext.args = '--AUTO c --CONVERT --NO_BIOPERL --NO_HTSLIB --NO_TEST --NO_UPDATE' } - } diff --git a/modules/nf-core/ensemblvep/download/tests/tags.yml b/modules/nf-core/ensemblvep/download/tests/tags.yml new file mode 100644 index 00000000000..26671f3d31e --- /dev/null +++ b/modules/nf-core/ensemblvep/download/tests/tags.yml @@ -0,0 +1,2 @@ +ensemblvep/download: + - "modules/nf-core/ensemblvep/download/**" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index a8d39d32802..abc04e7100a 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -576,9 +576,6 @@ emmtyper: endorspy: - modules/nf-core/endorspy/** - tests/modules/nf-core/endorspy/** -ensemblvep/download: - - modules/nf-core/ensemblvep/download/** - - tests/modules/nf-core/ensemblvep/download/** ensemblvep/filtervep: - modules/nf-core/ensemblvep/filtervep/** - tests/modules/nf-core/ensemblvep/filtervep/** diff --git a/tests/modules/nf-core/ensemblvep/download/main.nf b/tests/modules/nf-core/ensemblvep/download/main.nf deleted file mode 100644 index dc3d39a5dd1..00000000000 --- a/tests/modules/nf-core/ensemblvep/download/main.nf +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { ENSEMBLVEP_DOWNLOAD } from '../../../../../modules/nf-core/ensemblvep/download/main' - -vep_cache_version = "110" -vep_genome = "WBcel235" -vep_species = "caenorhabditis_elegans" -vep_cache_input = Channel.of([[id:"${vep_cache_version}_${vep_genome}"], vep_genome, vep_species, vep_cache_version]) - -workflow test_ensemblvep_download { - ENSEMBLVEP_DOWNLOAD(vep_cache_input) -} diff --git a/tests/modules/nf-core/ensemblvep/download/test.yml b/tests/modules/nf-core/ensemblvep/download/test.yml deleted file mode 100644 index ca826f9000b..00000000000 --- a/tests/modules/nf-core/ensemblvep/download/test.yml +++ /dev/null @@ -1,7 +0,0 @@ -- name: ensemblvep test_ensemblvep_download - command: nextflow run ./tests/modules/nf-core/ensemblvep/download -entry test_ensemblvep_download -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/ensemblvep/download/nextflow.config - tags: - - ensemblvep - - ensemblvep/download - files: - - path: output/ensemblvep/vep_cache/caenorhabditis_elegans/110_WBcel235/ From 7afd02d048ad0100be37fa1741816265c4aa307c Mon Sep 17 00:00:00 2001 From: Leon Rauschning <99650940+lrauschning@users.noreply.github.com> Date: Fri, 22 Mar 2024 17:03:27 +0100 Subject: [PATCH 12/18] Update kalign module to work with compressed files. (#5277) * add compression handling to kalign * push conda to version 3.4 * fix version number * commit tests * update snapshot --------- Co-authored-by: Luisa Santus --- modules/nf-core/kalign/align/environment.yml | 3 +- modules/nf-core/kalign/align/main.nf | 20 +++--- modules/nf-core/kalign/align/meta.yml | 11 ++-- .../nf-core/kalign/align/tests/main.nf.test | 29 +++++++-- .../kalign/align/tests/main.nf.test.snap | 65 +++++++++++++++---- 5 files changed, 97 insertions(+), 31 deletions(-) diff --git a/modules/nf-core/kalign/align/environment.yml b/modules/nf-core/kalign/align/environment.yml index 88aff8afcdd..93563eaeb56 100644 --- a/modules/nf-core/kalign/align/environment.yml +++ b/modules/nf-core/kalign/align/environment.yml @@ -4,4 +4,5 @@ channels: - bioconda - defaults dependencies: - - bioconda::kalign3=3.3.5 + - bioconda::kalign3=3.4.0 + - conda-forge::pigz=2.8 diff --git a/modules/nf-core/kalign/align/main.nf b/modules/nf-core/kalign/align/main.nf index 6eed8162da3..e1601e15baa 100644 --- a/modules/nf-core/kalign/align/main.nf +++ b/modules/nf-core/kalign/align/main.nf @@ -4,15 +4,16 @@ process KALIGN_ALIGN { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/kalign3:3.3.5--hdbdd923_0': - 'biocontainers/kalign3:3.3.5--hdbdd923_0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-5cd0277547c6b33133225c8ce14c0cf2a4396ea2:0a70b6d89a3e06fbdc4a735461e8b98ff32ee5de-0': + 'biocontainers/mulled-v2-5cd0277547c6b33133225c8ce14c0cf2a4396ea2:0a70b6d89a3e06fbdc4a735461e8b98ff32ee5de-0' }" input: tuple val(meta), path(fasta) + val(compress) output: - tuple val(meta), path("*.aln"), emit: alignment - path "versions.yml" , emit: versions + tuple val(meta), path("*.aln{.gz,}"), emit: alignment + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -20,15 +21,17 @@ process KALIGN_ALIGN { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def write_output = compress ? ">(pigz -cp ${task.cpus} > ${prefix}.aln.gz)" : "${prefix}.aln" """ + unpigz -cdf $fasta | \\ kalign \\ $args \\ - -i $fasta \\ - -o ${prefix}.aln + -o ${write_output} cat <<-END_VERSIONS > versions.yml "${task.process}": - kalign : \$(echo \$(kalign -v) | sed 's/kalign //g' ) + kalign: \$(echo \$(kalign -v) | sed 's/kalign //g' ) + pigz: \$(echo \$(pigz --version 2>&1) | sed 's/^.*pigz\\w*//' )) END_VERSIONS """ @@ -36,11 +39,12 @@ process KALIGN_ALIGN { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.aln + touch ${prefix}.aln${compress ? '.gz' : ''} cat <<-END_VERSIONS > versions.yml "${task.process}": kalign : \$(echo \$(kalign -v) | sed 's/kalign //g' ) + pigz: \$(echo \$(pigz --version 2>&1) | sed 's/^.*pigz\\w*//' )) END_VERSIONS """ } diff --git a/modules/nf-core/kalign/align/meta.yml b/modules/nf-core/kalign/align/meta.yml index 58e7d868013..187f6bc3fae 100644 --- a/modules/nf-core/kalign/align/meta.yml +++ b/modules/nf-core/kalign/align/meta.yml @@ -20,8 +20,11 @@ input: e.g. `[ id:'test']` - fasta: type: file - description: Input sequences in FASTA format - pattern: "*.{fa,fasta}" + description: Input sequences in FASTA format. May be gzipped or uncompressed. + pattern: "*.{fa,fasta}{.gz,}" + - compress: + type: boolean + description: Flag representing whether the output MSA should be compressed. Set to true to enable/false to disable compression. Compression is done using pigz, and is multithreaded. output: - meta: type: map @@ -30,8 +33,8 @@ output: e.g. `[ id:'test']` - alignment: type: file - description: Alignment file. - pattern: "*.{aln}" + description: Alignment file. May be gzipped or uncompressed, depending on if `compress` is set to `true` or `false`. + pattern: "*.{aln}{.gz,}" - versions: type: file description: File containing software versions diff --git a/modules/nf-core/kalign/align/tests/main.nf.test b/modules/nf-core/kalign/align/tests/main.nf.test index f2b83a2b651..d90ad9b094f 100644 --- a/modules/nf-core/kalign/align/tests/main.nf.test +++ b/modules/nf-core/kalign/align/tests/main.nf.test @@ -10,7 +10,7 @@ nextflow_process { tag "kalign" tag "kalign/align" - test("sarscov2 - fasta") { + test("sarscov2 - fasta - uncompressed") { when { process { @@ -18,6 +18,7 @@ nextflow_process { input[0] = [ [ id:'test' ], // meta map file(params.test_data['sarscov2']['illumina']['contigs_fasta'], checkIfExists: true) ] + input[1] = false """ } } @@ -25,9 +26,29 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.alignment).match("alignment")}, - { assert snapshot(process.out.versions).match("versions") } + { assert snapshot(process.out).match("SARS-CoV-2 scaffolds fasta - uncompressed")}, ) } } -} + + test("sarscov2 - fasta - compressed") { + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['contigs_fasta'], checkIfExists: true) + ] + input[1] = true + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match("SARS-CoV-2 scaffolds fasta - compressed")}, + ) + } + } +} \ No newline at end of file diff --git a/modules/nf-core/kalign/align/tests/main.nf.test.snap b/modules/nf-core/kalign/align/tests/main.nf.test.snap index f64c3d9ea3e..da6fc94c52e 100644 --- a/modules/nf-core/kalign/align/tests/main.nf.test.snap +++ b/modules/nf-core/kalign/align/tests/main.nf.test.snap @@ -1,23 +1,60 @@ { - "versions": { + "SARS-CoV-2 scaffolds fasta - uncompressed": { "content": [ - [ - "versions.yml:md5,f2fc7e35f94af98fdd295da471a7e14b" - ] + { + "0": [ + [ + { + "id": "test" + }, + "test.aln:md5,c165ecf48fb89862cc2a991cc3cadb2d" + ] + ], + "1": [ + "versions.yml:md5,0764ff5c30fd8befd86baa9026493ffe" + ], + "alignment": [ + [ + { + "id": "test" + }, + "test.aln:md5,c165ecf48fb89862cc2a991cc3cadb2d" + ] + ], + "versions": [ + "versions.yml:md5,0764ff5c30fd8befd86baa9026493ffe" + ] + } ], - "timestamp": "2023-11-28T12:51:11.855909919" + "timestamp": "2024-03-22T16:42:01.934768" }, - "alignment": { + "SARS-CoV-2 scaffolds fasta - compressed": { "content": [ - [ - [ - { - "id": "test" - }, - "test.aln:md5,5d12e1503a8efa6b441e02922e6f2b22" + { + "0": [ + [ + { + "id": "test" + }, + "test.aln.gz:md5,c165ecf48fb89862cc2a991cc3cadb2d" + ] + ], + "1": [ + "versions.yml:md5,0764ff5c30fd8befd86baa9026493ffe" + ], + "alignment": [ + [ + { + "id": "test" + }, + "test.aln.gz:md5,c165ecf48fb89862cc2a991cc3cadb2d" + ] + ], + "versions": [ + "versions.yml:md5,0764ff5c30fd8befd86baa9026493ffe" ] - ] + } ], - "timestamp": "2023-11-28T15:12:13.600574353" + "timestamp": "2024-03-22T16:42:07.734293" } } \ No newline at end of file From db87ca51c3b2f178cbfbe3548f22568598ab3fb6 Mon Sep 17 00:00:00 2001 From: Alexander Ramos Date: Fri, 22 Mar 2024 10:08:55 -0600 Subject: [PATCH 13/18] New module: kraken2/build (#5212) * first commit * use mkdir -p flag * update assertions * Update modules/nf-core/kraken2/build/main.nf Co-authored-by: James A. Fellows Yates * update dependencies * add args_id * option for cleaning files * Update modules/nf-core/kraken2/build/main.nf Co-authored-by: James A. Fellows Yates * remove trailing whitespace * remove trailing whitespace * check prefix and database name * Add slightly relaxed assrtions opts.k2d * Change unmapped as well due to occasional variation --------- Co-authored-by: James A. Fellows Yates --- modules/nf-core/kraken2/build/environment.yml | 10 ++ modules/nf-core/kraken2/build/main.nf | 51 +++++++++ modules/nf-core/kraken2/build/meta.yml | 48 +++++++++ .../nf-core/kraken2/build/tests/main.nf.test | 101 ++++++++++++++++++ .../kraken2/build/tests/main.nf.test.snap | 52 +++++++++ .../kraken2/build/tests/nextflow.config | 9 ++ modules/nf-core/kraken2/build/tests/tags.yml | 4 + 7 files changed, 275 insertions(+) create mode 100644 modules/nf-core/kraken2/build/environment.yml create mode 100644 modules/nf-core/kraken2/build/main.nf create mode 100644 modules/nf-core/kraken2/build/meta.yml create mode 100644 modules/nf-core/kraken2/build/tests/main.nf.test create mode 100644 modules/nf-core/kraken2/build/tests/main.nf.test.snap create mode 100644 modules/nf-core/kraken2/build/tests/nextflow.config create mode 100644 modules/nf-core/kraken2/build/tests/tags.yml diff --git a/modules/nf-core/kraken2/build/environment.yml b/modules/nf-core/kraken2/build/environment.yml new file mode 100644 index 00000000000..822f48907f6 --- /dev/null +++ b/modules/nf-core/kraken2/build/environment.yml @@ -0,0 +1,10 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +name: "kraken2_build" +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - "bioconda::kraken2=2.1.3" + - "coreutils=9.4" diff --git a/modules/nf-core/kraken2/build/main.nf b/modules/nf-core/kraken2/build/main.nf new file mode 100644 index 00000000000..48cba54b45c --- /dev/null +++ b/modules/nf-core/kraken2/build/main.nf @@ -0,0 +1,51 @@ +process KRAKEN2_BUILD { + tag "$meta.id" + label 'process_medium' + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-f8c4015c836dd3ce5c118cfed97ec8259bab9e9d:2e0b144854b4a3d69b5df7a0340a60db846cc8bf-0': + 'biocontainers/mulled-v2-f8c4015c836dd3ce5c118cfed97ec8259bab9e9d:2e0b144854b4a3d69b5df7a0340a60db846cc8bf-0' }" + + input: + tuple val(meta), path(db) + val cleaning + + output: + tuple val(meta), path("$prefix"), emit: db + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + runclean = cleaning ? "kraken2-build --clean --db ${db}" : "" + """ + kraken2-build \\ + --build \\ + $args \\ + --threads ${task.cpus} \\ + --db ${db} + $runclean + if [[ \$(basename ${db}) != "${prefix}" ]]; then + mv ${db}/* ${prefix} + fi + cat <<-END_VERSIONS > versions.yml + "${task.process}": + kraken2: \$(echo \$(kraken2 --version 2>&1) | sed 's/^.*Kraken version //; s/ .*\$//') + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + """ + mkdir -p "$prefix" + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + kraken2: \$(echo \$(kraken2 --version 2>&1) | sed 's/^.*Kraken version //; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/nf-core/kraken2/build/meta.yml b/modules/nf-core/kraken2/build/meta.yml new file mode 100644 index 00000000000..50f6d19379c --- /dev/null +++ b/modules/nf-core/kraken2/build/meta.yml @@ -0,0 +1,48 @@ +name: "kraken2_build" +description: Builds Kraken2 database +keywords: + - metagenomics + - db + - classification + - build + - kraken2 +tools: + - kraken2: + description: "Kraken2 is a system for assigning taxonomic labels to short DNA sequences, usually obtained through metagenomic studies." + homepage: https://ccb.jhu.edu/software/kraken2/ + documentation: https://github.com/DerrickWood/kraken2/wiki/Manual + tool_dev_url: "https://github.com/DerrickWood/kraken2" + doi: 10.1186/s13059-019-1891-0 + licence: ["MIT"] + args_id: "$args" +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + - db: + type: directory + description: contains required files to build the database + pattern: "*/" + - cleaning: + type: boolean + description: activate or deactivate (true or false) cleaning of intermediate files +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + - db: + type: directory + description: contains the database that can be used to perform taxonomic classification + pattern: "*/" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@alxndrdiaz" +maintainers: + - "@alxndrdiaz" diff --git a/modules/nf-core/kraken2/build/tests/main.nf.test b/modules/nf-core/kraken2/build/tests/main.nf.test new file mode 100644 index 00000000000..9eec2ccee92 --- /dev/null +++ b/modules/nf-core/kraken2/build/tests/main.nf.test @@ -0,0 +1,101 @@ +nextflow_process { + + name "Test Process KRAKEN2_BUILD" + script "../main.nf" + process "KRAKEN2_BUILD" + config "./nextflow.config" + tag "kraken2" + tag "kraken2/build" + tag "kraken2/add" + tag "gunzip" + tag "modules" + tag "modules_nfcore" + + setup { + + run("GUNZIP") { + script "modules/nf-core/gunzip/main.nf" + process { + """ + input[0] = Channel.of([ + [], + file( + params.test_data['sarscov2']['metagenome']['prot_accession2taxid_gz'], + checkIfExists: true + ) + ]) + """ + } + } + + run("KRAKEN2_ADD") { + script "modules/nf-core/kraken2/add/main.nf" + process { + """ + input[0] = [ + [ id:'test' ], + [ + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['proteome_fasta'], checkIfExists: true) + ] + ] + input[1] = file(params.test_data['sarscov2']['metagenome']['prot_names_dmp'], checkIfExists: true) + input[2] = file(params.test_data['sarscov2']['metagenome']['prot_nodes_dmp'], checkIfExists: true) + input[3] = GUNZIP.out.gunzip.map{ it[1] } + """ + } + } + + } + + test("sarscov2 protein_db") { + + when { + process { + """ + input[0] = KRAKEN2_ADD.out.db + input[1] = true + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.db.get(0).get(1) ==~ ".*/test" }, + { assert snapshot ( + path("${process.out.db[0][1]}/hash.k2d"), + path("${process.out.db[0][1]}/taxo.k2d"), + file("${process.out.db[0][1]}/opts.k2d").name, + file("${process.out.db[0][1]}/unmapped.txt").name + ).match() + } + ) + } + + } + + test("sarscov2 protein_db stub") { + + options "-stub" + + when { + process { + """ + input[0] = KRAKEN2_ADD.out.db + input[1] = true + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot (process.out).match() + } + ) + } + + } + +} diff --git a/modules/nf-core/kraken2/build/tests/main.nf.test.snap b/modules/nf-core/kraken2/build/tests/main.nf.test.snap new file mode 100644 index 00000000000..fb87c518830 --- /dev/null +++ b/modules/nf-core/kraken2/build/tests/main.nf.test.snap @@ -0,0 +1,52 @@ +{ + "sarscov2 protein_db": { + "content": [ + "hash.k2d:md5,e9984a5e98f87c0488cb5e7618d5bbe0", + "taxo.k2d:md5,29d65b1796e09191fd7bdcaa24130459", + "opts.k2d", + "unmapped.txt" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-22T08:10:48.644001909" + }, + "sarscov2 protein_db stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + + ] + ] + ], + "1": [ + "versions.yml:md5,df044948ec1fdb342a1d6fadde84b334" + ], + "db": [ + [ + { + "id": "test" + }, + [ + + ] + ] + ], + "versions": [ + "versions.yml:md5,df044948ec1fdb342a1d6fadde84b334" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-19T17:41:57.715748" + } +} \ No newline at end of file diff --git a/modules/nf-core/kraken2/build/tests/nextflow.config b/modules/nf-core/kraken2/build/tests/nextflow.config new file mode 100644 index 00000000000..11ac39e45ba --- /dev/null +++ b/modules/nf-core/kraken2/build/tests/nextflow.config @@ -0,0 +1,9 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + withName: KRAKEN2_BUILD { + ext.args = '--protein' + } + +} diff --git a/modules/nf-core/kraken2/build/tests/tags.yml b/modules/nf-core/kraken2/build/tests/tags.yml new file mode 100644 index 00000000000..4a5e61d30d1 --- /dev/null +++ b/modules/nf-core/kraken2/build/tests/tags.yml @@ -0,0 +1,4 @@ +kraken2/build: + - modules/nf-core/kraken2/build/** + - modules/nf-core/kraken2/add/** + - modules/nf-core/gunzip/** From 62007703c84bcfef92ce9e4a57cb1cc382917201 Mon Sep 17 00:00:00 2001 From: Leon Rauschning <99650940+lrauschning@users.noreply.github.com> Date: Fri, 22 Mar 2024 17:20:47 +0100 Subject: [PATCH 14/18] Update learnmsa module to work with compressed files. (#5276) * add compression handling to learnmsa * add compression simulation to stub * fix typo * commit tests * remove duplicate snapshot names & regenerate * Update modules/nf-core/learnmsa/align/meta.yml Co-authored-by: Luisa Santus --------- Co-authored-by: Leon Rauschning Co-authored-by: Luisa Santus --- .../nf-core/learnmsa/align/environment.yml | 3 +- modules/nf-core/learnmsa/align/main.nf | 20 ++++++++----- modules/nf-core/learnmsa/align/meta.yml | 11 ++++--- .../nf-core/learnmsa/align/tests/main.nf.test | 30 +++++++++++++++++-- .../learnmsa/align/tests/main.nf.test.snap | 22 ++++++++++++-- 5 files changed, 67 insertions(+), 19 deletions(-) diff --git a/modules/nf-core/learnmsa/align/environment.yml b/modules/nf-core/learnmsa/align/environment.yml index 04daae62b86..124b8d8412a 100644 --- a/modules/nf-core/learnmsa/align/environment.yml +++ b/modules/nf-core/learnmsa/align/environment.yml @@ -4,4 +4,5 @@ channels: - bioconda - defaults dependencies: - - bioconda::learnmsa=1.3.2 + - bioconda::learnmsa=2.0.1 + - conda-forge::pigz=2.8 diff --git a/modules/nf-core/learnmsa/align/main.nf b/modules/nf-core/learnmsa/align/main.nf index 444ffcbf421..304fb07ced6 100644 --- a/modules/nf-core/learnmsa/align/main.nf +++ b/modules/nf-core/learnmsa/align/main.nf @@ -4,15 +4,16 @@ process LEARNMSA_ALIGN { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/learnmsa:1.3.2--pyhdfd78af_0': - 'biocontainers/learnmsa:1.3.2--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-741e0da5cf2d6d964f559672e2908c2111cbb46b:4930edd009376542543bfd2e20008bb1ae58f841-0' : + 'biocontainers/mulled-v2-741e0da5cf2d6d964f559672e2908c2111cbb46b:4930edd009376542543bfd2e20008bb1ae58f841-0' }" input: - tuple val(meta), path(fasta) + tuple val(meta), path(fasta) + val(compress) output: - tuple val(meta), path("*.aln"), emit: alignment - path "versions.yml" , emit: versions + tuple val(meta), path("*.aln{.gz,}"), emit: alignment + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -20,15 +21,17 @@ process LEARNMSA_ALIGN { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def write_output = compress ? ">(pigz -cp ${task.cpus} > ${prefix}.aln.gz)" : "${prefix}.aln" """ learnMSA \\ $args \\ - -i $fasta \\ - -o ${prefix}.aln + -i <(unpigz -cdf $fasta) \\ + -o $write_output cat <<-END_VERSIONS > versions.yml "${task.process}": learnmsa: \$(learnMSA -h | grep 'version' | awk -F 'version ' '{print \$2}' | awk '{print \$1}' | sed 's/)//g') + pigz: \$(echo \$(pigz --version 2>&1) | sed 's/^.*pigz\\w*//' )) END_VERSIONS """ @@ -36,11 +39,12 @@ process LEARNMSA_ALIGN { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.aln + touch ${prefix}.aln${compress ? '.gz' : ''} cat <<-END_VERSIONS > versions.yml "${task.process}": learnmsa: \$(learnMSA -h | grep 'version' | awk -F 'version ' '{print \$2}' | awk '{print \$1}' | sed 's/)//g') + pigz: \$(echo \$(pigz --version 2>&1) | sed 's/^.*pigz\\w*//' )) END_VERSIONS """ } diff --git a/modules/nf-core/learnmsa/align/meta.yml b/modules/nf-core/learnmsa/align/meta.yml index fcb935b4d20..66a9f7d12c9 100644 --- a/modules/nf-core/learnmsa/align/meta.yml +++ b/modules/nf-core/learnmsa/align/meta.yml @@ -20,8 +20,11 @@ input: e.g. `[ id:'test']` - fasta: type: file - description: Input sequences in FASTA format - pattern: "*.{fa,fasta}" + description: Input sequences in FASTA format. May be gz-compressed or uncompressed. + pattern: "*.{fa,fasta}{.gz,}" + - compress: + type: boolean + description: Flag representing whether the output MSA should be compressed. Set to true to enable/false to disable compression. Compression is done using pigz, and is multithreaded. output: - meta: type: map @@ -30,8 +33,8 @@ output: e.g. `[ id:'test']` - alignment: type: file - description: Alignment file. - pattern: "*.{aln}" + description: Alignment file, in FASTA format. May be gzipped or uncompressed. + pattern: "*.aln{.gz,}" - versions: type: file description: File containing software versions diff --git a/modules/nf-core/learnmsa/align/tests/main.nf.test b/modules/nf-core/learnmsa/align/tests/main.nf.test index e197470dca4..8459ead38d5 100644 --- a/modules/nf-core/learnmsa/align/tests/main.nf.test +++ b/modules/nf-core/learnmsa/align/tests/main.nf.test @@ -10,7 +10,7 @@ nextflow_process { tag "learnmsa" tag "learnmsa/align" - test("sarscov2 - fasta") { + test("sarscov2 - fasta - uncompressed") { when { process { @@ -18,6 +18,7 @@ nextflow_process { input[0] = [ [ id:'test' ], // meta map file(params.test_data['sarscov2']['genome']['informative_sites_fas'], checkIfExists: true) ] + input[1] = false """ } } @@ -26,10 +27,33 @@ nextflow_process { assertAll( { assert process.success }, { assert path(process.out.alignment.get(0).get(1)).getText().contains(">sample1") }, - { assert snapshot(process.out.versions).match("versions_structure") } + { assert snapshot(process.out.versions).match("versions") } ) } } -} + test("sarscov2 - fasta - compressed") { + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.test_data['sarscov2']['genome']['informative_sites_fas'], checkIfExists: true) + ] + input[1] = true + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.alignment.get(0).get(1)).getTextGzip().contains(">sample1") }, + { assert snapshot(process.out.versions).match("versions1") } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/nf-core/learnmsa/align/tests/main.nf.test.snap b/modules/nf-core/learnmsa/align/tests/main.nf.test.snap index 8bbe2c19eb4..981738a276d 100644 --- a/modules/nf-core/learnmsa/align/tests/main.nf.test.snap +++ b/modules/nf-core/learnmsa/align/tests/main.nf.test.snap @@ -1,10 +1,26 @@ { - "versions_structure": { + "versions": { "content": [ [ - "versions.yml:md5,adbcf330bacf246f19438981d58ae35a" + "versions.yml:md5,85322b0f038aa768f202fd0d748d6c7c" ] ], - "timestamp": "2023-11-28T14:26:02.862695056" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T16:06:48.867020809" + }, + "versions1": { + "content": [ + [ + "versions.yml:md5,85322b0f038aa768f202fd0d748d6c7c" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-20T16:12:13.921813607" } } \ No newline at end of file From f6867fb2512d9a6c276af0c50d59fab6df46d7dd Mon Sep 17 00:00:00 2001 From: Jasmin Frangenberg <73216762+jasmezz@users.noreply.github.com> Date: Sun, 24 Mar 2024 21:23:06 +0000 Subject: [PATCH 15/18] Update gecco + migrate to nf-test (#5372) * Update gecco + migrate to nf-test * Fix test assertion * Fix linting * [automated] Fix linting with Prettier --------- Co-authored-by: nf-core-bot --- modules/nf-core/gecco/run/environment.yml | 2 +- modules/nf-core/gecco/run/main.nf | 18 ++- modules/nf-core/gecco/run/meta.yml | 2 +- modules/nf-core/gecco/run/tests/main.nf.test | 68 +++++++++ .../nf-core/gecco/run/tests/main.nf.test.snap | 130 ++++++++++++++++++ modules/nf-core/gecco/run/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 - tests/modules/nf-core/gecco/run/main.nf | 17 --- .../modules/nf-core/gecco/run/nextflow.config | 5 - tests/modules/nf-core/gecco/run/test.yml | 13 -- 10 files changed, 218 insertions(+), 42 deletions(-) create mode 100644 modules/nf-core/gecco/run/tests/main.nf.test create mode 100644 modules/nf-core/gecco/run/tests/main.nf.test.snap create mode 100644 modules/nf-core/gecco/run/tests/tags.yml delete mode 100644 tests/modules/nf-core/gecco/run/main.nf delete mode 100644 tests/modules/nf-core/gecco/run/nextflow.config delete mode 100644 tests/modules/nf-core/gecco/run/test.yml diff --git a/modules/nf-core/gecco/run/environment.yml b/modules/nf-core/gecco/run/environment.yml index b4b8355b1a5..9d7cde8d9b2 100644 --- a/modules/nf-core/gecco/run/environment.yml +++ b/modules/nf-core/gecco/run/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::gecco=0.9.8 + - bioconda::gecco=0.9.10 diff --git a/modules/nf-core/gecco/run/main.nf b/modules/nf-core/gecco/run/main.nf index a23aa02dff1..7b234899206 100644 --- a/modules/nf-core/gecco/run/main.nf +++ b/modules/nf-core/gecco/run/main.nf @@ -4,8 +4,8 @@ process GECCO_RUN { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gecco:0.9.8--pyhdfd78af_0': - 'biocontainers/gecco:0.9.8--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gecco:0.9.10--pyhdfd78af_0': + 'biocontainers/gecco:0.9.10--pyhdfd78af_0' }" input: tuple val(meta), path(input), path(hmm) @@ -44,4 +44,18 @@ process GECCO_RUN { gecco: \$(echo \$(gecco --version) | cut -f 2 -d ' ' ) END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.genes.tsv + touch ${prefix}.features.tsv + touch ${prefix}.clusters.tsv + touch NC_018507.1_cluster_1.gbk + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gecco: \$(echo \$(gecco --version) | cut -f 2 -d ' ' ) + END_VERSIONS + """ } diff --git a/modules/nf-core/gecco/run/meta.yml b/modules/nf-core/gecco/run/meta.yml index 7bb274d1c67..a2f4a7266bb 100644 --- a/modules/nf-core/gecco/run/meta.yml +++ b/modules/nf-core/gecco/run/meta.yml @@ -12,7 +12,7 @@ tools: documentation: "https://gecco.embl.de" tool_dev_url: "https://github.com/zellerlab/GECCO" doi: "10.1101/2021.05.03.442509" - licence: "['GPL v3']" + licence: ["GPL v3"] input: - meta: type: map diff --git a/modules/nf-core/gecco/run/tests/main.nf.test b/modules/nf-core/gecco/run/tests/main.nf.test new file mode 100644 index 00000000000..002a8e841c1 --- /dev/null +++ b/modules/nf-core/gecco/run/tests/main.nf.test @@ -0,0 +1,68 @@ +nextflow_process { + + name "Test Process GECCO_RUN" + script "../main.nf" + process "GECCO_RUN" + + tag "modules" + tag "modules_nfcore" + tag "gecco" + tag "gecco/run" + + test("gecco/run - candidatus_portiera_aleyrodidarum - genome_fasta") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/genome.fasta', checkIfExists: true), + [] + ] + input[1] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.genes + + process.out.features + + process.out.clusters + + process.out.versions + ).match() }, + { assert path(process.out.gbk.get(0).get(1)).text.contains("MVKNDIDILILGGGCTGLSLAYYLSFLPNTVRIFLIENKFIYNND") } + ) + } + + } + + test("gecco/run - candidatus_portiera_aleyrodidarum - genome_fasta - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/genome.fasta', checkIfExists: true), + [] + ] + input[1] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/gecco/run/tests/main.nf.test.snap b/modules/nf-core/gecco/run/tests/main.nf.test.snap new file mode 100644 index 00000000000..7dc14db1b8f --- /dev/null +++ b/modules/nf-core/gecco/run/tests/main.nf.test.snap @@ -0,0 +1,130 @@ +{ + "gecco/run - candidatus_portiera_aleyrodidarum - genome_fasta": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "genome.genes.tsv:md5,2338b99d9b77200e9a071941ad8bb3ac" + ], + [ + { + "id": "test", + "single_end": false + }, + "genome.features.tsv:md5,dcd929c60337b4835729d886897cdd36" + ], + [ + { + "id": "test", + "single_end": false + }, + "genome.clusters.tsv:md5,84a10da0afff6e2085d8296db69eb8b0" + ], + "versions.yml:md5,3ade04da8c7c1f46cdf07ecb0334a777" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-22T22:07:39.306458166" + }, + "gecco/run - candidatus_portiera_aleyrodidarum - genome_fasta - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.genes.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.features.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.clusters.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "NC_018507.1_cluster_1.gbk:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + + ], + "5": [ + "versions.yml:md5,3ade04da8c7c1f46cdf07ecb0334a777" + ], + "clusters": [ + [ + { + "id": "test", + "single_end": false + }, + "test.clusters.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "features": [ + [ + { + "id": "test", + "single_end": false + }, + "test.features.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "gbk": [ + [ + { + "id": "test", + "single_end": false + }, + "NC_018507.1_cluster_1.gbk:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "genes": [ + [ + { + "id": "test", + "single_end": false + }, + "test.genes.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "json": [ + + ], + "versions": [ + "versions.yml:md5,3ade04da8c7c1f46cdf07ecb0334a777" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-22T22:07:47.729614386" + } +} \ No newline at end of file diff --git a/modules/nf-core/gecco/run/tests/tags.yml b/modules/nf-core/gecco/run/tests/tags.yml new file mode 100644 index 00000000000..1542bccabb0 --- /dev/null +++ b/modules/nf-core/gecco/run/tests/tags.yml @@ -0,0 +1,2 @@ +gecco/run: + - "modules/nf-core/gecco/run/**" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index abc04e7100a..97884cd9533 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -817,9 +817,6 @@ gatk4spark/baserecalibrator: gawk: - modules/nf-core/gawk/** - tests/modules/nf-core/gawk/** -gecco/run: - - modules/nf-core/gecco/run/** - - tests/modules/nf-core/gecco/run/** gem2/gem2bedmappability: - modules/nf-core/gem2/gem2bedmappability/** - tests/modules/nf-core/gem2/gem2bedmappability/** diff --git a/tests/modules/nf-core/gecco/run/main.nf b/tests/modules/nf-core/gecco/run/main.nf deleted file mode 100644 index 76b971e2ffa..00000000000 --- a/tests/modules/nf-core/gecco/run/main.nf +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { GECCO_RUN } from '../../../../../modules/nf-core/gecco/run/main.nf' - -workflow test_gecco_run { - - input = [ - [ id:'test', single_end:false ], // meta map - file(params.test_data['candidatus_portiera_aleyrodidarum']['genome']['genome_fasta'], checkIfExists: true), - [] - ] - model_dir = [] - - GECCO_RUN ( input, model_dir ) -} diff --git a/tests/modules/nf-core/gecco/run/nextflow.config b/tests/modules/nf-core/gecco/run/nextflow.config deleted file mode 100644 index 50f50a7a357..00000000000 --- a/tests/modules/nf-core/gecco/run/nextflow.config +++ /dev/null @@ -1,5 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - -} \ No newline at end of file diff --git a/tests/modules/nf-core/gecco/run/test.yml b/tests/modules/nf-core/gecco/run/test.yml deleted file mode 100644 index bb5ad93d068..00000000000 --- a/tests/modules/nf-core/gecco/run/test.yml +++ /dev/null @@ -1,13 +0,0 @@ -- name: gecco run test_gecco_run - command: nextflow run ./tests/modules/nf-core/gecco/run -entry test_gecco_run -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/gecco/run/nextflow.config - tags: - - gecco/run - - gecco - files: - - path: output/gecco/NC_018507.1_cluster_1.gbk - - path: output/gecco/genome.clusters.tsv - md5sum: 84a10da0afff6e2085d8296db69eb8b0 - - path: output/gecco/genome.features.tsv - md5sum: dcd929c60337b4835729d886897cdd36 - - path: output/gecco/genome.genes.tsv - md5sum: 2338b99d9b77200e9a071941ad8bb3ac From 93b7e1bf63944488fe77ad490a9de62a73959bed Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 06:01:00 +0100 Subject: [PATCH 16/18] Update condaforge/mambaforge Docker tag to v24 (#5381) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- modules/nf-core/quartonotebook/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/quartonotebook/Dockerfile b/modules/nf-core/quartonotebook/Dockerfile index 0acc6f0a24e..78d2ab20c23 100644 --- a/modules/nf-core/quartonotebook/Dockerfile +++ b/modules/nf-core/quartonotebook/Dockerfile @@ -18,7 +18,7 @@ RUN mkdir -p /opt/quarto \ # # Second stage: Conda environment # -FROM condaforge/mambaforge:23.11.0-0 +FROM condaforge/mambaforge:24.1.2-0@sha256:64c45c1a743737f61cf201f54cae974b5c853be94f9c1a84f5e82e0e854f0407 COPY --from=quarto /opt/quarto /opt/quarto ENV PATH="${PATH}:/opt/quarto/bin" From dbbb0c509e044d2680b429ba622049d4a23426dc Mon Sep 17 00:00:00 2001 From: Jasmin Frangenberg <73216762+jasmezz@users.noreply.github.com> Date: Mon, 25 Mar 2024 09:07:44 +0000 Subject: [PATCH 17/18] Update modules: rgi (#5383) * Update container links * Update container links (cardannoation) --- modules/nf-core/rgi/cardannotation/main.nf | 4 ++-- modules/nf-core/rgi/main/main.nf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/nf-core/rgi/cardannotation/main.nf b/modules/nf-core/rgi/cardannotation/main.nf index 9be57c856c6..d2a814e0f96 100644 --- a/modules/nf-core/rgi/cardannotation/main.nf +++ b/modules/nf-core/rgi/cardannotation/main.nf @@ -3,8 +3,8 @@ process RGI_CARDANNOTATION { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/rgi:6.0.3--pyha8f3691_0': - 'biocontainers/rgi:6.0.3--pyha8f3691_0' }" + 'https://depot.galaxyproject.org/singularity/rgi:6.0.3--pyha8f3691_1': + 'biocontainers/rgi:6.0.3--pyha8f3691_1' }" input: path(card) diff --git a/modules/nf-core/rgi/main/main.nf b/modules/nf-core/rgi/main/main.nf index 174714807da..94606b9dec1 100644 --- a/modules/nf-core/rgi/main/main.nf +++ b/modules/nf-core/rgi/main/main.nf @@ -4,8 +4,8 @@ process RGI_MAIN { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/rgi:6.0.3--pyha8f3691_0': - 'biocontainers/rgi:6.0.3--pyha8f3691_0' }" + 'https://depot.galaxyproject.org/singularity/rgi:6.0.3--pyha8f3691_1': + 'biocontainers/rgi:6.0.3--pyha8f3691_1' }" input: tuple val(meta), path(fasta) From 624ecdc43b72e0a45bf05d9b57215d18dcd538f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20B=C3=A4uerle?= <45968370+famosab@users.noreply.github.com> Date: Mon, 25 Mar 2024 10:49:51 +0100 Subject: [PATCH 18/18] port `vcftools` to nf-test (#5375) * add test files * add stub test * remove pytest files * Apply suggestions from code review Co-authored-by: Jasmin Frangenberg <73216762+jasmezz@users.noreply.github.com> --------- Co-authored-by: Jasmin Frangenberg <73216762+jasmezz@users.noreply.github.com> --- modules/nf-core/vcftools/main.nf | 8 + modules/nf-core/vcftools/tests/base.config | 5 + modules/nf-core/vcftools/tests/bed.config | 5 + modules/nf-core/vcftools/tests/main.nf.test | 151 ++ .../nf-core/vcftools/tests/main.nf.test.snap | 1987 +++++++++++++++++ modules/nf-core/vcftools/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 - tests/modules/nf-core/vcftools/main.nf | 40 - .../modules/nf-core/vcftools/nextflow.config | 13 - tests/modules/nf-core/vcftools/test.yml | 31 - 10 files changed, 2158 insertions(+), 87 deletions(-) create mode 100644 modules/nf-core/vcftools/tests/base.config create mode 100644 modules/nf-core/vcftools/tests/bed.config create mode 100644 modules/nf-core/vcftools/tests/main.nf.test create mode 100644 modules/nf-core/vcftools/tests/main.nf.test.snap create mode 100644 modules/nf-core/vcftools/tests/tags.yml delete mode 100644 tests/modules/nf-core/vcftools/main.nf delete mode 100644 tests/modules/nf-core/vcftools/nextflow.config delete mode 100644 tests/modules/nf-core/vcftools/test.yml diff --git a/modules/nf-core/vcftools/main.nf b/modules/nf-core/vcftools/main.nf index 0e61955d8f3..475ef58f7af 100644 --- a/modules/nf-core/vcftools/main.nf +++ b/modules/nf-core/vcftools/main.nf @@ -124,4 +124,12 @@ process VCFTOOLS { vcftools: \$(echo \$(vcftools --version 2>&1) | sed 's/^.*VCFtools (//;s/).*//') END_VERSIONS """ + + stub: + """ + cat <<-END_VERSIONS > versions.yml + "${task.process}": + vcftools: \$(echo \$(vcftools --version 2>&1) | sed 's/^.*VCFtools (//;s/).*//') + END_VERSIONS + """ } diff --git a/modules/nf-core/vcftools/tests/base.config b/modules/nf-core/vcftools/tests/base.config new file mode 100644 index 00000000000..2b749b66c8e --- /dev/null +++ b/modules/nf-core/vcftools/tests/base.config @@ -0,0 +1,5 @@ +process { + withName: VCFTOOLS { + ext.args = '--freq' + } +} diff --git a/modules/nf-core/vcftools/tests/bed.config b/modules/nf-core/vcftools/tests/bed.config new file mode 100644 index 00000000000..14c0aea867d --- /dev/null +++ b/modules/nf-core/vcftools/tests/bed.config @@ -0,0 +1,5 @@ +process { + withName: VCFTOOLS { + ext.args = '--freq --exclude-bed' + } +} diff --git a/modules/nf-core/vcftools/tests/main.nf.test b/modules/nf-core/vcftools/tests/main.nf.test new file mode 100644 index 00000000000..d8f578dac18 --- /dev/null +++ b/modules/nf-core/vcftools/tests/main.nf.test @@ -0,0 +1,151 @@ +nextflow_process { + + name "Test Process VCFTOOLS" + script "../main.nf" + process "VCFTOOLS" + + tag "modules" + tag "modules_nfcore" + tag "vcftools" + + test("sarscov2 - vcf") { + + config "./base.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true) + ] + // bed + input[1] = [] + // diff_variant_file + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - vcfgz") { + + config "./base.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true) + ] + // bed + input[1] = [] + // diff_variant_file + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - vcf - bed") { + + config "./bed.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true) + ] + // bed + input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) + // diff_variant_file + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - vcfgz - bed") { + + config "./bed.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true) + ] + // bed + input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) + // diff_variant_file + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - vcfgz - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true) + ] + // bed + input[1] = [] + // diff_variant_file + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/vcftools/tests/main.nf.test.snap b/modules/nf-core/vcftools/tests/main.nf.test.snap new file mode 100644 index 00000000000..77669aadc4b --- /dev/null +++ b/modules/nf-core/vcftools/tests/main.nf.test.snap @@ -0,0 +1,1987 @@ +{ + "sarscov2 - vcfgz - bed": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "10": [ + + ], + "11": [ + + ], + "12": [ + + ], + "13": [ + + ], + "14": [ + + ], + "15": [ + + ], + "16": [ + + ], + "17": [ + + ], + "18": [ + + ], + "19": [ + + ], + "2": [ + [ + { + "id": "test" + }, + "test.frq:md5,7f126655f17268fd1a338734f62868e9" + ] + ], + "20": [ + + ], + "21": [ + + ], + "22": [ + + ], + "23": [ + + ], + "24": [ + + ], + "25": [ + + ], + "26": [ + + ], + "27": [ + + ], + "28": [ + + ], + "29": [ + + ], + "3": [ + + ], + "30": [ + + ], + "31": [ + + ], + "32": [ + + ], + "33": [ + + ], + "34": [ + + ], + "35": [ + + ], + "36": [ + + ], + "37": [ + + ], + "38": [ + + ], + "39": [ + + ], + "4": [ + + ], + "40": [ + + ], + "41": [ + + ], + "42": [ + + ], + "43": [ + + ], + "44": [ + + ], + "45": [ + + ], + "46": [ + + ], + "47": [ + + ], + "48": [ + + ], + "49": [ + + ], + "5": [ + + ], + "50": [ + + ], + "51": [ + + ], + "52": [ + + ], + "53": [ + + ], + "54": [ + + ], + "55": [ + + ], + "56": [ + + ], + "57": [ + + ], + "58": [ + + ], + "59": [ + + ], + "6": [ + + ], + "60": [ + + ], + "61": [ + + ], + "62": [ + "versions.yml:md5,577abe71f1ed8b94c633e71dc2cfc491" + ], + "7": [ + + ], + "8": [ + + ], + "9": [ + + ], + "bcf": [ + + ], + "beagle_gl": [ + + ], + "beagle_pl": [ + + ], + "diff_discd_matrix": [ + + ], + "diff_indv": [ + + ], + "diff_indv_in_files": [ + + ], + "diff_sites": [ + + ], + "diff_sites_in_files": [ + + ], + "diff_switch_error": [ + + ], + "filter_summary": [ + + ], + "format": [ + + ], + "freq_burden": [ + + ], + "frq": [ + [ + { + "id": "test" + }, + "test.frq:md5,7f126655f17268fd1a338734f62868e9" + ] + ], + "frq_count": [ + + ], + "gdepth": [ + + ], + "geno_chisq": [ + + ], + "geno_ld": [ + + ], + "genotypes_matrix": [ + + ], + "genotypes_matrix_individual": [ + + ], + "genotypes_matrix_position": [ + + ], + "hap_ld": [ + + ], + "hapcount": [ + + ], + "heterozygosity": [ + + ], + "hwe": [ + + ], + "idepth": [ + + ], + "impute_hap": [ + + ], + "impute_hap_indv": [ + + ], + "impute_hap_legend": [ + + ], + "indel_hist": [ + + ], + "info": [ + + ], + "interchrom_geno_ld": [ + + ], + "interchrom_hap_ld": [ + + ], + "kept_sites": [ + + ], + "ldepth": [ + + ], + "ldepth_mean": [ + + ], + "ldhat_locs": [ + + ], + "ldhat_sites": [ + + ], + "list_geno_ld": [ + + ], + "list_hap_ld": [ + + ], + "lqual": [ + + ], + "lroh": [ + + ], + "map_": [ + + ], + "mendel": [ + + ], + "missing_individual": [ + + ], + "missing_site": [ + + ], + "ped": [ + + ], + "relatedness": [ + + ], + "relatedness2": [ + + ], + "removed_sites": [ + + ], + "singeltons": [ + + ], + "sites_pi": [ + + ], + "snp_density": [ + + ], + "tajima_d": [ + + ], + "tfam": [ + + ], + "tped": [ + + ], + "tstv": [ + + ], + "tstv_count": [ + + ], + "tstv_qual": [ + + ], + "tstv_summary": [ + + ], + "vcf": [ + + ], + "versions": [ + "versions.yml:md5,577abe71f1ed8b94c633e71dc2cfc491" + ], + "weir_fst": [ + + ], + "windowed_pi": [ + + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-22T13:07:26.598512" + }, + "sarscov2 - vcf": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "10": [ + + ], + "11": [ + + ], + "12": [ + + ], + "13": [ + + ], + "14": [ + + ], + "15": [ + + ], + "16": [ + + ], + "17": [ + + ], + "18": [ + + ], + "19": [ + + ], + "2": [ + [ + { + "id": "test" + }, + "test.frq:md5,7f126655f17268fd1a338734f62868e9" + ] + ], + "20": [ + + ], + "21": [ + + ], + "22": [ + + ], + "23": [ + + ], + "24": [ + + ], + "25": [ + + ], + "26": [ + + ], + "27": [ + + ], + "28": [ + + ], + "29": [ + + ], + "3": [ + + ], + "30": [ + + ], + "31": [ + + ], + "32": [ + + ], + "33": [ + + ], + "34": [ + + ], + "35": [ + + ], + "36": [ + + ], + "37": [ + + ], + "38": [ + + ], + "39": [ + + ], + "4": [ + + ], + "40": [ + + ], + "41": [ + + ], + "42": [ + + ], + "43": [ + + ], + "44": [ + + ], + "45": [ + + ], + "46": [ + + ], + "47": [ + + ], + "48": [ + + ], + "49": [ + + ], + "5": [ + + ], + "50": [ + + ], + "51": [ + + ], + "52": [ + + ], + "53": [ + + ], + "54": [ + + ], + "55": [ + + ], + "56": [ + + ], + "57": [ + + ], + "58": [ + + ], + "59": [ + + ], + "6": [ + + ], + "60": [ + + ], + "61": [ + + ], + "62": [ + "versions.yml:md5,577abe71f1ed8b94c633e71dc2cfc491" + ], + "7": [ + + ], + "8": [ + + ], + "9": [ + + ], + "bcf": [ + + ], + "beagle_gl": [ + + ], + "beagle_pl": [ + + ], + "diff_discd_matrix": [ + + ], + "diff_indv": [ + + ], + "diff_indv_in_files": [ + + ], + "diff_sites": [ + + ], + "diff_sites_in_files": [ + + ], + "diff_switch_error": [ + + ], + "filter_summary": [ + + ], + "format": [ + + ], + "freq_burden": [ + + ], + "frq": [ + [ + { + "id": "test" + }, + "test.frq:md5,7f126655f17268fd1a338734f62868e9" + ] + ], + "frq_count": [ + + ], + "gdepth": [ + + ], + "geno_chisq": [ + + ], + "geno_ld": [ + + ], + "genotypes_matrix": [ + + ], + "genotypes_matrix_individual": [ + + ], + "genotypes_matrix_position": [ + + ], + "hap_ld": [ + + ], + "hapcount": [ + + ], + "heterozygosity": [ + + ], + "hwe": [ + + ], + "idepth": [ + + ], + "impute_hap": [ + + ], + "impute_hap_indv": [ + + ], + "impute_hap_legend": [ + + ], + "indel_hist": [ + + ], + "info": [ + + ], + "interchrom_geno_ld": [ + + ], + "interchrom_hap_ld": [ + + ], + "kept_sites": [ + + ], + "ldepth": [ + + ], + "ldepth_mean": [ + + ], + "ldhat_locs": [ + + ], + "ldhat_sites": [ + + ], + "list_geno_ld": [ + + ], + "list_hap_ld": [ + + ], + "lqual": [ + + ], + "lroh": [ + + ], + "map_": [ + + ], + "mendel": [ + + ], + "missing_individual": [ + + ], + "missing_site": [ + + ], + "ped": [ + + ], + "relatedness": [ + + ], + "relatedness2": [ + + ], + "removed_sites": [ + + ], + "singeltons": [ + + ], + "sites_pi": [ + + ], + "snp_density": [ + + ], + "tajima_d": [ + + ], + "tfam": [ + + ], + "tped": [ + + ], + "tstv": [ + + ], + "tstv_count": [ + + ], + "tstv_qual": [ + + ], + "tstv_summary": [ + + ], + "vcf": [ + + ], + "versions": [ + "versions.yml:md5,577abe71f1ed8b94c633e71dc2cfc491" + ], + "weir_fst": [ + + ], + "windowed_pi": [ + + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-22T13:07:10.654082" + }, + "sarscov2 - vcfgz": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "10": [ + + ], + "11": [ + + ], + "12": [ + + ], + "13": [ + + ], + "14": [ + + ], + "15": [ + + ], + "16": [ + + ], + "17": [ + + ], + "18": [ + + ], + "19": [ + + ], + "2": [ + [ + { + "id": "test" + }, + "test.frq:md5,7f126655f17268fd1a338734f62868e9" + ] + ], + "20": [ + + ], + "21": [ + + ], + "22": [ + + ], + "23": [ + + ], + "24": [ + + ], + "25": [ + + ], + "26": [ + + ], + "27": [ + + ], + "28": [ + + ], + "29": [ + + ], + "3": [ + + ], + "30": [ + + ], + "31": [ + + ], + "32": [ + + ], + "33": [ + + ], + "34": [ + + ], + "35": [ + + ], + "36": [ + + ], + "37": [ + + ], + "38": [ + + ], + "39": [ + + ], + "4": [ + + ], + "40": [ + + ], + "41": [ + + ], + "42": [ + + ], + "43": [ + + ], + "44": [ + + ], + "45": [ + + ], + "46": [ + + ], + "47": [ + + ], + "48": [ + + ], + "49": [ + + ], + "5": [ + + ], + "50": [ + + ], + "51": [ + + ], + "52": [ + + ], + "53": [ + + ], + "54": [ + + ], + "55": [ + + ], + "56": [ + + ], + "57": [ + + ], + "58": [ + + ], + "59": [ + + ], + "6": [ + + ], + "60": [ + + ], + "61": [ + + ], + "62": [ + "versions.yml:md5,577abe71f1ed8b94c633e71dc2cfc491" + ], + "7": [ + + ], + "8": [ + + ], + "9": [ + + ], + "bcf": [ + + ], + "beagle_gl": [ + + ], + "beagle_pl": [ + + ], + "diff_discd_matrix": [ + + ], + "diff_indv": [ + + ], + "diff_indv_in_files": [ + + ], + "diff_sites": [ + + ], + "diff_sites_in_files": [ + + ], + "diff_switch_error": [ + + ], + "filter_summary": [ + + ], + "format": [ + + ], + "freq_burden": [ + + ], + "frq": [ + [ + { + "id": "test" + }, + "test.frq:md5,7f126655f17268fd1a338734f62868e9" + ] + ], + "frq_count": [ + + ], + "gdepth": [ + + ], + "geno_chisq": [ + + ], + "geno_ld": [ + + ], + "genotypes_matrix": [ + + ], + "genotypes_matrix_individual": [ + + ], + "genotypes_matrix_position": [ + + ], + "hap_ld": [ + + ], + "hapcount": [ + + ], + "heterozygosity": [ + + ], + "hwe": [ + + ], + "idepth": [ + + ], + "impute_hap": [ + + ], + "impute_hap_indv": [ + + ], + "impute_hap_legend": [ + + ], + "indel_hist": [ + + ], + "info": [ + + ], + "interchrom_geno_ld": [ + + ], + "interchrom_hap_ld": [ + + ], + "kept_sites": [ + + ], + "ldepth": [ + + ], + "ldepth_mean": [ + + ], + "ldhat_locs": [ + + ], + "ldhat_sites": [ + + ], + "list_geno_ld": [ + + ], + "list_hap_ld": [ + + ], + "lqual": [ + + ], + "lroh": [ + + ], + "map_": [ + + ], + "mendel": [ + + ], + "missing_individual": [ + + ], + "missing_site": [ + + ], + "ped": [ + + ], + "relatedness": [ + + ], + "relatedness2": [ + + ], + "removed_sites": [ + + ], + "singeltons": [ + + ], + "sites_pi": [ + + ], + "snp_density": [ + + ], + "tajima_d": [ + + ], + "tfam": [ + + ], + "tped": [ + + ], + "tstv": [ + + ], + "tstv_count": [ + + ], + "tstv_qual": [ + + ], + "tstv_summary": [ + + ], + "vcf": [ + + ], + "versions": [ + "versions.yml:md5,577abe71f1ed8b94c633e71dc2cfc491" + ], + "weir_fst": [ + + ], + "windowed_pi": [ + + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-22T13:07:15.930382" + }, + "sarscov2 - vcf - bed": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "10": [ + + ], + "11": [ + + ], + "12": [ + + ], + "13": [ + + ], + "14": [ + + ], + "15": [ + + ], + "16": [ + + ], + "17": [ + + ], + "18": [ + + ], + "19": [ + + ], + "2": [ + [ + { + "id": "test" + }, + "test.frq:md5,7f126655f17268fd1a338734f62868e9" + ] + ], + "20": [ + + ], + "21": [ + + ], + "22": [ + + ], + "23": [ + + ], + "24": [ + + ], + "25": [ + + ], + "26": [ + + ], + "27": [ + + ], + "28": [ + + ], + "29": [ + + ], + "3": [ + + ], + "30": [ + + ], + "31": [ + + ], + "32": [ + + ], + "33": [ + + ], + "34": [ + + ], + "35": [ + + ], + "36": [ + + ], + "37": [ + + ], + "38": [ + + ], + "39": [ + + ], + "4": [ + + ], + "40": [ + + ], + "41": [ + + ], + "42": [ + + ], + "43": [ + + ], + "44": [ + + ], + "45": [ + + ], + "46": [ + + ], + "47": [ + + ], + "48": [ + + ], + "49": [ + + ], + "5": [ + + ], + "50": [ + + ], + "51": [ + + ], + "52": [ + + ], + "53": [ + + ], + "54": [ + + ], + "55": [ + + ], + "56": [ + + ], + "57": [ + + ], + "58": [ + + ], + "59": [ + + ], + "6": [ + + ], + "60": [ + + ], + "61": [ + + ], + "62": [ + "versions.yml:md5,577abe71f1ed8b94c633e71dc2cfc491" + ], + "7": [ + + ], + "8": [ + + ], + "9": [ + + ], + "bcf": [ + + ], + "beagle_gl": [ + + ], + "beagle_pl": [ + + ], + "diff_discd_matrix": [ + + ], + "diff_indv": [ + + ], + "diff_indv_in_files": [ + + ], + "diff_sites": [ + + ], + "diff_sites_in_files": [ + + ], + "diff_switch_error": [ + + ], + "filter_summary": [ + + ], + "format": [ + + ], + "freq_burden": [ + + ], + "frq": [ + [ + { + "id": "test" + }, + "test.frq:md5,7f126655f17268fd1a338734f62868e9" + ] + ], + "frq_count": [ + + ], + "gdepth": [ + + ], + "geno_chisq": [ + + ], + "geno_ld": [ + + ], + "genotypes_matrix": [ + + ], + "genotypes_matrix_individual": [ + + ], + "genotypes_matrix_position": [ + + ], + "hap_ld": [ + + ], + "hapcount": [ + + ], + "heterozygosity": [ + + ], + "hwe": [ + + ], + "idepth": [ + + ], + "impute_hap": [ + + ], + "impute_hap_indv": [ + + ], + "impute_hap_legend": [ + + ], + "indel_hist": [ + + ], + "info": [ + + ], + "interchrom_geno_ld": [ + + ], + "interchrom_hap_ld": [ + + ], + "kept_sites": [ + + ], + "ldepth": [ + + ], + "ldepth_mean": [ + + ], + "ldhat_locs": [ + + ], + "ldhat_sites": [ + + ], + "list_geno_ld": [ + + ], + "list_hap_ld": [ + + ], + "lqual": [ + + ], + "lroh": [ + + ], + "map_": [ + + ], + "mendel": [ + + ], + "missing_individual": [ + + ], + "missing_site": [ + + ], + "ped": [ + + ], + "relatedness": [ + + ], + "relatedness2": [ + + ], + "removed_sites": [ + + ], + "singeltons": [ + + ], + "sites_pi": [ + + ], + "snp_density": [ + + ], + "tajima_d": [ + + ], + "tfam": [ + + ], + "tped": [ + + ], + "tstv": [ + + ], + "tstv_count": [ + + ], + "tstv_qual": [ + + ], + "tstv_summary": [ + + ], + "vcf": [ + + ], + "versions": [ + "versions.yml:md5,577abe71f1ed8b94c633e71dc2cfc491" + ], + "weir_fst": [ + + ], + "windowed_pi": [ + + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-22T13:07:21.295463" + }, + "sarscov2 - vcfgz - stub": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "10": [ + + ], + "11": [ + + ], + "12": [ + + ], + "13": [ + + ], + "14": [ + + ], + "15": [ + + ], + "16": [ + + ], + "17": [ + + ], + "18": [ + + ], + "19": [ + + ], + "2": [ + + ], + "20": [ + + ], + "21": [ + + ], + "22": [ + + ], + "23": [ + + ], + "24": [ + + ], + "25": [ + + ], + "26": [ + + ], + "27": [ + + ], + "28": [ + + ], + "29": [ + + ], + "3": [ + + ], + "30": [ + + ], + "31": [ + + ], + "32": [ + + ], + "33": [ + + ], + "34": [ + + ], + "35": [ + + ], + "36": [ + + ], + "37": [ + + ], + "38": [ + + ], + "39": [ + + ], + "4": [ + + ], + "40": [ + + ], + "41": [ + + ], + "42": [ + + ], + "43": [ + + ], + "44": [ + + ], + "45": [ + + ], + "46": [ + + ], + "47": [ + + ], + "48": [ + + ], + "49": [ + + ], + "5": [ + + ], + "50": [ + + ], + "51": [ + + ], + "52": [ + + ], + "53": [ + + ], + "54": [ + + ], + "55": [ + + ], + "56": [ + + ], + "57": [ + + ], + "58": [ + + ], + "59": [ + + ], + "6": [ + + ], + "60": [ + + ], + "61": [ + + ], + "62": [ + "versions.yml:md5,577abe71f1ed8b94c633e71dc2cfc491" + ], + "7": [ + + ], + "8": [ + + ], + "9": [ + + ], + "bcf": [ + + ], + "beagle_gl": [ + + ], + "beagle_pl": [ + + ], + "diff_discd_matrix": [ + + ], + "diff_indv": [ + + ], + "diff_indv_in_files": [ + + ], + "diff_sites": [ + + ], + "diff_sites_in_files": [ + + ], + "diff_switch_error": [ + + ], + "filter_summary": [ + + ], + "format": [ + + ], + "freq_burden": [ + + ], + "frq": [ + + ], + "frq_count": [ + + ], + "gdepth": [ + + ], + "geno_chisq": [ + + ], + "geno_ld": [ + + ], + "genotypes_matrix": [ + + ], + "genotypes_matrix_individual": [ + + ], + "genotypes_matrix_position": [ + + ], + "hap_ld": [ + + ], + "hapcount": [ + + ], + "heterozygosity": [ + + ], + "hwe": [ + + ], + "idepth": [ + + ], + "impute_hap": [ + + ], + "impute_hap_indv": [ + + ], + "impute_hap_legend": [ + + ], + "indel_hist": [ + + ], + "info": [ + + ], + "interchrom_geno_ld": [ + + ], + "interchrom_hap_ld": [ + + ], + "kept_sites": [ + + ], + "ldepth": [ + + ], + "ldepth_mean": [ + + ], + "ldhat_locs": [ + + ], + "ldhat_sites": [ + + ], + "list_geno_ld": [ + + ], + "list_hap_ld": [ + + ], + "lqual": [ + + ], + "lroh": [ + + ], + "map_": [ + + ], + "mendel": [ + + ], + "missing_individual": [ + + ], + "missing_site": [ + + ], + "ped": [ + + ], + "relatedness": [ + + ], + "relatedness2": [ + + ], + "removed_sites": [ + + ], + "singeltons": [ + + ], + "sites_pi": [ + + ], + "snp_density": [ + + ], + "tajima_d": [ + + ], + "tfam": [ + + ], + "tped": [ + + ], + "tstv": [ + + ], + "tstv_count": [ + + ], + "tstv_qual": [ + + ], + "tstv_summary": [ + + ], + "vcf": [ + + ], + "versions": [ + "versions.yml:md5,577abe71f1ed8b94c633e71dc2cfc491" + ], + "weir_fst": [ + + ], + "windowed_pi": [ + + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-03-22T13:07:31.866838" + } +} \ No newline at end of file diff --git a/modules/nf-core/vcftools/tests/tags.yml b/modules/nf-core/vcftools/tests/tags.yml new file mode 100644 index 00000000000..f3afd436646 --- /dev/null +++ b/modules/nf-core/vcftools/tests/tags.yml @@ -0,0 +1,2 @@ +vcftools: + - "modules/nf-core/vcftools/**" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 97884cd9533..226136354b1 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -2270,9 +2270,6 @@ vcflib/vcffilter: vcflib/vcfuniq: - modules/nf-core/vcflib/vcfuniq/** - tests/modules/nf-core/vcflib/vcfuniq/** -vcftools: - - modules/nf-core/vcftools/** - - tests/modules/nf-core/vcftools/** verifybamid/verifybamid: - modules/nf-core/verifybamid/verifybamid/** - tests/modules/nf-core/verifybamid/verifybamid/** diff --git a/tests/modules/nf-core/vcftools/main.nf b/tests/modules/nf-core/vcftools/main.nf deleted file mode 100644 index d1e49cb3618..00000000000 --- a/tests/modules/nf-core/vcftools/main.nf +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { VCFTOOLS as VCFTOOLS_BASE } from '../../../../modules/nf-core/vcftools/main.nf' -include { VCFTOOLS as VCFTOOLS_OPTIONAL } from '../../../../modules/nf-core/vcftools/main.nf' - -workflow test_vcftools_vcf_base { - input = [ [ id:'test' ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) - ] - - VCFTOOLS_BASE ( input, [], [] ) -} - -workflow test_vcftools_vcfgz_base { - input = [ [ id:'test' ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) - ] - - VCFTOOLS_BASE ( input, [], [] ) -} - -workflow test_vcftools_vcf_optional { - input = [ [ id:'test' ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) - ] - bed = file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) - - VCFTOOLS_OPTIONAL ( input, bed, [] ) -} - -workflow test_vcftools_vcfgz_optional { - input = [ [ id:'test' ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) - ] - bed = file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) - - VCFTOOLS_OPTIONAL ( input, bed, [] ) -} diff --git a/tests/modules/nf-core/vcftools/nextflow.config b/tests/modules/nf-core/vcftools/nextflow.config deleted file mode 100644 index 6865bbea8a9..00000000000 --- a/tests/modules/nf-core/vcftools/nextflow.config +++ /dev/null @@ -1,13 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: VCFTOOLS_BASE { - ext.args = '--freq' - } - - withName: VCFTOOLS_OPTIONAL { - ext.args = '--freq --exclude-bed' - } - -} diff --git a/tests/modules/nf-core/vcftools/test.yml b/tests/modules/nf-core/vcftools/test.yml deleted file mode 100644 index e0a1e31f1a2..00000000000 --- a/tests/modules/nf-core/vcftools/test.yml +++ /dev/null @@ -1,31 +0,0 @@ -- name: vcftools test_vcftools_vcf_base - command: nextflow run ./tests/modules/nf-core/vcftools -entry test_vcftools_vcf_base -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/vcftools/nextflow.config - tags: - - vcftools - files: - - path: output/vcftools/test.frq - md5sum: 7f126655f17268fd1a338734f62868e9 - -- name: vcftools test_vcftools_vcfgz_base - command: nextflow run ./tests/modules/nf-core/vcftools -entry test_vcftools_vcfgz_base -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/vcftools/nextflow.config - tags: - - vcftools - files: - - path: output/vcftools/test.frq - md5sum: 7f126655f17268fd1a338734f62868e9 - -- name: vcftools test_vcftools_vcf_optional - command: nextflow run ./tests/modules/nf-core/vcftools -entry test_vcftools_vcf_optional -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/vcftools/nextflow.config - tags: - - vcftools - files: - - path: output/vcftools/test.frq - md5sum: 7f126655f17268fd1a338734f62868e9 - -- name: vcftools test_vcftools_vcfgz_optional - command: nextflow run ./tests/modules/nf-core/vcftools -entry test_vcftools_vcfgz_optional -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/vcftools/nextflow.config - tags: - - vcftools - files: - - path: output/vcftools/test.frq - md5sum: 7f126655f17268fd1a338734f62868e9