From c4af1aa77d77168d4326ed2e5815b3e152378133 Mon Sep 17 00:00:00 2001 From: MartaSantanaSilva Date: Tue, 21 May 2024 19:06:18 +0200 Subject: [PATCH 01/24] New module: Grabix check (#5274) * Author: @MartaSantanaSilva Initial pull for module grabix/check Addition of one test (total: 1) * Update modules/nf-core/grabix/check/main.nf Co-authored-by: Nicolas Vannieuwkerke <101190534+nvnieuwk@users.noreply.github.com> * Update modules/nf-core/grabix/check/main.nf Co-authored-by: Nicolas Vannieuwkerke <101190534+nvnieuwk@users.noreply.github.com> * Update modules/nf-core/grabix/check/main.nf Co-authored-by: Nicolas Vannieuwkerke <101190534+nvnieuwk@users.noreply.github.com> * Update modules/nf-core/grabix/check/meta.yml Co-authored-by: Nicolas Vannieuwkerke <101190534+nvnieuwk@users.noreply.github.com> * new module: grabix Fixes #5181 * Apply suggestions from code review * Update modules/nf-core/grabix/check/meta.yml * fix conda declaration * update snapshot * prettier --------- Co-authored-by: Nicolas Vannieuwkerke <101190534+nvnieuwk@users.noreply.github.com> Co-authored-by: Maxime U Garcia Co-authored-by: maxulysse --- modules/nf-core/grabix/check/environment.yml | 7 ++++ modules/nf-core/grabix/check/main.nf | 42 +++++++++++++++++++ modules/nf-core/grabix/check/meta.yml | 32 ++++++++++++++ .../nf-core/grabix/check/tests/main.nf.test | 32 ++++++++++++++ .../grabix/check/tests/main.nf.test.snap | 35 ++++++++++++++++ modules/nf-core/grabix/check/tests/tags.yml | 2 + 6 files changed, 150 insertions(+) create mode 100644 modules/nf-core/grabix/check/environment.yml create mode 100644 modules/nf-core/grabix/check/main.nf create mode 100644 modules/nf-core/grabix/check/meta.yml create mode 100644 modules/nf-core/grabix/check/tests/main.nf.test create mode 100644 modules/nf-core/grabix/check/tests/main.nf.test.snap create mode 100644 modules/nf-core/grabix/check/tests/tags.yml diff --git a/modules/nf-core/grabix/check/environment.yml b/modules/nf-core/grabix/check/environment.yml new file mode 100644 index 00000000000..d8c21804e1c --- /dev/null +++ b/modules/nf-core/grabix/check/environment.yml @@ -0,0 +1,7 @@ +name: grabix_check +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::grabix=0.1.8 diff --git a/modules/nf-core/grabix/check/main.nf b/modules/nf-core/grabix/check/main.nf new file mode 100644 index 00000000000..5a379a7bf81 --- /dev/null +++ b/modules/nf-core/grabix/check/main.nf @@ -0,0 +1,42 @@ +process GRABIX_CHECK { + label 'process_low' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/grabix:0.1.8--hdcf5f25_9': + 'biocontainers/grabix:0.1.8--hdcf5f25_9' }" + + input: + tuple val(meta), path(input) + + output: + tuple val(meta), stdout, emit: compress_bgzip + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + + """ + grabix check ${input} | tr -d '\\n' + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + grabix: \$(grabix | sed -n -E 's/version: (.*)/\\1/p') + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + + """ + \$(echo yes) + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + grabix: \$(grabix | sed -n -E 's/version: (.*)/\\1/p') + END_VERSIONS + """ +} diff --git a/modules/nf-core/grabix/check/meta.yml b/modules/nf-core/grabix/check/meta.yml new file mode 100644 index 00000000000..7997cdd6a12 --- /dev/null +++ b/modules/nf-core/grabix/check/meta.yml @@ -0,0 +1,32 @@ +--- +name: "grabix_check" +description: Checks if the input file is bgzip compressed or not +keywords: + - compression + - bgzip + - grabix +tools: + - grabix: + description: "a wee tool for random access into BGZF files." + homepage: "https://github.com/arq5x/grabix" + documentation: "https://github.com/arq5x/grabix" + +input: + - input: + type: file + pattern: "*.gz" + description: file to check compression + +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - compress_bgzip: + type: string + description: environmental variable with value "yes" or "no" + +authors: + - "@MartaSantanaSilva" +maintainers: + - "@MartaSantanaSilva" diff --git a/modules/nf-core/grabix/check/tests/main.nf.test b/modules/nf-core/grabix/check/tests/main.nf.test new file mode 100644 index 00000000000..f8d80bb19ff --- /dev/null +++ b/modules/nf-core/grabix/check/tests/main.nf.test @@ -0,0 +1,32 @@ +nextflow_process { + + name "Test Process GRABIX_CHECK" + script "../main.nf" + process "GRABIX_CHECK" + tag "modules" + tag "modules_nfcore" + tag "grabix" + tag "grabix/check" + + test("sarscov2") { + when { + process { + """ + input[0] = Channel.of([ + [ id: 'test'], // meta map + [file(params.test_data_base + "/data/genomics/sarscov2/genome/genome.fasta.gz", checkIfExists: true) ] + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match("") } + ) + } + + } + +} diff --git a/modules/nf-core/grabix/check/tests/main.nf.test.snap b/modules/nf-core/grabix/check/tests/main.nf.test.snap new file mode 100644 index 00000000000..710901b4598 --- /dev/null +++ b/modules/nf-core/grabix/check/tests/main.nf.test.snap @@ -0,0 +1,35 @@ +{ + "": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "yes" + ] + ], + "1": [ + "versions.yml:md5,d68096f2e39f046ced7b8fb4672cae69" + ], + "compress_bgzip": [ + [ + { + "id": "test" + }, + "yes" + ] + ], + "versions": [ + "versions.yml:md5,d68096f2e39f046ced7b8fb4672cae69" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.0" + }, + "timestamp": "2024-05-21T12:00:44.474144" + } +} \ No newline at end of file diff --git a/modules/nf-core/grabix/check/tests/tags.yml b/modules/nf-core/grabix/check/tests/tags.yml new file mode 100644 index 00000000000..fde4531ab94 --- /dev/null +++ b/modules/nf-core/grabix/check/tests/tags.yml @@ -0,0 +1,2 @@ +grabix/check: + - "modules/nf-core/grabix/check/**" From 3e52a04aa60e0cb5cea0487b9ae2fdd04f874027 Mon Sep 17 00:00:00 2001 From: Marcel Ribeiro-Dantas Date: Tue, 21 May 2024 16:33:57 -0400 Subject: [PATCH 02/24] Bump parabricks 4.3.0-1 + remove stageInMode (#5646) Parabricks doesn't require stageInMode to be 'copy' Signed-off-by: Marcel Ribeiro-Dantas --- modules/nf-core/parabricks/applybqsr/main.nf | 2 +- modules/nf-core/parabricks/dbsnp/main.nf | 9 +-------- modules/nf-core/parabricks/deepvariant/main.nf | 9 +-------- modules/nf-core/parabricks/fq2bam/main.nf | 9 +-------- modules/nf-core/parabricks/genotypegvcf/main.nf | 9 +-------- modules/nf-core/parabricks/haplotypecaller/main.nf | 9 +-------- modules/nf-core/parabricks/indexgvcf/main.nf | 9 +-------- modules/nf-core/parabricks/mutectcaller/main.nf | 9 +-------- 8 files changed, 8 insertions(+), 57 deletions(-) diff --git a/modules/nf-core/parabricks/applybqsr/main.nf b/modules/nf-core/parabricks/applybqsr/main.nf index 48696bc1bed..b545297d89a 100644 --- a/modules/nf-core/parabricks/applybqsr/main.nf +++ b/modules/nf-core/parabricks/applybqsr/main.nf @@ -2,7 +2,7 @@ process PARABRICKS_APPLYBQSR { tag "$meta.id" label 'process_high' - container "nvcr.io/nvidia/clara/clara-parabricks:4.0.1-1" + container "nvcr.io/nvidia/clara/clara-parabricks:4.3.0-1" input: tuple val(meta), path(bam), path(bam_index), path(bqsr_table), path(intervals) diff --git a/modules/nf-core/parabricks/dbsnp/main.nf b/modules/nf-core/parabricks/dbsnp/main.nf index 3b8d8f49614..cda2e37f37c 100644 --- a/modules/nf-core/parabricks/dbsnp/main.nf +++ b/modules/nf-core/parabricks/dbsnp/main.nf @@ -2,14 +2,7 @@ process PARABRICKS_DBSNP { tag "$meta.id" label 'process_high' - container "nvcr.io/nvidia/clara/clara-parabricks:4.2.0-1" - - /* - NOTE: Parabricks requires the files to be non-symlinked - Do not change the stageInMode to soft linked! This is default on Nextflow. - If you change this setting be careful. - */ - stageInMode "copy" + container "nvcr.io/nvidia/clara/clara-parabricks:4.3.0-1" input: tuple val(meta), path(vcf_file), path(dbsnp_file), path(tabix_file) diff --git a/modules/nf-core/parabricks/deepvariant/main.nf b/modules/nf-core/parabricks/deepvariant/main.nf index 018430e3aa5..ac18b72f3ad 100644 --- a/modules/nf-core/parabricks/deepvariant/main.nf +++ b/modules/nf-core/parabricks/deepvariant/main.nf @@ -2,14 +2,7 @@ process PARABRICKS_DEEPVARIANT { tag "$meta.id" label 'process_high' - container "nvcr.io/nvidia/clara/clara-parabricks:4.2.0-1" - - /* - NOTE: Parabricks requires the files to be non-symlinked - Do not change the stageInMode to soft linked! This is default on Nextflow. - If you change this setting be careful. - */ - stageInMode "copy" + container "nvcr.io/nvidia/clara/clara-parabricks:4.3.0-1" input: tuple val(meta), path(input), path(input_index), path(interval_file) diff --git a/modules/nf-core/parabricks/fq2bam/main.nf b/modules/nf-core/parabricks/fq2bam/main.nf index af886cc4762..dac03b34c87 100644 --- a/modules/nf-core/parabricks/fq2bam/main.nf +++ b/modules/nf-core/parabricks/fq2bam/main.nf @@ -2,14 +2,7 @@ process PARABRICKS_FQ2BAM { tag "$meta.id" label 'process_high' - container "nvcr.io/nvidia/clara/clara-parabricks:4.2.0-1" - - /* - NOTE: Parabricks requires the files to be non-symlinked - Do not change the stageInMode to soft linked! This is default on Nextflow. - If you change this setting be careful. - */ - stageInMode "copy" + container "nvcr.io/nvidia/clara/clara-parabricks:4.3.0-1" input: tuple val(meta), path(reads), path(interval_file) diff --git a/modules/nf-core/parabricks/genotypegvcf/main.nf b/modules/nf-core/parabricks/genotypegvcf/main.nf index 216e2edbc1c..d94926bff8f 100644 --- a/modules/nf-core/parabricks/genotypegvcf/main.nf +++ b/modules/nf-core/parabricks/genotypegvcf/main.nf @@ -2,14 +2,7 @@ process PARABRICKS_GENOTYPEGVCF { tag "$meta.id" label 'process_high' - container "nvcr.io/nvidia/clara/clara-parabricks:4.2.0-1" - - /* - NOTE: Parabricks requires the files to be non-symlinked - Do not change the stageInMode to soft linked! This is default on Nextflow. - If you change this setting be careful. - */ - stageInMode "copy" + container "nvcr.io/nvidia/clara/clara-parabricks:4.3.0-1" input: tuple val(meta), path(input) diff --git a/modules/nf-core/parabricks/haplotypecaller/main.nf b/modules/nf-core/parabricks/haplotypecaller/main.nf index 56f31c89b45..d8853130da7 100644 --- a/modules/nf-core/parabricks/haplotypecaller/main.nf +++ b/modules/nf-core/parabricks/haplotypecaller/main.nf @@ -2,14 +2,7 @@ process PARABRICKS_HAPLOTYPECALLER { tag "$meta.id" label 'process_high' - container "nvcr.io/nvidia/clara/clara-parabricks:4.2.0-1" - - /* - NOTE: Parabricks requires the files to be non-symlinked - Do not change the stageInMode to soft linked! This is default on Nextflow. - If you change this setting be careful. - */ - stageInMode "copy" + container "nvcr.io/nvidia/clara/clara-parabricks:4.3.0-1" input: tuple val(meta), path(input), path(input_index), path(interval_file) diff --git a/modules/nf-core/parabricks/indexgvcf/main.nf b/modules/nf-core/parabricks/indexgvcf/main.nf index 4f671f799d6..bc082fca255 100644 --- a/modules/nf-core/parabricks/indexgvcf/main.nf +++ b/modules/nf-core/parabricks/indexgvcf/main.nf @@ -2,14 +2,7 @@ process PARABRICKS_INDEXGVCF { tag "$meta.id" label 'process_high' - container "nvcr.io/nvidia/clara/clara-parabricks:4.2.0-1" - - /* - NOTE: Parabricks requires the files to be non-symlinked - Do not change the stageInMode to soft linked! This is default on Nextflow. - If you change this setting be careful. - */ - stageInMode "copy" + container "nvcr.io/nvidia/clara/clara-parabricks:4.3.0-1" input: tuple val(meta), path(gvcf, stageAs:'') diff --git a/modules/nf-core/parabricks/mutectcaller/main.nf b/modules/nf-core/parabricks/mutectcaller/main.nf index bc4073b2749..4758cb14671 100644 --- a/modules/nf-core/parabricks/mutectcaller/main.nf +++ b/modules/nf-core/parabricks/mutectcaller/main.nf @@ -2,14 +2,7 @@ process PARABRICKS_MUTECTCALLER { tag "$meta.id" label 'process_high' - container "nvcr.io/nvidia/clara/clara-parabricks:4.2.0-1" - - /* - NOTE: Parabricks requires the files to be non-symlinked - Do not change the stageInMode to soft linked! This is default on Nextflow. - If you change this setting be careful. - */ - stageInMode "copy" + container "nvcr.io/nvidia/clara/clara-parabricks:4.3.0-1" input: tuple val(meta), path(tumor_bam), path(tumor_bam_index), path(normal_bam), path(normal_bam_index), path(interval_file) From d735292b38270792799d18d3b4948ea4f815b5a7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 May 2024 07:12:42 +0100 Subject: [PATCH 03/24] glimpse2 version bump - abandoned (#4236) * chore(deps): update biocontainers/glimpse-bio docker tag to v2.0.1 * Update main.nf * Update main.nf * Update main.nf * Update main.nf * Update main.nf * Update main.nf * Update main.nf * The channel was renamed in https://github.com/nf-core/modules/pull/5117 * The Conda yml files need to match the container definitions * Typo ! There was a missing s --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Louis LE NEZET <58640615+LouisLeNezet@users.noreply.github.com> Co-authored-by: Matthieu Muffato --- modules/nf-core/glimpse2/chunk/environment.yml | 2 +- modules/nf-core/glimpse2/chunk/main.nf | 4 ++-- .../nf-core/glimpse2/concordance/environment.yml | 2 +- modules/nf-core/glimpse2/concordance/main.nf | 4 ++-- modules/nf-core/glimpse2/ligate/environment.yml | 2 +- modules/nf-core/glimpse2/ligate/main.nf | 4 ++-- modules/nf-core/glimpse2/phase/environment.yml | 2 +- modules/nf-core/glimpse2/phase/main.nf | 4 ++-- .../glimpse2/splitreference/environment.yml | 2 +- modules/nf-core/glimpse2/splitreference/main.nf | 4 ++-- .../glimpse2/splitreference/tests/main.nf.test | 4 ++-- .../splitreference/tests/main.nf.test.snap | 14 +++++++++++--- tests/modules/nf-core/glimpse2/concordance/main.nf | 4 ++-- 13 files changed, 30 insertions(+), 22 deletions(-) diff --git a/modules/nf-core/glimpse2/chunk/environment.yml b/modules/nf-core/glimpse2/chunk/environment.yml index 8b893af7e66..54e5a11143d 100644 --- a/modules/nf-core/glimpse2/chunk/environment.yml +++ b/modules/nf-core/glimpse2/chunk/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::glimpse-bio=2.0.0 + - bioconda::glimpse-bio=2.0.1 diff --git a/modules/nf-core/glimpse2/chunk/main.nf b/modules/nf-core/glimpse2/chunk/main.nf index 4ff4b2a70aa..c7f5d47a300 100644 --- a/modules/nf-core/glimpse2/chunk/main.nf +++ b/modules/nf-core/glimpse2/chunk/main.nf @@ -13,8 +13,8 @@ process GLIMPSE2_CHUNK { """ conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/glimpse-bio:2.0.0--hf340a29_0': - 'biocontainers/glimpse-bio:2.0.0--hf340a29_0' }" + 'https://depot.galaxyproject.org/singularity/glimpse-bio:2.0.1--h46b9e50_1': + 'biocontainers/glimpse-bio:2.0.1--h46b9e50_1' }" input: tuple val(meta) , path(input), path(input_index), val(region) diff --git a/modules/nf-core/glimpse2/concordance/environment.yml b/modules/nf-core/glimpse2/concordance/environment.yml index c3ad98fbf17..f40e83177c6 100644 --- a/modules/nf-core/glimpse2/concordance/environment.yml +++ b/modules/nf-core/glimpse2/concordance/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::glimpse-bio=2.0.0 + - bioconda::glimpse-bio=2.0.1 diff --git a/modules/nf-core/glimpse2/concordance/main.nf b/modules/nf-core/glimpse2/concordance/main.nf index 4fcb587b60a..06eb139b238 100644 --- a/modules/nf-core/glimpse2/concordance/main.nf +++ b/modules/nf-core/glimpse2/concordance/main.nf @@ -4,8 +4,8 @@ process GLIMPSE2_CONCORDANCE { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/glimpse-bio:2.0.0--hf340a29_0': - 'biocontainers/glimpse-bio:2.0.0--hf340a29_0' }" + 'https://depot.galaxyproject.org/singularity/glimpse-bio:2.0.1--h46b9e50_1': + 'biocontainers/glimpse-bio:2.0.1--h46b9e50_1' }" input: tuple val(meta), path(estimate), path(estimate_index), path(truth), path(truth_index), path(freq), path(freq_index), path(samples), val(region) diff --git a/modules/nf-core/glimpse2/ligate/environment.yml b/modules/nf-core/glimpse2/ligate/environment.yml index 67e2c3e6126..1e5316005ad 100644 --- a/modules/nf-core/glimpse2/ligate/environment.yml +++ b/modules/nf-core/glimpse2/ligate/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::glimpse-bio=2.0.0 + - bioconda::glimpse-bio=2.0.1 diff --git a/modules/nf-core/glimpse2/ligate/main.nf b/modules/nf-core/glimpse2/ligate/main.nf index 8c6256cf70d..a1ca54b0fd4 100644 --- a/modules/nf-core/glimpse2/ligate/main.nf +++ b/modules/nf-core/glimpse2/ligate/main.nf @@ -4,8 +4,8 @@ process GLIMPSE2_LIGATE { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/glimpse-bio:2.0.0--hf340a29_0': - 'biocontainers/glimpse-bio:2.0.0--hf340a29_0' }" + 'https://depot.galaxyproject.org/singularity/glimpse-bio:2.0.1--h46b9e50_1': + 'biocontainers/glimpse-bio:2.0.1--h46b9e50_1' }" input: tuple val(meta), path(input_list), path(input_index) diff --git a/modules/nf-core/glimpse2/phase/environment.yml b/modules/nf-core/glimpse2/phase/environment.yml index b56a1ee64e8..0e3938c787c 100644 --- a/modules/nf-core/glimpse2/phase/environment.yml +++ b/modules/nf-core/glimpse2/phase/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::glimpse-bio=2.0.0 + - bioconda::glimpse-bio=2.0.1 diff --git a/modules/nf-core/glimpse2/phase/main.nf b/modules/nf-core/glimpse2/phase/main.nf index f61cf022878..d61bd9b8826 100644 --- a/modules/nf-core/glimpse2/phase/main.nf +++ b/modules/nf-core/glimpse2/phase/main.nf @@ -14,8 +14,8 @@ process GLIMPSE2_PHASE { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/glimpse-bio:2.0.0--hf340a29_0': - 'biocontainers/glimpse-bio:2.0.0--hf340a29_0' }" + 'https://depot.galaxyproject.org/singularity/glimpse-bio:2.0.1--h46b9e50_1': + 'biocontainers/glimpse-bio:2.0.1--h46b9e50_1' }" input: tuple val(meta) , path(input), path(input_index), path(samples_file), val(input_region), val(output_region), path(reference), path(reference_index), path(map) diff --git a/modules/nf-core/glimpse2/splitreference/environment.yml b/modules/nf-core/glimpse2/splitreference/environment.yml index a4dd839a2f7..b283e8356de 100644 --- a/modules/nf-core/glimpse2/splitreference/environment.yml +++ b/modules/nf-core/glimpse2/splitreference/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::glimpse-bio=2.0.0 + - bioconda::glimpse-bio=2.0.1 diff --git a/modules/nf-core/glimpse2/splitreference/main.nf b/modules/nf-core/glimpse2/splitreference/main.nf index 31b758d3ac6..1f4800f7b5d 100644 --- a/modules/nf-core/glimpse2/splitreference/main.nf +++ b/modules/nf-core/glimpse2/splitreference/main.nf @@ -14,8 +14,8 @@ process GLIMPSE2_SPLITREFERENCE { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/glimpse-bio:2.0.0--hf340a29_0': - 'biocontainers/glimpse-bio:2.0.0--hf340a29_0' }" + 'https://depot.galaxyproject.org/singularity/glimpse-bio:2.0.1--h46b9e50_1': + 'biocontainers/glimpse-bio:2.0.1--h46b9e50_1' }" input: tuple val(meta) , path(reference), path(reference_index), val(input_region), val(output_region) diff --git a/modules/nf-core/glimpse2/splitreference/tests/main.nf.test b/modules/nf-core/glimpse2/splitreference/tests/main.nf.test index be55b4c762c..ab9ac5f9b7e 100644 --- a/modules/nf-core/glimpse2/splitreference/tests/main.nf.test +++ b/modules/nf-core/glimpse2/splitreference/tests/main.nf.test @@ -33,7 +33,7 @@ nextflow_process { { assert process.success }, // File has a timestamp in it and is in binary format, so we can only check the name { assert file(process.out.bin_ref[0][1]).name == "ref1000GP_chr21_16600000_16800000.bin" }, - { assert snapshot(process.out.version).match()} + { assert snapshot(process.out.versions).match() } ) } @@ -61,7 +61,7 @@ nextflow_process { { assert process.success }, // File has a timestamp in it and is in binary format, so we can only check the name { assert file(process.out.bin_ref[0][1]).name == "ref1000GP_chr21_16600000_16800000.bin" }, - { assert snapshot(process.out.version).match()} + { assert snapshot(process.out.versions).match() } ) } diff --git a/modules/nf-core/glimpse2/splitreference/tests/main.nf.test.snap b/modules/nf-core/glimpse2/splitreference/tests/main.nf.test.snap index 6e6d64ca2b0..90a3887a824 100644 --- a/modules/nf-core/glimpse2/splitreference/tests/main.nf.test.snap +++ b/modules/nf-core/glimpse2/splitreference/tests/main.nf.test.snap @@ -1,6 +1,10 @@ { "Should run without map": { - "content": null, + "content": [ + [ + "versions.yml:md5,cbb441f211d698011dca80e4391d1446" + ] + ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" @@ -8,11 +12,15 @@ "timestamp": "2024-03-13T14:52:00.115502" }, "Should run with map": { - "content": null, + "content": [ + [ + "versions.yml:md5,cbb441f211d698011dca80e4391d1446" + ] + ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, "timestamp": "2024-03-13T14:52:08.29561" } -} \ No newline at end of file +} diff --git a/tests/modules/nf-core/glimpse2/concordance/main.nf b/tests/modules/nf-core/glimpse2/concordance/main.nf index 63c30971a73..90d6acf3e21 100644 --- a/tests/modules/nf-core/glimpse2/concordance/main.nf +++ b/tests/modules/nf-core/glimpse2/concordance/main.nf @@ -47,9 +47,9 @@ workflow preprocessing { file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/NA12878.chr21.s.bcf.csi",checkIfExists:true) ]) - BCFTOOLS_INDEX ( GLIMPSE2_PHASE.output.phased_variant ) + BCFTOOLS_INDEX ( GLIMPSE2_PHASE.output.phased_variants ) - list_inputs = GLIMPSE2_PHASE.output.phased_variant + list_inputs = GLIMPSE2_PHASE.output.phased_variants .join( BCFTOOLS_INDEX.out.csi ) .combine( truth ) .combine( allele_freq ) From a69780285998038b8cc9a1084adbc49a1196871c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 May 2024 09:49:08 +0200 Subject: [PATCH 04/24] Update pre-commit hook renovatebot/pre-commit-hooks to v37.371.1 (#5653) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 328d59221df..23751619550 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: args: ["--schemafile", "subworkflows/yaml-schema.json"] - id: check-github-workflows - repo: https://github.com/renovatebot/pre-commit-hooks - rev: 37.368.10 + rev: 37.371.1 hooks: - id: renovate-config-validator # use ruff for python files From 5e0c5677ea33b3d4c3793244035a191bd03e6736 Mon Sep 17 00:00:00 2001 From: Jose Espinosa-Carrasco Date: Wed, 22 May 2024 09:50:08 +0200 Subject: [PATCH 05/24] Bump csvtk version to CSVTK/JOIN and add nf-test (#5642) * Bump csvtk new version * Add nf-test * Get rid of pytest * Bump version in singularity images * Update tests/config/pytest_modules.yml --------- Co-authored-by: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> --- modules/nf-core/csvtk/join/environment.yml | 2 +- modules/nf-core/csvtk/join/main.nf | 5 +- modules/nf-core/csvtk/join/tests/main.nf.test | 65 +++++++++++++++++++ .../csvtk/join/tests/main.nf.test.snap | 60 +++++++++++++++++ .../nf-core/csvtk/join/tests/nextflow.config | 5 ++ modules/nf-core/csvtk/join/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 - tests/modules/nf-core/csvtk/join/main.nf | 18 ----- .../nf-core/csvtk/join/nextflow.config | 8 --- tests/modules/nf-core/csvtk/join/test.yml | 9 --- 10 files changed, 135 insertions(+), 42 deletions(-) create mode 100644 modules/nf-core/csvtk/join/tests/main.nf.test create mode 100644 modules/nf-core/csvtk/join/tests/main.nf.test.snap create mode 100644 modules/nf-core/csvtk/join/tests/nextflow.config create mode 100644 modules/nf-core/csvtk/join/tests/tags.yml delete mode 100644 tests/modules/nf-core/csvtk/join/main.nf delete mode 100644 tests/modules/nf-core/csvtk/join/nextflow.config delete mode 100644 tests/modules/nf-core/csvtk/join/test.yml diff --git a/modules/nf-core/csvtk/join/environment.yml b/modules/nf-core/csvtk/join/environment.yml index b488c8614c6..5b6c6468f4a 100644 --- a/modules/nf-core/csvtk/join/environment.yml +++ b/modules/nf-core/csvtk/join/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::csvtk=0.26.0 + - bioconda::csvtk=0.30.0 diff --git a/modules/nf-core/csvtk/join/main.nf b/modules/nf-core/csvtk/join/main.nf index bf02e7f533c..5f3afeeae88 100644 --- a/modules/nf-core/csvtk/join/main.nf +++ b/modules/nf-core/csvtk/join/main.nf @@ -4,8 +4,8 @@ process CSVTK_JOIN { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/csvtk:0.26.0--h9ee0642_0': - 'biocontainers/csvtk:0.26.0--h9ee0642_0' }" + 'https://depot.galaxyproject.org/singularity/csvtk:0.30.0--h9ee0642_0': + 'biocontainers/csvtk:0.30.0--h9ee0642_0' }" input: tuple val(meta), path(csv) @@ -36,7 +36,6 @@ process CSVTK_JOIN { """ stub: - def args = task.ext.args ?: '' prefix = task.ext.prefix ?: "${meta.id}" out_extension = args.contains('--out-delimiter "\t"') || args.contains('-D "\t"') || args.contains("-D \$'\t'") ? "tsv" : "csv" """ diff --git a/modules/nf-core/csvtk/join/tests/main.nf.test b/modules/nf-core/csvtk/join/tests/main.nf.test new file mode 100644 index 00000000000..ca885313476 --- /dev/null +++ b/modules/nf-core/csvtk/join/tests/main.nf.test @@ -0,0 +1,65 @@ +nextflow_process { + + name "Test Process CSVTK_JOIN" + script "../main.nf" + process "CSVTK_JOIN" + + tag "modules" + tag "modules_nfcore" + tag "csvtk" + tag "csvtk/join" + + test("join - csv") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file("https://github.com/nf-core/test-datasets/raw/bacass/bacass_hybrid.csv", checkIfExists: true), + file("https://github.com/nf-core/test-datasets/raw/bacass/bacass_short.csv", checkIfExists: true), + ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + // TODO nf-core: Change the test name preferably indicating the test-data and file-format used but keep the " - stub" suffix. + test("join - csv - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file("https://github.com/nf-core/test-datasets/raw/bacass/bacass_hybrid.csv", checkIfExists: true), + file("https://github.com/nf-core/test-datasets/raw/bacass/bacass_short.csv", checkIfExists: true), + ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/csvtk/join/tests/main.nf.test.snap b/modules/nf-core/csvtk/join/tests/main.nf.test.snap new file mode 100644 index 00000000000..b124788bb68 --- /dev/null +++ b/modules/nf-core/csvtk/join/tests/main.nf.test.snap @@ -0,0 +1,60 @@ +{ + "join - csv": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.csv:md5,d0ad82ca096c7e05eb9f9a04194c9e30" + ] + ], + "1": [ + "versions.yml:md5,e76147e4eca968d23543e7007522f1d3" + ], + "csv": [ + [ + { + "id": "test" + }, + "test.csv:md5,d0ad82ca096c7e05eb9f9a04194c9e30" + ] + ], + "versions": [ + "versions.yml:md5,e76147e4eca968d23543e7007522f1d3" + ] + } + ], + "timestamp": "2024-05-21T15:45:44.045434" + }, + "join - csv - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.csv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,e76147e4eca968d23543e7007522f1d3" + ], + "csv": [ + [ + { + "id": "test" + }, + "test.csv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e76147e4eca968d23543e7007522f1d3" + ] + } + ], + "timestamp": "2024-05-21T15:45:55.59201" + } +} \ No newline at end of file diff --git a/modules/nf-core/csvtk/join/tests/nextflow.config b/modules/nf-core/csvtk/join/tests/nextflow.config new file mode 100644 index 00000000000..1b14393a9cc --- /dev/null +++ b/modules/nf-core/csvtk/join/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: CSVTK_JOIN { + ext.args = "--fields 'ID;ID' -p -e -d \"\t\" -D \",\"" + } +} diff --git a/modules/nf-core/csvtk/join/tests/tags.yml b/modules/nf-core/csvtk/join/tests/tags.yml new file mode 100644 index 00000000000..6c3a0fa6b38 --- /dev/null +++ b/modules/nf-core/csvtk/join/tests/tags.yml @@ -0,0 +1,2 @@ +csvtk/join: + - "modules/nf-core/csvtk/join/**" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index b6ae61386a4..2e115eeb933 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -365,9 +365,6 @@ crisprcleanr/normalize: crumble: - modules/nf-core/crumble/** - tests/modules/nf-core/crumble/** -csvtk/join: - - modules/nf-core/csvtk/join/** - - tests/modules/nf-core/csvtk/join/** csvtk/split: - modules/nf-core/csvtk/split/** - tests/modules/nf-core/csvtk/split/** diff --git a/tests/modules/nf-core/csvtk/join/main.nf b/tests/modules/nf-core/csvtk/join/main.nf deleted file mode 100644 index c886b6bc53a..00000000000 --- a/tests/modules/nf-core/csvtk/join/main.nf +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { CSVTK_JOIN } from '../../../../../modules/nf-core/csvtk/join/main.nf' - -workflow test_csvtk_join { - - input = [ - [ id:'test' ], // meta map - [ - file("https://github.com/nf-core/test-datasets/raw/bacass/bacass_hybrid.csv", checkIfExists: true), - file("https://github.com/nf-core/test-datasets/raw/bacass/bacass_short.csv", checkIfExists: true) - ] - ] - - CSVTK_JOIN ( input ) -} diff --git a/tests/modules/nf-core/csvtk/join/nextflow.config b/tests/modules/nf-core/csvtk/join/nextflow.config deleted file mode 100644 index 7c4d0928a40..00000000000 --- a/tests/modules/nf-core/csvtk/join/nextflow.config +++ /dev/null @@ -1,8 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: CSVTK_JOIN { - ext.args = "--fields 'ID;ID' -p -e -d \"\t\" -D \",\"" - } -} diff --git a/tests/modules/nf-core/csvtk/join/test.yml b/tests/modules/nf-core/csvtk/join/test.yml deleted file mode 100644 index cf3ed2b7a59..00000000000 --- a/tests/modules/nf-core/csvtk/join/test.yml +++ /dev/null @@ -1,9 +0,0 @@ -- name: csvtk join test_csvtk_join - command: nextflow run ./tests/modules/nf-core/csvtk/join -entry test_csvtk_join -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/csvtk/join/nextflow.config - tags: - - csvtk/join - - csvtk - files: - - path: output/csvtk/test.csv - md5sum: 0ab28b22412f9d4bfb0cf7de262746cb - - path: output/csvtk/versions.yml From 1c72d95476a2edf92ee4f08dc4321b3c50cd3c13 Mon Sep 17 00:00:00 2001 From: Usman Rashid Date: Wed, 22 May 2024 20:44:18 +1200 Subject: [PATCH 06/24] Added task.memory to meryl modules and .meryl ext for outputs (#5655) --- modules/nf-core/meryl/count/main.nf | 9 +++++---- modules/nf-core/meryl/count/meta.yml | 3 ++- modules/nf-core/meryl/count/tests/main.nf.test.snap | 6 +++--- modules/nf-core/meryl/histogram/main.nf | 1 + modules/nf-core/meryl/histogram/meta.yml | 3 ++- modules/nf-core/meryl/unionsum/main.nf | 7 ++++--- modules/nf-core/meryl/unionsum/meta.yml | 3 ++- modules/nf-core/meryl/unionsum/tests/main.nf.test.snap | 6 +++--- 8 files changed, 22 insertions(+), 16 deletions(-) diff --git a/modules/nf-core/meryl/count/main.nf b/modules/nf-core/meryl/count/main.nf index 2f0518f3ee9..0f1ff0af141 100644 --- a/modules/nf-core/meryl/count/main.nf +++ b/modules/nf-core/meryl/count/main.nf @@ -12,8 +12,8 @@ process MERYL_COUNT { val kvalue output: - tuple val(meta), path("*.meryldb"), emit: meryl_db - path "versions.yml" , emit: versions + tuple val(meta), path("*.meryl") , emit: meryl_db + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -26,9 +26,10 @@ process MERYL_COUNT { meryl count \\ k=$kvalue \\ threads=$task.cpus \\ + memory=${task.memory.toGiga()} \\ $args \\ $reads \\ - output read.\${READ%.f*}.meryldb + output read.\${READ%.f*}.meryl done cat <<-END_VERSIONS > versions.yml @@ -42,7 +43,7 @@ process MERYL_COUNT { def prefix = task.ext.prefix ?: "${meta.id}" """ for READ in $reads; do - touch read.\${READ%.f*}.meryldb + touch read.\${READ%.f*}.meryl done cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/meryl/count/meta.yml b/modules/nf-core/meryl/count/meta.yml index c9347c0ca5d..809a32fec41 100644 --- a/modules/nf-core/meryl/count/meta.yml +++ b/modules/nf-core/meryl/count/meta.yml @@ -38,8 +38,9 @@ output: - meryl_db: type: directory description: A Meryl k-mer database - pattern: "*.meryldb" + pattern: "*.meryl" authors: - "@mahesh-panchal" maintainers: - "@mahesh-panchal" + - "@gallvp" diff --git a/modules/nf-core/meryl/count/tests/main.nf.test.snap b/modules/nf-core/meryl/count/tests/main.nf.test.snap index da7c9f31916..e0a209029b3 100644 --- a/modules/nf-core/meryl/count/tests/main.nf.test.snap +++ b/modules/nf-core/meryl/count/tests/main.nf.test.snap @@ -303,7 +303,7 @@ "id": "test", "single_end": true }, - "read.test1_1.meryldb:md5,d41d8cd98f00b204e9800998ecf8427e" + "read.test1_1.meryl:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "1": [ @@ -315,7 +315,7 @@ "id": "test", "single_end": true }, - "read.test1_1.meryldb:md5,d41d8cd98f00b204e9800998ecf8427e" + "read.test1_1.meryl:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "versions": [ @@ -327,6 +327,6 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-26T19:30:13.745468405" + "timestamp": "2024-05-22T12:27:16.300916" } } \ No newline at end of file diff --git a/modules/nf-core/meryl/histogram/main.nf b/modules/nf-core/meryl/histogram/main.nf index 622442cc671..297798426b1 100644 --- a/modules/nf-core/meryl/histogram/main.nf +++ b/modules/nf-core/meryl/histogram/main.nf @@ -25,6 +25,7 @@ process MERYL_HISTOGRAM { meryl histogram \\ k=$kvalue \\ threads=$task.cpus \\ + memory=${task.memory.toGiga()} \\ $args \\ $meryl_db > ${prefix}.hist diff --git a/modules/nf-core/meryl/histogram/meta.yml b/modules/nf-core/meryl/histogram/meta.yml index fb67f4ef05e..c974558c8a7 100644 --- a/modules/nf-core/meryl/histogram/meta.yml +++ b/modules/nf-core/meryl/histogram/meta.yml @@ -17,7 +17,7 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - meryl_dbs: + - meryl_db: type: directory description: Meryl k-mer database - kvalue: @@ -41,3 +41,4 @@ authors: - "@mahesh-panchal" maintainers: - "@mahesh-panchal" + - "@gallvp" diff --git a/modules/nf-core/meryl/unionsum/main.nf b/modules/nf-core/meryl/unionsum/main.nf index 3ee86e0f3bb..bc2853b080a 100644 --- a/modules/nf-core/meryl/unionsum/main.nf +++ b/modules/nf-core/meryl/unionsum/main.nf @@ -12,7 +12,7 @@ process MERYL_UNIONSUM { val kvalue output: - tuple val(meta), path("*.unionsum.meryldb"), emit: meryl_db + tuple val(meta), path("*.unionsum.meryl"), emit: meryl_db path "versions.yml" , emit: versions when: @@ -25,8 +25,9 @@ process MERYL_UNIONSUM { meryl union-sum \\ k=$kvalue \\ threads=$task.cpus \\ + memory=${task.memory.toGiga()} \\ $args \\ - output ${prefix}.unionsum.meryldb \\ + output ${prefix}.unionsum.meryl \\ $meryl_dbs cat <<-END_VERSIONS > versions.yml @@ -39,7 +40,7 @@ process MERYL_UNIONSUM { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.unionsum.meryldb + touch ${prefix}.unionsum.meryl cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/meryl/unionsum/meta.yml b/modules/nf-core/meryl/unionsum/meta.yml index 3bb0125088d..77d0784c530 100644 --- a/modules/nf-core/meryl/unionsum/meta.yml +++ b/modules/nf-core/meryl/unionsum/meta.yml @@ -36,8 +36,9 @@ output: - meryl_db: type: directory description: A Meryl k-mer database that is the union sum of the input databases - pattern: "*.unionsum.meryldb" + pattern: "*.unionsum.meryl" authors: - "@mahesh-panchal" maintainers: - "@mahesh-panchal" + - "@gallvp" diff --git a/modules/nf-core/meryl/unionsum/tests/main.nf.test.snap b/modules/nf-core/meryl/unionsum/tests/main.nf.test.snap index 522a52c97ca..a6ed4c73468 100644 --- a/modules/nf-core/meryl/unionsum/tests/main.nf.test.snap +++ b/modules/nf-core/meryl/unionsum/tests/main.nf.test.snap @@ -8,7 +8,7 @@ "id": "test", "single_end": true }, - "test.unionsum.meryldb:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.unionsum.meryl:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "1": [ @@ -20,7 +20,7 @@ "id": "test", "single_end": true }, - "test.unionsum.meryldb:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.unionsum.meryl:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "versions": [ @@ -32,7 +32,7 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-27T10:19:52.291287389" + "timestamp": "2024-05-22T12:40:21.306142" }, "sarscov2 - fastq - single_end": { "content": [ From 9b8e3e4bf01529ce548ad32c3cd17a9c03d5f067 Mon Sep 17 00:00:00 2001 From: Usman Rashid Date: Wed, 22 May 2024 21:20:56 +1200 Subject: [PATCH 07/24] Stub and nf-test for fastk/fastk (#5631) * Stub and nf-test for fastk/fastk * Added chmod +r to add read permissions for docker * Added a+r --- modules/nf-core/fastk/fastk/environment.yml | 2 + modules/nf-core/fastk/fastk/main.nf | 33 ++ modules/nf-core/fastk/fastk/meta.yml | 3 +- .../nf-core/fastk/fastk/tests/main.nf.test | 110 ++++++ .../fastk/fastk/tests/main.nf.test.snap | 346 ++++++++++++++++++ .../nf-core/fastk/fastk/tests/nextflow.config | 3 + modules/nf-core/fastk/fastk/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 - tests/modules/nf-core/fastk/fastk/main.nf | 28 -- .../nf-core/fastk/fastk/nextflow.config | 6 - tests/modules/nf-core/fastk/fastk/test.yml | 45 --- 11 files changed, 498 insertions(+), 83 deletions(-) create mode 100644 modules/nf-core/fastk/fastk/tests/main.nf.test create mode 100644 modules/nf-core/fastk/fastk/tests/main.nf.test.snap create mode 100644 modules/nf-core/fastk/fastk/tests/nextflow.config create mode 100644 modules/nf-core/fastk/fastk/tests/tags.yml delete mode 100644 tests/modules/nf-core/fastk/fastk/main.nf delete mode 100644 tests/modules/nf-core/fastk/fastk/nextflow.config delete mode 100644 tests/modules/nf-core/fastk/fastk/test.yml diff --git a/modules/nf-core/fastk/fastk/environment.yml b/modules/nf-core/fastk/fastk/environment.yml index 54c932fee2e..efb503e1454 100644 --- a/modules/nf-core/fastk/fastk/environment.yml +++ b/modules/nf-core/fastk/fastk/environment.yml @@ -3,3 +3,5 @@ channels: - conda-forge - bioconda - defaults +dependencies: + - bioconda::false_flag # False flag to pass nf-core/lint diff --git a/modules/nf-core/fastk/fastk/main.nf b/modules/nf-core/fastk/fastk/main.nf index fec5a4d20f7..8c401f4be4a 100644 --- a/modules/nf-core/fastk/fastk/main.nf +++ b/modules/nf-core/fastk/fastk/main.nf @@ -33,6 +33,39 @@ process FASTK_FASTK { -N${prefix}_fk \\ $reads + find . -name '*.ktab*' \\ + | xargs chmod a+r + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + fastk: $FASTK_VERSION + END_VERSIONS + """ + + stub: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "FASTK_FASTK module does not support Conda. Please use Docker / Singularity / Podman instead." + } + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def FASTK_VERSION = 'f18a4e6d2207539f7b84461daebc54530a9559b0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + + def touch_ktab = args.contains('-t') ? "touch ${prefix}_fk.ktab .${prefix}_fk.ktab.1" : '' + def touch_prof = args.contains('-p') ? "touch ${prefix}_fk.prof .${prefix}_fk.pidx.1" : '' + """ + touch ${prefix}_fk.hist + $touch_ktab + $touch_prof + + echo \\ + "FastK \\ + $args \\ + -T$task.cpus \\ + -M${task.memory.toGiga()} \\ + -N${prefix}_fk \\ + $reads" + cat <<-END_VERSIONS > versions.yml "${task.process}": fastk: $FASTK_VERSION diff --git a/modules/nf-core/fastk/fastk/meta.yml b/modules/nf-core/fastk/fastk/meta.yml index 7c7f4260ce5..3086aca51af 100644 --- a/modules/nf-core/fastk/fastk/meta.yml +++ b/modules/nf-core/fastk/fastk/meta.yml @@ -9,7 +9,7 @@ tools: description: "A fast K-mer counter for high-fidelity shotgun datasets" homepage: "https://github.com/thegenemyers/FASTK" tool_dev_url: "https://github.com/thegenemyers/FASTK" - licence: "https://github.com/thegenemyers/FASTK/blob/master/LICENSE" + licence: ["https://github.com/thegenemyers/FASTK/blob/master/LICENSE"] input: - meta: type: map @@ -47,3 +47,4 @@ authors: - "@mahesh-panchal" maintainers: - "@mahesh-panchal" + - "@gallvp" diff --git a/modules/nf-core/fastk/fastk/tests/main.nf.test b/modules/nf-core/fastk/fastk/tests/main.nf.test new file mode 100644 index 00000000000..e46d8bce036 --- /dev/null +++ b/modules/nf-core/fastk/fastk/tests/main.nf.test @@ -0,0 +1,110 @@ +nextflow_process { + + name "Test Process FASTK_FASTK" + script "../main.nf" + config './nextflow.config' + process "FASTK_FASTK" + + tag "modules" + tag "modules_nfcore" + tag "fastk" + tag "fastk/fastk" + + test("test_fastk_fastk_single_end") { + when { + process { + """ + input[0] = [ + [ id:'test' , single_end: true ], // meta map + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("test_fastk_fastk_paired_end") { + + when { + process { + """ + input[0] = [ + [ id:'test' , single_end: false ], // meta map + [ + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("test_fastk_fastk_single_end_stub") { + + options '-stub' + + when { + process { + """ + input[0] = [ + [ id:'test' , single_end: true ], // meta map + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("test_fastk_fastk_paired_end_stub") { + + options '-stub' + + when { + process { + """ + input[0] = [ + [ id:'test' , single_end: false ], // meta map + [ + file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/fastk/fastk/tests/main.nf.test.snap b/modules/nf-core/fastk/fastk/tests/main.nf.test.snap new file mode 100644 index 00000000000..1e3fc4dada3 --- /dev/null +++ b/modules/nf-core/fastk/fastk/tests/main.nf.test.snap @@ -0,0 +1,346 @@ +{ + "test_fastk_fastk_single_end_stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test_fk.hist:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + [ + ".test_fk.ktab.1:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_fk.ktab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + [ + ".test_fk.pidx.1:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_fk.prof:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "3": [ + "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + ], + "hist": [ + [ + { + "id": "test", + "single_end": true + }, + "test_fk.hist:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "ktab": [ + [ + { + "id": "test", + "single_end": true + }, + [ + ".test_fk.ktab.1:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_fk.ktab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "prof": [ + [ + { + "id": "test", + "single_end": true + }, + [ + ".test_fk.pidx.1:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_fk.prof:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "versions": [ + "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-18T19:39:28.510263" + }, + "test_fastk_fastk_single_end": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test_fk.hist:md5,c80e12f7321e62dba4b437d7bff36ec0" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + [ + ".test_fk.ktab.1:md5,ceeacd0cb3aa69bf9b2a402830b40e26", + ".test_fk.ktab.2:md5,f2629fd15b285aed3dc2d5fe546edf3f", + "test_fk.ktab:md5,a605a58931a4b5029469e1c2575c8cee" + ] + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + [ + ".test_fk.pidx.1:md5,90bc384f61d2ecdb4586ab52ab04fddf", + ".test_fk.prof.1:md5,ebd48923a724cf79934f0b2ed42ba73d", + "test_fk.prof:md5,43d426c95d277b8148406624d513bd40" + ] + ] + ], + "3": [ + "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + ], + "hist": [ + [ + { + "id": "test", + "single_end": true + }, + "test_fk.hist:md5,c80e12f7321e62dba4b437d7bff36ec0" + ] + ], + "ktab": [ + [ + { + "id": "test", + "single_end": true + }, + [ + ".test_fk.ktab.1:md5,ceeacd0cb3aa69bf9b2a402830b40e26", + ".test_fk.ktab.2:md5,f2629fd15b285aed3dc2d5fe546edf3f", + "test_fk.ktab:md5,a605a58931a4b5029469e1c2575c8cee" + ] + ] + ], + "prof": [ + [ + { + "id": "test", + "single_end": true + }, + [ + ".test_fk.pidx.1:md5,90bc384f61d2ecdb4586ab52ab04fddf", + ".test_fk.prof.1:md5,ebd48923a724cf79934f0b2ed42ba73d", + "test_fk.prof:md5,43d426c95d277b8148406624d513bd40" + ] + ] + ], + "versions": [ + "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-18T19:31:31.128388" + }, + "test_fastk_fastk_paired_end": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_fk.hist:md5,4f75b550d87ed4f26a2b10a05ac7e98c" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + [ + ".test_fk.ktab.1:md5,7f28fb44940fda799797e3069f5d7263", + ".test_fk.ktab.2:md5,c14a85c128926ace78372f09029977b1", + "test_fk.ktab:md5,fddd5be0c36ad1d2131b8d8774f7657a" + ] + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + [ + ".test_fk.pidx.1:md5,e7e760f714070a4afefb38ffff559684", + ".test_fk.pidx.2:md5,a549612bbdba2506eb3311237638c4b0", + ".test_fk.prof.1:md5,46a5fd9e297262b058f8c1fd062fcf56", + ".test_fk.prof.2:md5,80326a7406f41ccf2e51e341fc804132", + "test_fk.prof:md5,d3c7d8decd4ea6e298291b8be0e2de85" + ] + ] + ], + "3": [ + "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + ], + "hist": [ + [ + { + "id": "test", + "single_end": false + }, + "test_fk.hist:md5,4f75b550d87ed4f26a2b10a05ac7e98c" + ] + ], + "ktab": [ + [ + { + "id": "test", + "single_end": false + }, + [ + ".test_fk.ktab.1:md5,7f28fb44940fda799797e3069f5d7263", + ".test_fk.ktab.2:md5,c14a85c128926ace78372f09029977b1", + "test_fk.ktab:md5,fddd5be0c36ad1d2131b8d8774f7657a" + ] + ] + ], + "prof": [ + [ + { + "id": "test", + "single_end": false + }, + [ + ".test_fk.pidx.1:md5,e7e760f714070a4afefb38ffff559684", + ".test_fk.pidx.2:md5,a549612bbdba2506eb3311237638c4b0", + ".test_fk.prof.1:md5,46a5fd9e297262b058f8c1fd062fcf56", + ".test_fk.prof.2:md5,80326a7406f41ccf2e51e341fc804132", + "test_fk.prof:md5,d3c7d8decd4ea6e298291b8be0e2de85" + ] + ] + ], + "versions": [ + "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-18T19:31:35.565502" + }, + "test_fastk_fastk_paired_end_stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_fk.hist:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + [ + ".test_fk.ktab.1:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_fk.ktab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + [ + ".test_fk.pidx.1:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_fk.prof:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "3": [ + "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + ], + "hist": [ + [ + { + "id": "test", + "single_end": false + }, + "test_fk.hist:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "ktab": [ + [ + { + "id": "test", + "single_end": false + }, + [ + ".test_fk.ktab.1:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_fk.ktab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "prof": [ + [ + { + "id": "test", + "single_end": false + }, + [ + ".test_fk.pidx.1:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_fk.prof:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "versions": [ + "versions.yml:md5,c216a1608924d1662d2086e1de1d5abd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-18T19:39:32.570957" + } +} \ No newline at end of file diff --git a/modules/nf-core/fastk/fastk/tests/nextflow.config b/modules/nf-core/fastk/fastk/tests/nextflow.config new file mode 100644 index 00000000000..c89ce9d52c7 --- /dev/null +++ b/modules/nf-core/fastk/fastk/tests/nextflow.config @@ -0,0 +1,3 @@ +process { + ext.args = '-t -p' +} diff --git a/modules/nf-core/fastk/fastk/tests/tags.yml b/modules/nf-core/fastk/fastk/tests/tags.yml new file mode 100644 index 00000000000..82f9df82150 --- /dev/null +++ b/modules/nf-core/fastk/fastk/tests/tags.yml @@ -0,0 +1,2 @@ +fastk/fastk: + - "modules/nf-core/fastk/fastk/**" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 2e115eeb933..1b07ecb3fac 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -509,9 +509,6 @@ faqcs: fastawindows: - modules/nf-core/fastawindows/** - tests/modules/nf-core/fastawindows/** -fastk/fastk: - - modules/nf-core/fastk/fastk/** - - tests/modules/nf-core/fastk/fastk/** fastk/histex: - modules/nf-core/fastk/histex/** - tests/modules/nf-core/fastk/histex/** diff --git a/tests/modules/nf-core/fastk/fastk/main.nf b/tests/modules/nf-core/fastk/fastk/main.nf deleted file mode 100644 index aa30d58890a..00000000000 --- a/tests/modules/nf-core/fastk/fastk/main.nf +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { FASTK_FASTK } from '../../../../../modules/nf-core/fastk/fastk/main.nf' - -workflow test_fastk_fastk_single_end { - - input = [ - [ id:'test' , single_end: true ], // meta map - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) - ] - - FASTK_FASTK ( input ) -} - -workflow test_fastk_fastk_paired_end { - - input = [ - [ id:'test' , single_end: false ], // meta map - [ - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) - ] - ] - - FASTK_FASTK ( input ) -} diff --git a/tests/modules/nf-core/fastk/fastk/nextflow.config b/tests/modules/nf-core/fastk/fastk/nextflow.config deleted file mode 100644 index 14d50725c98..00000000000 --- a/tests/modules/nf-core/fastk/fastk/nextflow.config +++ /dev/null @@ -1,6 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - ext.args = '-t -p' - -} diff --git a/tests/modules/nf-core/fastk/fastk/test.yml b/tests/modules/nf-core/fastk/fastk/test.yml deleted file mode 100644 index fa075ca7f76..00000000000 --- a/tests/modules/nf-core/fastk/fastk/test.yml +++ /dev/null @@ -1,45 +0,0 @@ -- name: fastk fastk test_fastk_fastk_single_end - command: nextflow run ./tests/modules/nf-core/fastk/fastk -entry test_fastk_fastk_single_end -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/fastk/fastk/nextflow.config - tags: - - fastk - - fastk/fastk - files: - - path: output/fastk/.test_fk.ktab.1 - md5sum: ceeacd0cb3aa69bf9b2a402830b40e26 - - path: output/fastk/.test_fk.ktab.2 - md5sum: f2629fd15b285aed3dc2d5fe546edf3f - - path: output/fastk/.test_fk.pidx.1 - md5sum: 90bc384f61d2ecdb4586ab52ab04fddf - - path: output/fastk/.test_fk.prof.1 - md5sum: ebd48923a724cf79934f0b2ed42ba73d - - path: output/fastk/test_fk.hist - md5sum: c80e12f7321e62dba4b437d7bff36ec0 - - path: output/fastk/test_fk.ktab - md5sum: a605a58931a4b5029469e1c2575c8cee - - path: output/fastk/test_fk.prof - md5sum: 43d426c95d277b8148406624d513bd40 - -- name: fastk fastk test_fastk_fastk_paired_end - command: nextflow run ./tests/modules/nf-core/fastk/fastk -entry test_fastk_fastk_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/fastk/fastk/nextflow.config - tags: - - fastk - - fastk/fastk - files: - - path: output/fastk/.test_fk.ktab.1 - md5sum: 7f28fb44940fda799797e3069f5d7263 - - path: output/fastk/.test_fk.ktab.2 - md5sum: c14a85c128926ace78372f09029977b1 - - path: output/fastk/.test_fk.pidx.1 - md5sum: e7e760f714070a4afefb38ffff559684 - - path: output/fastk/.test_fk.pidx.2 - md5sum: a549612bbdba2506eb3311237638c4b0 - - path: output/fastk/.test_fk.prof.1 - md5sum: 46a5fd9e297262b058f8c1fd062fcf56 - - path: output/fastk/.test_fk.prof.2 - md5sum: 80326a7406f41ccf2e51e341fc804132 - - path: output/fastk/test_fk.hist - md5sum: 4f75b550d87ed4f26a2b10a05ac7e98c - - path: output/fastk/test_fk.ktab - md5sum: fddd5be0c36ad1d2131b8d8774f7657a - - path: output/fastk/test_fk.prof - md5sum: d3c7d8decd4ea6e298291b8be0e2de85 From 614abbf126f287a3068dc86997b2e1b6a93abe20 Mon Sep 17 00:00:00 2001 From: Jose Espinosa-Carrasco Date: Wed, 22 May 2024 11:54:29 +0200 Subject: [PATCH 08/24] Bump csvtk version to CSVTK/SPLIT and add nf-test (#5656) * Remove leftover of previous PR * Bump version 0.30.0 of csvtk * Ad nf-test for csvtk/split * Remove csvtk/split from pytest_modules.yml * Make lint happy * Update path on tests * Update modules/nf-core/csvtk/split/tests/main.nf.test * Update modules/nf-core/csvtk/split/tests/main.nf.test --- modules/nf-core/csvtk/join/tests/main.nf.test | 1 - modules/nf-core/csvtk/split/environment.yml | 2 +- modules/nf-core/csvtk/split/main.nf | 17 ++++- .../nf-core/csvtk/split/tests/main.nf.test | 62 ++++++++++++++++ .../csvtk/split/tests/main.nf.test.snap | 72 +++++++++++++++++++ .../nf-core/csvtk/split/tests/nextflow.config | 5 ++ modules/nf-core/csvtk/split/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 - 8 files changed, 157 insertions(+), 7 deletions(-) create mode 100644 modules/nf-core/csvtk/split/tests/main.nf.test create mode 100644 modules/nf-core/csvtk/split/tests/main.nf.test.snap create mode 100644 modules/nf-core/csvtk/split/tests/nextflow.config create mode 100644 modules/nf-core/csvtk/split/tests/tags.yml diff --git a/modules/nf-core/csvtk/join/tests/main.nf.test b/modules/nf-core/csvtk/join/tests/main.nf.test index ca885313476..3cf178c4f95 100644 --- a/modules/nf-core/csvtk/join/tests/main.nf.test +++ b/modules/nf-core/csvtk/join/tests/main.nf.test @@ -34,7 +34,6 @@ nextflow_process { } - // TODO nf-core: Change the test name preferably indicating the test-data and file-format used but keep the " - stub" suffix. test("join - csv - stub") { options "-stub" diff --git a/modules/nf-core/csvtk/split/environment.yml b/modules/nf-core/csvtk/split/environment.yml index 58d04d95c65..ec08bb43908 100644 --- a/modules/nf-core/csvtk/split/environment.yml +++ b/modules/nf-core/csvtk/split/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::csvtk=0.23.0 + - bioconda::csvtk=0.30.0 diff --git a/modules/nf-core/csvtk/split/main.nf b/modules/nf-core/csvtk/split/main.nf index cf17556c8bc..1b7d5dd157d 100644 --- a/modules/nf-core/csvtk/split/main.nf +++ b/modules/nf-core/csvtk/split/main.nf @@ -4,8 +4,8 @@ process CSVTK_SPLIT { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/csvtk:0.23.0--h9ee0642_0' : - 'biocontainers/csvtk:0.23.0--h9ee0642_0' }" + 'https://depot.galaxyproject.org/singularity/csvtk:0.30.0--h9ee0642_0' : + 'biocontainers/csvtk:0.30.0--h9ee0642_0' }" input: tuple val(meta), path(csv) @@ -40,4 +40,17 @@ process CSVTK_SPLIT { csvtk: \$(echo \$( csvtk version | sed -e 's/csvtk v//g' )) END_VERSIONS """ + + stub: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + out_extension = args.contains('--out-delimiter "\t"') || args.contains('-D "\t"') || args.contains("-D \$'\t'") ? "tsv" : "csv" + """ + touch ${prefix}.${out_extension} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + csvtk: \$(echo \$( csvtk version | sed -e "s/csvtk v//g" )) + END_VERSIONS + """ } diff --git a/modules/nf-core/csvtk/split/tests/main.nf.test b/modules/nf-core/csvtk/split/tests/main.nf.test new file mode 100644 index 00000000000..f3c49926677 --- /dev/null +++ b/modules/nf-core/csvtk/split/tests/main.nf.test @@ -0,0 +1,62 @@ +nextflow_process { + + name "Test Process CSVTK_SPLIT" + script "../main.nf" + process "CSVTK_SPLIT" + + tag "modules" + tag "modules_nfcore" + tag "csvtk" + tag "csvtk/split" + + test("split - csv") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ file(params.modules_testdata_base_path + '/generic/tsv/test.tsv', checkIfExists: true) ] + ] + input[1] = "tsv" + input[2] = "tsv" + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("split - csv - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ file(params.modules_testdata_base_path + '/generic/tsv/test.tsv', checkIfExists: true) ] + ] + input[1] = "tsv" + input[2] = "tsv" + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/csvtk/split/tests/main.nf.test.snap b/modules/nf-core/csvtk/split/tests/main.nf.test.snap new file mode 100644 index 00000000000..f0ec9def08e --- /dev/null +++ b/modules/nf-core/csvtk/split/tests/main.nf.test.snap @@ -0,0 +1,72 @@ +{ + "split - csv - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.csv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,b17a61b0c41b19f7df3740979d68a8a0" + ], + "split_csv": [ + [ + { + "id": "test" + }, + "test.csv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,b17a61b0c41b19f7df3740979d68a8a0" + ] + } + ], + "timestamp": "2024-05-22T10:02:46.053585" + }, + "split - csv": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "test-1.tsv:md5,2827284f1a6f41dd14ef82fb6a36ebad", + "test-11.tsv:md5,6c5555d689c4e685d35d6e394ad6e1e6", + "test-2.tsv:md5,589a2add7f0b8e998d4959e5d883e7d5", + "test-4.tsv:md5,e51cd0bfc35f5353d1fb75f723772ed0", + "test-NA.tsv:md5,20afd42832c6cf5821f9862d285c9350" + ] + ] + ], + "1": [ + "versions.yml:md5,b17a61b0c41b19f7df3740979d68a8a0" + ], + "split_csv": [ + [ + { + "id": "test" + }, + [ + "test-1.tsv:md5,2827284f1a6f41dd14ef82fb6a36ebad", + "test-11.tsv:md5,6c5555d689c4e685d35d6e394ad6e1e6", + "test-2.tsv:md5,589a2add7f0b8e998d4959e5d883e7d5", + "test-4.tsv:md5,e51cd0bfc35f5353d1fb75f723772ed0", + "test-NA.tsv:md5,20afd42832c6cf5821f9862d285c9350" + ] + ] + ], + "versions": [ + "versions.yml:md5,b17a61b0c41b19f7df3740979d68a8a0" + ] + } + ], + "timestamp": "2024-05-22T10:02:35.8578" + } +} \ No newline at end of file diff --git a/modules/nf-core/csvtk/split/tests/nextflow.config b/modules/nf-core/csvtk/split/tests/nextflow.config new file mode 100644 index 00000000000..8f5a6f7ee61 --- /dev/null +++ b/modules/nf-core/csvtk/split/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: CSVTK_SPLIT { + ext.args = "-C \'&\' --fields \'first_name\' " + } +} diff --git a/modules/nf-core/csvtk/split/tests/tags.yml b/modules/nf-core/csvtk/split/tests/tags.yml new file mode 100644 index 00000000000..0d7dc029d0c --- /dev/null +++ b/modules/nf-core/csvtk/split/tests/tags.yml @@ -0,0 +1,2 @@ +csvtk/split: + - "modules/nf-core/csvtk/split/**" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 1b07ecb3fac..0b5076ea033 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -365,9 +365,6 @@ crisprcleanr/normalize: crumble: - modules/nf-core/crumble/** - tests/modules/nf-core/crumble/** -csvtk/split: - - modules/nf-core/csvtk/split/** - - tests/modules/nf-core/csvtk/split/** custom/matrixfilter: - modules/nf-core/custom/matrixfilter/** - tests/modules/nf-core/custom/matrixfilter/** From 570c5d253837869fa0594972a2ec19ce205e5532 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Wed, 22 May 2024 10:39:54 -0400 Subject: [PATCH 09/24] Remove cp operation from bclconvert with Nextflow output operation (#5662) * Remove cp operation from bclconvert Replaces cp operation with native Nextflow output path handling. Fixes https://github.com/nf-core/modules/issues/5644 * Update modules/nf-core/bclconvert/main.nf --- modules/nf-core/bclconvert/main.nf | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/modules/nf-core/bclconvert/main.nf b/modules/nf-core/bclconvert/main.nf index 33a818170f6..8e6886dfc6f 100644 --- a/modules/nf-core/bclconvert/main.nf +++ b/modules/nf-core/bclconvert/main.nf @@ -8,14 +8,14 @@ process BCLCONVERT { tuple val(meta), path(samplesheet), path(run_dir) output: - tuple val(meta), path("**_S[1-9]*_R?_00?.fastq.gz") , emit: fastq - tuple val(meta), path("**_S[1-9]*_I?_00?.fastq.gz") , optional:true, emit: fastq_idx - tuple val(meta), path("**Undetermined_S0*_R?_00?.fastq.gz") , optional:true, emit: undetermined - tuple val(meta), path("**Undetermined_S0*_I?_00?.fastq.gz") , optional:true, emit: undetermined_idx - tuple val(meta), path("Reports") , emit: reports - tuple val(meta), path("Logs") , emit: logs - tuple val(meta), path("InterOp/*.bin") , emit: interop - path("versions.yml") , emit: versions + tuple val(meta), path("**_S[1-9]*_R?_00?.fastq.gz") , emit: fastq + tuple val(meta), path("**_S[1-9]*_I?_00?.fastq.gz") , optional:true, emit: fastq_idx + tuple val(meta), path("**Undetermined_S0*_R?_00?.fastq.gz") , optional:true, emit: undetermined + tuple val(meta), path("**Undetermined_S0*_I?_00?.fastq.gz") , optional:true, emit: undetermined_idx + tuple val(meta), path("Reports") , emit: reports + tuple val(meta), path("Logs") , emit: logs + tuple val(meta), path("**/InterOp/*.bin", includeInputs: true), emit: interop + path("versions.yml") , emit: versions when: task.ext.when == null || task.ext.when @@ -62,8 +62,6 @@ process BCLCONVERT { --bcl-input-directory ${input_dir} \\ --sample-sheet ${samplesheet} - cp -r ${input_dir}/InterOp . - cat <<-END_VERSIONS > versions.yml "${task.process}": bclconvert: \$(bcl-convert -V 2>&1 | head -n 1 | sed 's/^.*Version //') From 5d7b26a3f9ba799cdbfe4ef2648bd131799d4693 Mon Sep 17 00:00:00 2001 From: kokul-atx <99668099+kokul-atx@users.noreply.github.com> Date: Wed, 22 May 2024 11:28:36 -0400 Subject: [PATCH 10/24] 5643 new module viennarnarnafold (#5648) * working on the main.nf and meta.yml initially * working on the main.nf and meta.yml initially * Adding the updates to meta.yml * Adding the latest code changes that add a working version of the tests * Fixing the version mismatch in the docker and singularity containers * Removing the trailing whitespaces * Bump parabricks 4.3.0-1 + remove stageInMode (#5646) Parabricks doesn't require stageInMode to be 'copy' Signed-off-by: Marcel Ribeiro-Dantas * glimpse2 version bump - abandoned (#4236) * chore(deps): update biocontainers/glimpse-bio docker tag to v2.0.1 * Update main.nf * Update main.nf * Update main.nf * Update main.nf * Update main.nf * Update main.nf * Update main.nf * The channel was renamed in https://github.com/nf-core/modules/pull/5117 * The Conda yml files need to match the container definitions * Typo ! There was a missing s --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Louis LE NEZET <58640615+LouisLeNezet@users.noreply.github.com> Co-authored-by: Matthieu Muffato * Update pre-commit hook renovatebot/pre-commit-hooks to v37.371.1 (#5653) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Bump csvtk version to CSVTK/JOIN and add nf-test (#5642) * Bump csvtk new version * Add nf-test * Get rid of pytest * Bump version in singularity images * Update tests/config/pytest_modules.yml --------- Co-authored-by: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> * Added task.memory to meryl modules and .meryl ext for outputs (#5655) * Stub and nf-test for fastk/fastk (#5631) * Stub and nf-test for fastk/fastk * Added chmod +r to add read permissions for docker * Added a+r * Bump csvtk version to CSVTK/SPLIT and add nf-test (#5656) * Remove leftover of previous PR * Bump version 0.30.0 of csvtk * Ad nf-test for csvtk/split * Remove csvtk/split from pytest_modules.yml * Make lint happy * Update path on tests * Update modules/nf-core/csvtk/split/tests/main.nf.test * Update modules/nf-core/csvtk/split/tests/main.nf.test * Update modules/nf-core/viennarna/rnafold/tests/main.nf.test Co-authored-by: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> * Adding the corrected version of meta.yml file --------- Signed-off-by: Marcel Ribeiro-Dantas Co-authored-by: Marcel Ribeiro-Dantas Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Louis LE NEZET <58640615+LouisLeNezet@users.noreply.github.com> Co-authored-by: Matthieu Muffato Co-authored-by: Jose Espinosa-Carrasco Co-authored-by: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Co-authored-by: Usman Rashid --- .../nf-core/viennarna/rnafold/environment.yml | 9 ++++ modules/nf-core/viennarna/rnafold/main.nf | 48 +++++++++++++++++ modules/nf-core/viennarna/rnafold/meta.yml | 46 +++++++++++++++++ .../viennarna/rnafold/tests/main.nf.test | 51 +++++++++++++++++++ .../viennarna/rnafold/tests/main.nf.test.snap | 32 ++++++++++++ .../viennarna/rnafold/tests/nf-test.config | 5 ++ .../nf-core/viennarna/rnafold/tests/tags.yml | 2 + 7 files changed, 193 insertions(+) create mode 100644 modules/nf-core/viennarna/rnafold/environment.yml create mode 100644 modules/nf-core/viennarna/rnafold/main.nf create mode 100644 modules/nf-core/viennarna/rnafold/meta.yml create mode 100644 modules/nf-core/viennarna/rnafold/tests/main.nf.test create mode 100644 modules/nf-core/viennarna/rnafold/tests/main.nf.test.snap create mode 100644 modules/nf-core/viennarna/rnafold/tests/nf-test.config create mode 100644 modules/nf-core/viennarna/rnafold/tests/tags.yml diff --git a/modules/nf-core/viennarna/rnafold/environment.yml b/modules/nf-core/viennarna/rnafold/environment.yml new file mode 100644 index 00000000000..73b4fe2a2e4 --- /dev/null +++ b/modules/nf-core/viennarna/rnafold/environment.yml @@ -0,0 +1,9 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +name: "viennarna_rnafold" +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - "bioconda::viennarna=2.6.4" diff --git a/modules/nf-core/viennarna/rnafold/main.nf b/modules/nf-core/viennarna/rnafold/main.nf new file mode 100644 index 00000000000..ac6d9337e6d --- /dev/null +++ b/modules/nf-core/viennarna/rnafold/main.nf @@ -0,0 +1,48 @@ +process VIENNARNA_RNAFOLD { + tag '$rna_fastq' + label 'process_low' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/viennarna:2.6.4--py310pl5321h6cc9453_1': + 'biocontainers/viennarna:2.6.4--py310pl5321h6cc9453_1' }" + + input: + path fasta + + output: + path "*.fold" , emit: rnafold_txt + path "*.ps" , emit: rnafold_ps + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + """ + RNAfold \\ + ${args} \\ + --jobs=${task.cpus} \\ + --infile=$fasta \\ + --outfile=${fasta}.fold + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + RNAfold: \$( RNAfold --version |& sed '1!d ; s/RNAfold //') + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + + """ + touch ${fasta}.fold + touch ${fasta}.ps + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + RNAfold: \$( RNAfold --version |& sed '1!d ; s/RNAfold //') + END_VERSIONS + """ +} diff --git a/modules/nf-core/viennarna/rnafold/meta.yml b/modules/nf-core/viennarna/rnafold/meta.yml new file mode 100644 index 00000000000..0081b30a0b5 --- /dev/null +++ b/modules/nf-core/viennarna/rnafold/meta.yml @@ -0,0 +1,46 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "viennarna_rnafold" +description: Predict RNA secondary structure using the ViennaRNA RNAfold tools. Calculate minimum free energy secondary structures and partition function of RNAs. +keywords: + - RNA + - fasta + - rna_structure +tools: + - "viennarna": + description: | + Calculate minimum free energy secondary structures and partition function of RNAs + + The program reads RNA sequences, calculates their minimum free energy (mfe) structure and + prints the mfe structure in bracket notation and its free energy. If not specified differently + using commandline arguments, input is accepted from stdin or read from an input file, and + output printed to stdout. If the -p option was given it also computes the partition function + (pf) and base pairing probability matrix, and prints the free energy of the thermodynamic + ensemble, the frequency of the mfe structure in the ensemble, and the ensemble diversity to stdout. + homepage: "https://www.tbi.univie.ac.at/RNA/" + documentation: "https://viennarna.readthedocs.io/en/latest/" + doi: 10.1186/1748-7188-6-26 + licence: ["custom"] +input: + - fasta: + type: file + description: | + A fasta file containing RNA or transcript sequences + pattern: "*.{fasta,fa}" +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - rnafold_txt: + type: file + description: The text Output of RNAfold that + pattern: "*.{fold}" + - rnafold_ps: + type: file + description: The text Output of RNAfold that + pattern: "*.ss" +authors: + - "@kokul-atx" +maintainers: + - "@kokul-atx" diff --git a/modules/nf-core/viennarna/rnafold/tests/main.nf.test b/modules/nf-core/viennarna/rnafold/tests/main.nf.test new file mode 100644 index 00000000000..f3f4ef68589 --- /dev/null +++ b/modules/nf-core/viennarna/rnafold/tests/main.nf.test @@ -0,0 +1,51 @@ +nextflow_process { + + name "Test Process VIENNARNA_RNAFOLD" + script "../main.nf" + process "VIENNARNA_RNAFOLD" + + tag "modules" + tag "modules_nfcore" + tag "viennarna" + tag "viennarna/rnafold" + + test("rnafold - fasta") { + + when { + process { + """ + input[0] = file(params.test_data['homo_sapiens']['genome']['transcriptome_fasta'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.rnafold_txt, process.out.versions).match() } + ) + } + } + + test("rnafold - fasta - stub") { + + options "-stub" + + when { + process { + """ + input[0] = file(params.test_data['homo_sapiens']['genome']['transcriptome_fasta'], checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.rnafold_txt, process.out.versions).match('stub') } + ) + } + + } + +} diff --git a/modules/nf-core/viennarna/rnafold/tests/main.nf.test.snap b/modules/nf-core/viennarna/rnafold/tests/main.nf.test.snap new file mode 100644 index 00000000000..65535b8ef1d --- /dev/null +++ b/modules/nf-core/viennarna/rnafold/tests/main.nf.test.snap @@ -0,0 +1,32 @@ +{ + "stub": { + "content": [ + [ + "transcriptome.fasta.fold:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + "versions.yml:md5,76ca9d956465e05df59c27f000276284" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-22T09:28:37.785786414" + }, + "rnafold - fasta": { + "content": [ + [ + "transcriptome.fasta.fold:md5,5f8a62d2119ffa8ae0907917c772af02" + ], + [ + "versions.yml:md5,76ca9d956465e05df59c27f000276284" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-22T09:28:31.983790151" + } +} \ No newline at end of file diff --git a/modules/nf-core/viennarna/rnafold/tests/nf-test.config b/modules/nf-core/viennarna/rnafold/tests/nf-test.config new file mode 100644 index 00000000000..a58b8f42e3c --- /dev/null +++ b/modules/nf-core/viennarna/rnafold/tests/nf-test.config @@ -0,0 +1,5 @@ +process { + withName: 'VIENNARNA_RNAFOLD' { + ext.args = '--verbose --maxBPspan=30 -p0' + } +} diff --git a/modules/nf-core/viennarna/rnafold/tests/tags.yml b/modules/nf-core/viennarna/rnafold/tests/tags.yml new file mode 100644 index 00000000000..1bd0a86d8c6 --- /dev/null +++ b/modules/nf-core/viennarna/rnafold/tests/tags.yml @@ -0,0 +1,2 @@ +viennarna/rnafold: + - "modules/nf-core/viennarna/rnafold/**" From 50d3ed341b5fcb3495523c5bd6cc1e305a47cf41 Mon Sep 17 00:00:00 2001 From: Brenna Novotny <51127670+bnovotny@users.noreply.github.com> Date: Wed, 22 May 2024 12:12:20 -0400 Subject: [PATCH 11/24] Add nf-test to chromap/index (#5651) * Add nf-test to chromap/index * Updated snapshot and removed old tests * Fix chromap versions and add tags * [automated] Fix linting with Prettier * Check genome.index exists instead of match Co-authored-by: Jose Espinosa-Carrasco * snapshot fix * Updated snapshot * Add version to snapshot * Change version to versions in snapshot --------- Co-authored-by: nf-core-bot Co-authored-by: Jose Espinosa-Carrasco --- modules/nf-core/chromap/index/environment.yml | 2 +- modules/nf-core/chromap/index/main.nf | 2 +- .../nf-core/chromap/index/tests/main.nf.test | 31 +++++++++++++++++++ .../chromap/index/tests/main.nf.test.snap | 24 ++++++++++++++ modules/nf-core/chromap/index/tests/tags.yml | 2 ++ tests/config/pytest_modules.yml | 3 -- tests/modules/nf-core/chromap/index/main.nf | 15 --------- .../nf-core/chromap/index/nextflow.config | 5 --- tests/modules/nf-core/chromap/index/test.yml | 8 ----- 9 files changed, 59 insertions(+), 33 deletions(-) create mode 100644 modules/nf-core/chromap/index/tests/main.nf.test create mode 100644 modules/nf-core/chromap/index/tests/main.nf.test.snap create mode 100644 modules/nf-core/chromap/index/tests/tags.yml delete mode 100644 tests/modules/nf-core/chromap/index/main.nf delete mode 100644 tests/modules/nf-core/chromap/index/nextflow.config delete mode 100644 tests/modules/nf-core/chromap/index/test.yml diff --git a/modules/nf-core/chromap/index/environment.yml b/modules/nf-core/chromap/index/environment.yml index 4581d1f385d..602863ab594 100644 --- a/modules/nf-core/chromap/index/environment.yml +++ b/modules/nf-core/chromap/index/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::chromap=0.2.4 + - bioconda::chromap=0.2.5 diff --git a/modules/nf-core/chromap/index/main.nf b/modules/nf-core/chromap/index/main.nf index 3f0fe9a551e..43125bc3336 100644 --- a/modules/nf-core/chromap/index/main.nf +++ b/modules/nf-core/chromap/index/main.nf @@ -4,7 +4,7 @@ process CHROMAP_INDEX { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/chromap:0.2.4--hd03093a_0' : + 'https://depot.galaxyproject.org/singularity/chromap:0.2.5--hd03093a_0' : 'biocontainers/chromap:0.2.5--hd03093a_0' }" input: diff --git a/modules/nf-core/chromap/index/tests/main.nf.test b/modules/nf-core/chromap/index/tests/main.nf.test new file mode 100644 index 00000000000..b3661c1aa0c --- /dev/null +++ b/modules/nf-core/chromap/index/tests/main.nf.test @@ -0,0 +1,31 @@ +nextflow_process { + + name "Test Process CHROMAP_INDEX" + script "../main.nf" + process "CHROMAP_INDEX" + + tag "modules" + tag "modules_nfcore" + tag "chromap" + tag "chromap/index" + + test("test_chromap_idx") { + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions") }, + { assert snapshot(file(process.out.index[0][1]).name).match() } + ) + } + } +} diff --git a/modules/nf-core/chromap/index/tests/main.nf.test.snap b/modules/nf-core/chromap/index/tests/main.nf.test.snap new file mode 100644 index 00000000000..547caf01c25 --- /dev/null +++ b/modules/nf-core/chromap/index/tests/main.nf.test.snap @@ -0,0 +1,24 @@ +{ + "versions": { + "content": [ + [ + "versions.yml:md5,f808af347b4a6bdbaa9a0e7243354a94" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-05-22T10:47:29.768048005" + }, + "test_chromap_idx": { + "content": [ + "genome.index" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-05-22T10:25:37.494678917" + } +} \ No newline at end of file diff --git a/modules/nf-core/chromap/index/tests/tags.yml b/modules/nf-core/chromap/index/tests/tags.yml new file mode 100644 index 00000000000..360817cbcfd --- /dev/null +++ b/modules/nf-core/chromap/index/tests/tags.yml @@ -0,0 +1,2 @@ +chromap/index: + - modules/nf-core/chromap/index/** diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 0b5076ea033..4eb5f3d3f67 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -278,9 +278,6 @@ checkm/qa: chromap/chromap: - modules/nf-core/chromap/chromap/** - tests/modules/nf-core/chromap/chromap/** -chromap/index: - - modules/nf-core/chromap/index/** - - tests/modules/nf-core/chromap/index/** circexplorer2/annotate: - modules/nf-core/circexplorer2/annotate/** - tests/modules/nf-core/circexplorer2/annotate/** diff --git a/tests/modules/nf-core/chromap/index/main.nf b/tests/modules/nf-core/chromap/index/main.nf deleted file mode 100644 index a43c3df3285..00000000000 --- a/tests/modules/nf-core/chromap/index/main.nf +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { CHROMAP_INDEX } from '../../../../../modules/nf-core/chromap/index/main.nf' - -workflow test_chromap_index { - - input = [ - [ id:'test' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - - CHROMAP_INDEX ( input ) -} diff --git a/tests/modules/nf-core/chromap/index/nextflow.config b/tests/modules/nf-core/chromap/index/nextflow.config deleted file mode 100644 index 8730f1c4b93..00000000000 --- a/tests/modules/nf-core/chromap/index/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/chromap/index/test.yml b/tests/modules/nf-core/chromap/index/test.yml deleted file mode 100644 index e3de1391482..00000000000 --- a/tests/modules/nf-core/chromap/index/test.yml +++ /dev/null @@ -1,8 +0,0 @@ -- name: chromap index test_chromap_index - command: nextflow run ./tests/modules/nf-core/chromap/index -entry test_chromap_index -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/chromap/index/nextflow.config - tags: - - chromap/index - - chromap - files: - - path: output/chromap/genome.index - - path: output/chromap/versions.yml From 108e1f5bafc045ac19890852a41e8d95ae12aa67 Mon Sep 17 00:00:00 2001 From: KamilMaliszArdigen <32459801+KamilMaliszArdigen@users.noreply.github.com> Date: Wed, 22 May 2024 21:24:33 +0200 Subject: [PATCH 12/24] Added nf-test for gatk4/indexfeaturefile (#5669) * Added nf-test for gatk4/indexfeaturefile * Deleted pytest gatk4/indexfeaturefile tests --- .../gatk4/indexfeaturefile/tests/main.nf.test | 105 ++++++++++++++ .../indexfeaturefile/tests/main.nf.test.snap | 132 ++++++++++++++++++ .../gatk4/indexfeaturefile/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 - .../nf-core/gatk4/indexfeaturefile/main.nf | 45 ------ .../gatk4/indexfeaturefile/nextflow.config | 5 - .../nf-core/gatk4/indexfeaturefile/test.yml | 37 ----- 7 files changed, 239 insertions(+), 90 deletions(-) create mode 100644 modules/nf-core/gatk4/indexfeaturefile/tests/main.nf.test create mode 100644 modules/nf-core/gatk4/indexfeaturefile/tests/main.nf.test.snap create mode 100644 modules/nf-core/gatk4/indexfeaturefile/tests/tags.yml delete mode 100644 tests/modules/nf-core/gatk4/indexfeaturefile/main.nf delete mode 100644 tests/modules/nf-core/gatk4/indexfeaturefile/nextflow.config delete mode 100644 tests/modules/nf-core/gatk4/indexfeaturefile/test.yml diff --git a/modules/nf-core/gatk4/indexfeaturefile/tests/main.nf.test b/modules/nf-core/gatk4/indexfeaturefile/tests/main.nf.test new file mode 100644 index 00000000000..ee99a541a2c --- /dev/null +++ b/modules/nf-core/gatk4/indexfeaturefile/tests/main.nf.test @@ -0,0 +1,105 @@ +// nf-core modules test gatk4/indexfeaturefile +nextflow_process { + + name "Test Process GATK4_INDEXFEATUREFILE" + script "../main.nf" + process "GATK4_INDEXFEATUREFILE" + + tag "modules" + tag "modules_nfcore" + tag "gatk4" + tag "gatk4/indexfeaturefile" + + test("test_gatk4_indexfeaturefile_bed") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match() }, + { assert snapshot(file(process.out.index.get(0).get(1)).name).match("geneome.bed.idx") }, + ) + } + + } + + test("test_gatk4_indexfeaturefile_bed_gz") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['genome']['genome_bed_gz'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert snapshot(file(process.out.index.get(0).get(1)).name).match("genome.bed.gz.tbi") }, + ) + } + + } + + test("test_gatk4_indexfeaturefile_vcf") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match() }, + { assert snapshot(file(process.out.index.get(0).get(1)).name).match("test.genome.vcf.idx") }, + ) + } + + } + + test("test_gatk4_indexfeaturefile_vcf_gz") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert snapshot(file(process.out.index.get(0).get(1)).name).match("test.genome.vcf.gz.tbi") }, + ) + } + + } + +} diff --git a/modules/nf-core/gatk4/indexfeaturefile/tests/main.nf.test.snap b/modules/nf-core/gatk4/indexfeaturefile/tests/main.nf.test.snap new file mode 100644 index 00000000000..fc19333634f --- /dev/null +++ b/modules/nf-core/gatk4/indexfeaturefile/tests/main.nf.test.snap @@ -0,0 +1,132 @@ +{ + "genome.bed.gz.tbi": { + "content": [ + "genome.bed.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-05-22T18:57:03.068725" + }, + "test_gatk4_indexfeaturefile_vcf": { + "content": [ + [ + "versions.yml:md5,e01e4575236d930ace929eec9c4c80dd" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-05-22T18:57:20.602472" + }, + "geneome.bed.idx": { + "content": [ + "genome.bed.idx" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-05-22T18:56:46.988441" + }, + "test.genome.vcf.gz.tbi": { + "content": [ + "test.genome.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-05-22T18:57:51.898472" + }, + "test_gatk4_indexfeaturefile_bed_gz": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "genome.bed.gz.tbi:md5,4bc51e2351a6e83f20e13be75861f941" + ] + ], + "1": [ + "versions.yml:md5,e01e4575236d930ace929eec9c4c80dd" + ], + "index": [ + [ + { + "id": "test" + }, + "genome.bed.gz.tbi:md5,4bc51e2351a6e83f20e13be75861f941" + ] + ], + "versions": [ + "versions.yml:md5,e01e4575236d930ace929eec9c4c80dd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-05-22T18:57:03.058351" + }, + "test_gatk4_indexfeaturefile_vcf_gz": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.genome.vcf.gz.tbi:md5,fedd68eaddf8d31257853d9da8325bd3" + ] + ], + "1": [ + "versions.yml:md5,e01e4575236d930ace929eec9c4c80dd" + ], + "index": [ + [ + { + "id": "test" + }, + "test.genome.vcf.gz.tbi:md5,fedd68eaddf8d31257853d9da8325bd3" + ] + ], + "versions": [ + "versions.yml:md5,e01e4575236d930ace929eec9c4c80dd" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-05-22T18:57:51.861697" + }, + "test.genome.vcf.idx": { + "content": [ + "test.genome.vcf.idx" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-05-22T18:57:20.624337" + }, + "test_gatk4_indexfeaturefile_bed": { + "content": [ + [ + "versions.yml:md5,e01e4575236d930ace929eec9c4c80dd" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-05-22T18:56:46.885162" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4/indexfeaturefile/tests/tags.yml b/modules/nf-core/gatk4/indexfeaturefile/tests/tags.yml new file mode 100644 index 00000000000..041bd3d392d --- /dev/null +++ b/modules/nf-core/gatk4/indexfeaturefile/tests/tags.yml @@ -0,0 +1,2 @@ +gatk4/indexfeaturefile: + - "modules/nf-core/gatk4/indexfeaturefile/**" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 4eb5f3d3f67..db363aad44d 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -615,9 +615,6 @@ gatk4/genotypegvcfs: gatk4/germlinecnvcaller: - modules/nf-core/gatk4/germlinecnvcaller/** - tests/modules/nf-core/gatk4/germlinecnvcaller/** -gatk4/indexfeaturefile: - - modules/nf-core/gatk4/indexfeaturefile/** - - tests/modules/nf-core/gatk4/indexfeaturefile/** gatk4/intervallisttobed: - modules/nf-core/gatk4/intervallisttobed/** - tests/modules/nf-core/gatk4/intervallisttobed/** diff --git a/tests/modules/nf-core/gatk4/indexfeaturefile/main.nf b/tests/modules/nf-core/gatk4/indexfeaturefile/main.nf deleted file mode 100644 index 15c88cb38bb..00000000000 --- a/tests/modules/nf-core/gatk4/indexfeaturefile/main.nf +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { GATK4_INDEXFEATUREFILE } from '../../../../../modules/nf-core/gatk4/indexfeaturefile/main.nf' - -workflow test_gatk4_indexfeaturefile_bed { - - input = [ - [ id:'test' ], // meta map - file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) - ] - - GATK4_INDEXFEATUREFILE ( input ) -} - -workflow test_gatk4_indexfeaturefile_bed_gz { - - input = [ - [ id:'test' ], // meta map - file(params.test_data['homo_sapiens']['genome']['genome_bed_gz'], checkIfExists: true) - ] - - GATK4_INDEXFEATUREFILE ( input ) -} - -workflow test_gatk4_indexfeaturefile_vcf { - - input = [ - [ id:'test' ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf'], checkIfExists: true) - ] - - GATK4_INDEXFEATUREFILE ( input ) -} - -workflow test_gatk4_indexfeaturefile_vcf_gz { - - input = [ - [ id:'test' ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true) - ] - - GATK4_INDEXFEATUREFILE ( input ) -} diff --git a/tests/modules/nf-core/gatk4/indexfeaturefile/nextflow.config b/tests/modules/nf-core/gatk4/indexfeaturefile/nextflow.config deleted file mode 100644 index 8730f1c4b93..00000000000 --- a/tests/modules/nf-core/gatk4/indexfeaturefile/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/indexfeaturefile/test.yml b/tests/modules/nf-core/gatk4/indexfeaturefile/test.yml deleted file mode 100644 index 3e7483a2e6d..00000000000 --- a/tests/modules/nf-core/gatk4/indexfeaturefile/test.yml +++ /dev/null @@ -1,37 +0,0 @@ -- name: gatk4 indexfeaturefile test_gatk4_indexfeaturefile_bed - command: nextflow run ./tests/modules/nf-core/gatk4/indexfeaturefile -entry test_gatk4_indexfeaturefile_bed -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/gatk4/indexfeaturefile/nextflow.config - tags: - - gatk4 - - gatk4/indexfeaturefile - files: - - path: output/gatk4/genome.bed.idx - - path: output/gatk4/versions.yml - -- name: gatk4 indexfeaturefile test_gatk4_indexfeaturefile_bed_gz - command: nextflow run ./tests/modules/nf-core/gatk4/indexfeaturefile -entry test_gatk4_indexfeaturefile_bed_gz -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/gatk4/indexfeaturefile/nextflow.config - tags: - - gatk4 - - gatk4/indexfeaturefile - files: - - path: output/gatk4/genome.bed.gz.tbi - md5sum: 4bc51e2351a6e83f20e13be75861f941 - - path: output/gatk4/versions.yml - -- name: gatk4 indexfeaturefile test_gatk4_indexfeaturefile_vcf - command: nextflow run ./tests/modules/nf-core/gatk4/indexfeaturefile -entry test_gatk4_indexfeaturefile_vcf -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/gatk4/indexfeaturefile/nextflow.config - tags: - - gatk4 - - gatk4/indexfeaturefile - files: - - path: output/gatk4/test.genome.vcf.idx - - path: output/gatk4/versions.yml - -- name: gatk4 indexfeaturefile test_gatk4_indexfeaturefile_vcf_gz - command: nextflow run ./tests/modules/nf-core/gatk4/indexfeaturefile -entry test_gatk4_indexfeaturefile_vcf_gz -c ./tests/config/nextflow.config - tags: - - gatk4 - - gatk4/indexfeaturefile - files: - - path: output/gatk4/test.genome.vcf.gz.tbi - md5sum: fedd68eaddf8d31257853d9da8325bd3 - - path: output/gatk4/versions.yml From 939dbcd8ea0c341febc6219c23a27c5e3db489a8 Mon Sep 17 00:00:00 2001 From: James Kaptuch <152308467+jkartuch@users.noreply.github.com> Date: Wed, 22 May 2024 16:03:32 -0400 Subject: [PATCH 13/24] Add nf-tests to nf-core/modules salsa2 (#5666) * Add tests for Salsa * Update test file * Delete unused test file * Resolve linting error * Remove unused params section * Update modules/nf-core/salsa2/tests/main.nf.test Co-authored-by: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com> * Use snapshot and match methods * Update snapeshot, compare files * Remove pytests --------- Co-authored-by: James Kaptuch Co-authored-by: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com> --- modules/nf-core/salsa2/meta.yml | 2 +- modules/nf-core/salsa2/tests/main.nf.test | 39 +++++++++++++++++++ .../nf-core/salsa2/tests/main.nf.test.snap | 38 ++++++++++++++++++ modules/nf-core/salsa2/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 -- tests/modules/nf-core/salsa2/main.nf | 17 -------- tests/modules/nf-core/salsa2/nextflow.config | 5 --- tests/modules/nf-core/salsa2/test.yml | 9 ----- 8 files changed, 80 insertions(+), 35 deletions(-) create mode 100644 modules/nf-core/salsa2/tests/main.nf.test create mode 100644 modules/nf-core/salsa2/tests/main.nf.test.snap create mode 100644 modules/nf-core/salsa2/tests/tags.yml delete mode 100644 tests/modules/nf-core/salsa2/main.nf delete mode 100644 tests/modules/nf-core/salsa2/nextflow.config delete mode 100644 tests/modules/nf-core/salsa2/test.yml diff --git a/modules/nf-core/salsa2/meta.yml b/modules/nf-core/salsa2/meta.yml index e9ba0efe739..8729ce06443 100644 --- a/modules/nf-core/salsa2/meta.yml +++ b/modules/nf-core/salsa2/meta.yml @@ -14,7 +14,7 @@ tools: documentation: "https://github.com/marbl/SALSA" tool_dev_url: "https://github.com/marbl/SALSA" doi: "10.1186/s12864-017-3879-z" - licence: "['MIT']" + licence: ["MIT"] input: - meta: type: map diff --git a/modules/nf-core/salsa2/tests/main.nf.test b/modules/nf-core/salsa2/tests/main.nf.test new file mode 100644 index 00000000000..c1149e10aa6 --- /dev/null +++ b/modules/nf-core/salsa2/tests/main.nf.test @@ -0,0 +1,39 @@ +nextflow_process { + + name "Test Process SALSA2" + script "../main.nf" + process "SALSA2" + tag "modules" + tag "modules_nfcore" + tag "salsa2" + + test("Single-Read") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end: false ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) + ] + input[1] = [ + file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + ] + input[2] = [] + input[3] = [] + input[4] = [] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out.fasta).match("fasta") }, + { assert snapshot(process.out.agp).match("agp") }, + { assert snapshot(process.out.versions).match("versions") } + ) + } + } +} diff --git a/modules/nf-core/salsa2/tests/main.nf.test.snap b/modules/nf-core/salsa2/tests/main.nf.test.snap new file mode 100644 index 00000000000..94456c4c8eb --- /dev/null +++ b/modules/nf-core/salsa2/tests/main.nf.test.snap @@ -0,0 +1,38 @@ +{ + "versions": { + "content": [ + [ + "versions.yml:md5,5985e59c635903ae7725afa4f5368de7" + ] + ], + "timestamp": "2024-05-22T19:35:47.254995" + }, + "agp": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_scaffolds_FINAL.agp:md5,03fe8c559b80730aab465697a6b0e01c" + ] + ] + ], + "timestamp": "2024-05-22T19:34:18.646515" + }, + "fasta": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_scaffolds_FINAL.fasta:md5,32c805e9e447ad47d6437e10f91bd5bf" + ] + ] + ], + "timestamp": "2024-05-22T19:35:47.240011" + } +} \ No newline at end of file diff --git a/modules/nf-core/salsa2/tests/tags.yml b/modules/nf-core/salsa2/tests/tags.yml new file mode 100644 index 00000000000..6c096d6dba3 --- /dev/null +++ b/modules/nf-core/salsa2/tests/tags.yml @@ -0,0 +1,2 @@ +salsa2: + - modules/nf-core/salsa2/** diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index db363aad44d..c237ed4a13d 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1524,9 +1524,6 @@ rtgtools/pedfilter: rtgtools/vcfeval: - modules/nf-core/rtgtools/vcfeval/** - tests/modules/nf-core/rtgtools/vcfeval/** -salsa2: - - modules/nf-core/salsa2/** - - tests/modules/nf-core/salsa2/** sam2lca/analyze: - modules/nf-core/sam2lca/analyze/** - tests/modules/nf-core/sam2lca/analyze/** diff --git a/tests/modules/nf-core/salsa2/main.nf b/tests/modules/nf-core/salsa2/main.nf deleted file mode 100644 index bd4996ded31..00000000000 --- a/tests/modules/nf-core/salsa2/main.nf +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { SALSA2 } from '../../../../modules/nf-core/salsa2/main.nf' - -workflow test_salsa2 { - - input = [ - [ id:'test', single_end: false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true), - file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) - ] - bed = file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) - - SALSA2 ( input, bed, [], [], [] ) -} diff --git a/tests/modules/nf-core/salsa2/nextflow.config b/tests/modules/nf-core/salsa2/nextflow.config deleted file mode 100644 index 8730f1c4b93..00000000000 --- a/tests/modules/nf-core/salsa2/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/salsa2/test.yml b/tests/modules/nf-core/salsa2/test.yml deleted file mode 100644 index f404bb9d3f8..00000000000 --- a/tests/modules/nf-core/salsa2/test.yml +++ /dev/null @@ -1,9 +0,0 @@ -- name: salsa2 test_salsa2 - command: nextflow run ./tests/modules/nf-core/salsa2 -entry test_salsa2 -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/salsa2/nextflow.config - tags: - - salsa2 - files: - - path: output/salsa2/test_scaffolds_FINAL.agp - md5sum: 03fe8c559b80730aab465697a6b0e01c - - path: output/salsa2/test_scaffolds_FINAL.fasta - md5sum: 32c805e9e447ad47d6437e10f91bd5bf From f147c229643ce919cbc29584554b7aa065ccef97 Mon Sep 17 00:00:00 2001 From: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com> Date: Wed, 22 May 2024 16:22:44 -0400 Subject: [PATCH 14/24] biscuit/align nf-test and snapshot (#4460) * biscuit/align nf-test and snapshot * Update modules/nf-core/biscuit/align/tests/main.nf.test * remove bam from snapshots * remove bam,bai from snapshots --------- Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com> --- .../nf-core/biscuit/align/tests/main.nf.test | 72 +++++++++++++++++++ .../biscuit/align/tests/main.nf.test.snap | 26 +++++++ modules/nf-core/biscuit/align/tests/tags.yml | 3 + tests/config/pytest_modules.yml | 4 -- tests/modules/nf-core/biscuit/align/main.nf | 33 --------- .../nf-core/biscuit/align/nextflow.config | 5 -- tests/modules/nf-core/biscuit/align/test.yml | 55 -------------- 7 files changed, 101 insertions(+), 97 deletions(-) create mode 100644 modules/nf-core/biscuit/align/tests/main.nf.test create mode 100644 modules/nf-core/biscuit/align/tests/main.nf.test.snap create mode 100644 modules/nf-core/biscuit/align/tests/tags.yml delete mode 100644 tests/modules/nf-core/biscuit/align/main.nf delete mode 100644 tests/modules/nf-core/biscuit/align/nextflow.config delete mode 100644 tests/modules/nf-core/biscuit/align/test.yml diff --git a/modules/nf-core/biscuit/align/tests/main.nf.test b/modules/nf-core/biscuit/align/tests/main.nf.test new file mode 100644 index 00000000000..e7b68171b1f --- /dev/null +++ b/modules/nf-core/biscuit/align/tests/main.nf.test @@ -0,0 +1,72 @@ +nextflow_process { + + name "Test Process BISCUIT_ALIGN" + script "../main.nf" + process "BISCUIT_ALIGN" + + tag "modules" + tag "modules_nfcore" + tag "biscuit" + tag "biscuit/align" + tag "biscuit/index" + + setup { + run("BISCUIT_INDEX") { + script "../../index/main.nf" + process { + """ + input[0] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + """ + } + } + } + + test("Single-End sarscov2 test_methylated_1 [fastq_gz]") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_methylated_1_fastq_gz'], checkIfExists: true) ] + ] + input[1] = BISCUIT_INDEX.out.index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert file(process.out.bam[0][1]).name == "test.bam" }, + { assert file(process.out.bai[0][1]).name == "test.bam.bai" }, + { assert snapshot(process.out.versions).match("single-end-versions") } + ) + } + } + + test("Paired-End sarscov2 test_methylated_1 [fastq_gz]") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_methylated_1_fastq_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_methylated_2_fastq_gz'], checkIfExists: true) ] + ] + input[1] = BISCUIT_INDEX.out.index + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert file(process.out.bam[0][1]).name == "test.bam" }, + { assert file(process.out.bai[0][1]).name == "test.bam.bai" }, + { assert snapshot(process.out.versions).match("paired-end-versions") } + ) + } + } +} diff --git a/modules/nf-core/biscuit/align/tests/main.nf.test.snap b/modules/nf-core/biscuit/align/tests/main.nf.test.snap new file mode 100644 index 00000000000..5776f87c62f --- /dev/null +++ b/modules/nf-core/biscuit/align/tests/main.nf.test.snap @@ -0,0 +1,26 @@ +{ + "single-end-versions": { + "content": [ + [ + "versions.yml:md5,0b2a8c4c438a785a890110a458399bfd" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.1" + }, + "timestamp": "2024-05-22T20:06:02.295706212" + }, + "paired-end-versions": { + "content": [ + [ + "versions.yml:md5,0b2a8c4c438a785a890110a458399bfd" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.1" + }, + "timestamp": "2024-05-22T20:06:17.879689395" + } +} \ No newline at end of file diff --git a/modules/nf-core/biscuit/align/tests/tags.yml b/modules/nf-core/biscuit/align/tests/tags.yml new file mode 100644 index 00000000000..d73b8183f7f --- /dev/null +++ b/modules/nf-core/biscuit/align/tests/tags.yml @@ -0,0 +1,3 @@ +biscuit/align: + - modules/nf-core/biscuit/index/** + - modules/nf-core/biscuit/align/** diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index c237ed4a13d..1048d6324db 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -184,10 +184,6 @@ biobambam/bamsormadup: biohansel: - modules/nf-core/biohansel/** - tests/modules/nf-core/biohansel/** -biscuit/align: - - modules/nf-core/biscuit/index/** - - modules/nf-core/biscuit/align/** - - tests/modules/nf-core/biscuit/align/** biscuit/biscuitblaster: - modules/nf-core/biscuit/index/** - modules/nf-core/biscuit/biscuitblaster/** diff --git a/tests/modules/nf-core/biscuit/align/main.nf b/tests/modules/nf-core/biscuit/align/main.nf deleted file mode 100644 index 00fe14d6bb8..00000000000 --- a/tests/modules/nf-core/biscuit/align/main.nf +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { BISCUIT_INDEX } from '../../../../../modules/nf-core/biscuit/index/main.nf' -include { BISCUIT_ALIGN as BISCUIT_ALIGN_SE } from '../../../../../modules/nf-core/biscuit/align/main.nf' -include { BISCUIT_ALIGN as BISCUIT_ALIGN_PE } from '../../../../../modules/nf-core/biscuit/align/main.nf' - - -// Single-end test -workflow test_biscuit_align_single { - - input = [ [ id:'test' ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_methylated_1_fastq_gz'], checkIfExists: true) ] - ] - fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - - BISCUIT_INDEX ( fasta ) - BISCUIT_ALIGN_SE (input, BISCUIT_INDEX.out.index ) -} - -// paired-end test -workflow test_biscuit_align_paired { - - input = [ [ id:'test' ], // meta map - [ file(params.test_data['sarscov2']['illumina']['test_methylated_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_methylated_2_fastq_gz'], checkIfExists: true) ] - ] - fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - - BISCUIT_INDEX ( fasta ) - BISCUIT_ALIGN_SE (input, BISCUIT_INDEX.out.index ) -} diff --git a/tests/modules/nf-core/biscuit/align/nextflow.config b/tests/modules/nf-core/biscuit/align/nextflow.config deleted file mode 100644 index 8730f1c4b93..00000000000 --- a/tests/modules/nf-core/biscuit/align/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/biscuit/align/test.yml b/tests/modules/nf-core/biscuit/align/test.yml deleted file mode 100644 index 72708595c8c..00000000000 --- a/tests/modules/nf-core/biscuit/align/test.yml +++ /dev/null @@ -1,55 +0,0 @@ -- name: biscuit align test_biscuit_align_single - command: nextflow run ./tests/modules/nf-core/biscuit/align -entry test_biscuit_align_single -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/biscuit/align/nextflow.config - tags: - - biscuit/align - - biscuit - files: - - path: output/biscuit/BiscuitIndex/genome.fasta - md5sum: 6e9fe4042a72f2345f644f239272b7e6 - - path: output/biscuit/BiscuitIndex/genome.fasta.bis.amb - md5sum: 3a68b8b2287e07dd3f5f95f4344ba76e - - path: output/biscuit/BiscuitIndex/genome.fasta.bis.ann - md5sum: c32e11f6c859f166c7525a9c1d583567 - - path: output/biscuit/BiscuitIndex/genome.fasta.bis.pac - md5sum: 983e3d2cd6f36e2546e6d25a0da78d66 - - path: output/biscuit/BiscuitIndex/genome.fasta.dau.bwt - md5sum: a11bc31775f7b7a4f9cd3bc4f981661a - - path: output/biscuit/BiscuitIndex/genome.fasta.dau.sa - md5sum: 9c9e07fa1c75ef32d764274579c89b08 - - path: output/biscuit/BiscuitIndex/genome.fasta.par.bwt - md5sum: 62eb83cd557a47b59589713d98024fc2 - - path: output/biscuit/BiscuitIndex/genome.fasta.par.sa - md5sum: 55bcd97d7059bf73dc0d221e36e8e901 - - path: output/biscuit/test.bam - md5sum: 001250f6e785711a7775ac4a40e0b4d0 - - path: output/biscuit/test.bam.bai - md5sum: 60fe784bc6d396d1c1eecc81485c24df - - path: output/biscuit/versions.yml - -- name: biscuit align test_biscuit_align_paired - command: nextflow run ./tests/modules/nf-core/biscuit/align -entry test_biscuit_align_paired -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/biscuit/align/nextflow.config - tags: - - biscuit/align - - biscuit - files: - - path: output/biscuit/BiscuitIndex/genome.fasta - md5sum: 6e9fe4042a72f2345f644f239272b7e6 - - path: output/biscuit/BiscuitIndex/genome.fasta.bis.amb - md5sum: 3a68b8b2287e07dd3f5f95f4344ba76e - - path: output/biscuit/BiscuitIndex/genome.fasta.bis.ann - md5sum: c32e11f6c859f166c7525a9c1d583567 - - path: output/biscuit/BiscuitIndex/genome.fasta.bis.pac - md5sum: 983e3d2cd6f36e2546e6d25a0da78d66 - - path: output/biscuit/BiscuitIndex/genome.fasta.dau.bwt - md5sum: a11bc31775f7b7a4f9cd3bc4f981661a - - path: output/biscuit/BiscuitIndex/genome.fasta.dau.sa - md5sum: 9c9e07fa1c75ef32d764274579c89b08 - - path: output/biscuit/BiscuitIndex/genome.fasta.par.bwt - md5sum: 62eb83cd557a47b59589713d98024fc2 - - path: output/biscuit/BiscuitIndex/genome.fasta.par.sa - md5sum: 55bcd97d7059bf73dc0d221e36e8e901 - - path: output/biscuit/test.bam - md5sum: a915916a15f2f2642b64ab2ae2b851e5 - - path: output/biscuit/test.bam.bai - md5sum: 9c9669e0bd8017d82ecb65c0a96ff457 - - path: output/biscuit/versions.yml From d15228f0778b131f0f75bc1ed582debb1bfd6b37 Mon Sep 17 00:00:00 2001 From: kokul-atx <99668099+kokul-atx@users.noreply.github.com> Date: Wed, 22 May 2024 16:28:08 -0400 Subject: [PATCH 15/24] 5667 new module viennarnarnacofold (#5674) * Adding the partially working version of RNAcofold code * Adding the rnacofold tests and main * Removing comments from the env.yml file * Update modules/nf-core/viennarna/rnacofold/main.nf Co-authored-by: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> * Update modules/nf-core/viennarna/rnacofold/tests/main.nf.test Co-authored-by: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> * Adding the meta to track sample information --------- Co-authored-by: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> --- .../viennarna/rnacofold/environment.yml | 7 ++ modules/nf-core/viennarna/rnacofold/main.nf | 46 +++++++++++++ modules/nf-core/viennarna/rnacofold/meta.yml | 68 +++++++++++++++++++ .../viennarna/rnacofold/tests/main.nf.test | 58 ++++++++++++++++ .../rnacofold/tests/main.nf.test.snap | 42 ++++++++++++ .../viennarna/rnacofold/tests/tags.yml | 2 + 6 files changed, 223 insertions(+) create mode 100644 modules/nf-core/viennarna/rnacofold/environment.yml create mode 100644 modules/nf-core/viennarna/rnacofold/main.nf create mode 100644 modules/nf-core/viennarna/rnacofold/meta.yml create mode 100644 modules/nf-core/viennarna/rnacofold/tests/main.nf.test create mode 100644 modules/nf-core/viennarna/rnacofold/tests/main.nf.test.snap create mode 100644 modules/nf-core/viennarna/rnacofold/tests/tags.yml diff --git a/modules/nf-core/viennarna/rnacofold/environment.yml b/modules/nf-core/viennarna/rnacofold/environment.yml new file mode 100644 index 00000000000..25e241a857e --- /dev/null +++ b/modules/nf-core/viennarna/rnacofold/environment.yml @@ -0,0 +1,7 @@ +name: "viennarna_rnacofold" +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - "bioconda::viennarna=2.6.4" diff --git a/modules/nf-core/viennarna/rnacofold/main.nf b/modules/nf-core/viennarna/rnacofold/main.nf new file mode 100644 index 00000000000..4cfe045cd4e --- /dev/null +++ b/modules/nf-core/viennarna/rnacofold/main.nf @@ -0,0 +1,46 @@ +process VIENNARNA_RNACOFOLD { + tag "$rnacofold_fasta" + label 'process_low' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/viennarna:2.6.4--py310pl5321h6cc9453_1': + 'biocontainers/viennarna:2.6.4--py310pl5321h6cc9453_1' }" + + input: + tuple val(meta), path(rnacofold_fasta) + + output: + tuple val(meta), path("*.csv") , emit: rnacofold_csv + tuple val(meta), path("*.ps") , emit: rnacofold_ps + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + """ + RNAcofold < ${rnacofold_fasta} \\ + --jobs=${task.cpus} \\ + --output-format="D" \\ + > ${rnacofold_fasta.baseName}.csv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + RNAcofold: \$( RNAcofold --version |& sed '1!d ; s/RNAcofold //') + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + """ + touch ${rnacofold_fasta.baseName}.csv + touch ${rnacofold_fasta.baseName}.ps + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + RNAcofold: \$( RNAcofold --version |& sed '1!d ; s/RNAcofold //') + END_VERSIONS + """ +} diff --git a/modules/nf-core/viennarna/rnacofold/meta.yml b/modules/nf-core/viennarna/rnacofold/meta.yml new file mode 100644 index 00000000000..fa68573698e --- /dev/null +++ b/modules/nf-core/viennarna/rnacofold/meta.yml @@ -0,0 +1,68 @@ +name: "viennarna_rnacofold" +description: calculate secondary structures of two RNAs with dimerization +keywords: + - RNA + - fasta + - rna_structure +tools: + - "viennarna": + description: | + calculate secondary structures of two RNAs with dimerization + + The program works much like RNAfold, but allows one to specify two RNA + sequences which are then allowed to form a dimer structure. RNA sequences + are read from stdin in the usual format, i.e. each line of input + corresponds to one sequence, except for lines starting with > which + contain the name of the next sequence. To compute the hybrid structure + of two molecules, the two sequences must be concatenated using the & + character as separator. RNAcofold can compute minimum free energy (mfe) + structures, as well as partition function (pf) and base pairing + probability matrix (using the -p switch) Since dimer formation is + concentration dependent, RNAcofold can be used to compute equilibrium + concentrations for all five monomer and (homo/hetero)-dimer species, + given input concentrations for the monomers. Output consists of the + mfe structure in bracket notation as well as PostScript structure + plots and “dot plot” files containing the pair probabilities, see + the RNAfold man page for details. In the dot plots a cross marks + the chain break between the two concatenated sequences. The program + will continue to read new sequences until a line consisting of the + single character @ or an end of file condition is encountered. + homepage: "https://www.tbi.univie.ac.at/RNA/" + documentation: "https://viennarna.readthedocs.io/en/latest/" + doi: 10.1186/1748-7188-6-26 + licence: ["custom"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - rnacofold_fasta: + type: file + description: | + A fasta file containing RNA or transcript sequences + pattern: "*.{fasta,fa}" +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - rnacofold_csv: + type: file + description: The CSV Output of RNAcofold that has the predicted structure and energies + pattern: "*.{csv}" + - rnacofold_ps: + type: file + description: The text Output of RNAfold that contains the predicted secondary structure in postscript format + pattern: "*.{ps}" + +authors: + - "@kokul-atx" +maintainers: + - "@kokul-atx" diff --git a/modules/nf-core/viennarna/rnacofold/tests/main.nf.test b/modules/nf-core/viennarna/rnacofold/tests/main.nf.test new file mode 100644 index 00000000000..305018b0ba3 --- /dev/null +++ b/modules/nf-core/viennarna/rnacofold/tests/main.nf.test @@ -0,0 +1,58 @@ +nextflow_process { + + name "Test Process VIENNARNA_RNACOFOLD" + script "../main.nf" + process "VIENNARNA_RNACOFOLD" + + tag "modules" + tag "modules_nfcore" + tag "viennarna" + tag "viennarna/rnacofold" + + test("rnacofold - fasta") { + + when { + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + 'delete_me/viennarna/rnacofold/test.fa', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.rnacofold_csv, process.out.versions).match() } + ) + } + + } + + test("rnacofold - fasta - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + 'delete_me/viennarna/rnacofold/test.fa', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.rnacofold_csv, process.out.versions).match() } + ) + } + + } + +} diff --git a/modules/nf-core/viennarna/rnacofold/tests/main.nf.test.snap b/modules/nf-core/viennarna/rnacofold/tests/main.nf.test.snap new file mode 100644 index 00000000000..6e3aca25a48 --- /dev/null +++ b/modules/nf-core/viennarna/rnacofold/tests/main.nf.test.snap @@ -0,0 +1,42 @@ +{ + "rnacofold - fasta - stub": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.csv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + [ + "versions.yml:md5,75df9534a7774af48e08daa575a1e3af" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-22T16:19:32.522178552" + }, + "rnacofold - fasta": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.csv:md5,7180fc3533f96237a1e0646808d9a61f" + ] + ], + [ + "versions.yml:md5,75df9534a7774af48e08daa575a1e3af" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-22T16:19:25.935987006" + } +} \ No newline at end of file diff --git a/modules/nf-core/viennarna/rnacofold/tests/tags.yml b/modules/nf-core/viennarna/rnacofold/tests/tags.yml new file mode 100644 index 00000000000..2d0c7e2647b --- /dev/null +++ b/modules/nf-core/viennarna/rnacofold/tests/tags.yml @@ -0,0 +1,2 @@ +viennarna/rnacofold: + - "modules/nf-core/viennarna/rnacofold/**" From afb604624abcc2fc67a43d70a2de369a50d16105 Mon Sep 17 00:00:00 2001 From: KamilMaliszArdigen <32459801+KamilMaliszArdigen@users.noreply.github.com> Date: Wed, 22 May 2024 22:28:32 +0200 Subject: [PATCH 16/24] Added nf-test for gatk4/intervallisttools (#5672) * Added nf-test for gatk4/intervallisttools * Update modules/nf-core/gatk4/intervallisttools/tests/main.nf.test Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com> * Added nf-test stub for gatk4/intervallisttools * Updated snap nf-test stub for gatk4/intervallisttools --------- Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com> --- .../intervallisttools/tests/main.nf.test | 72 +++++++++++++++ .../intervallisttools/tests/main.nf.test.snap | 88 +++++++++++++++++++ .../intervallisttools/tests}/nextflow.config | 4 - .../gatk4/intervallisttools/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 - .../nf-core/gatk4/intervallisttools/main.nf | 19 ---- .../nf-core/gatk4/intervallisttools/test.yml | 17 ---- 7 files changed, 162 insertions(+), 43 deletions(-) create mode 100644 modules/nf-core/gatk4/intervallisttools/tests/main.nf.test create mode 100644 modules/nf-core/gatk4/intervallisttools/tests/main.nf.test.snap rename {tests/modules/nf-core/gatk4/intervallisttools => modules/nf-core/gatk4/intervallisttools/tests}/nextflow.config (64%) create mode 100644 modules/nf-core/gatk4/intervallisttools/tests/tags.yml delete mode 100644 tests/modules/nf-core/gatk4/intervallisttools/main.nf delete mode 100644 tests/modules/nf-core/gatk4/intervallisttools/test.yml diff --git a/modules/nf-core/gatk4/intervallisttools/tests/main.nf.test b/modules/nf-core/gatk4/intervallisttools/tests/main.nf.test new file mode 100644 index 00000000000..2891bf9e4b1 --- /dev/null +++ b/modules/nf-core/gatk4/intervallisttools/tests/main.nf.test @@ -0,0 +1,72 @@ +nextflow_process { + + name "Test Process GATK4_INTERVALLISTTOOLS" + script "../main.nf" + process "GATK4_INTERVALLISTTOOLS" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "gatk4" + tag "gatk4/bedtointervallist" + tag "gatk4/intervallisttools" + + setup { + run("GATK4_BEDTOINTERVALLIST") { + script "../../bedtointervallist/main.nf" + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true)] + ] + input[1] = [ + [ id:'dict' ], // meta map + [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.dict', checkIfExists: true)] + ] + """ + } + } + } + + test("test_gatk4_intervallisttools") { + + when { + process { + """ + input[0] = GATK4_BEDTOINTERVALLIST.out.interval_list + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + ) + } + + } + + test("test_gatk4_intervallisttools -stub") { + + options "-stub" + + when { + process { + """ + input[0] = GATK4_BEDTOINTERVALLIST.out.interval_list + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + ) + } + + } + +} diff --git a/modules/nf-core/gatk4/intervallisttools/tests/main.nf.test.snap b/modules/nf-core/gatk4/intervallisttools/tests/main.nf.test.snap new file mode 100644 index 00000000000..7718ed00382 --- /dev/null +++ b/modules/nf-core/gatk4/intervallisttools/tests/main.nf.test.snap @@ -0,0 +1,88 @@ +{ + "test_gatk4_intervallisttools": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "1scattered.interval_list:md5,64f6665f9fbd257e4a300ec602f4e995", + "2scattered.interval_list:md5,f515c3da0c6accfd8e7dc33df50855c5", + "3scattered.interval_list:md5,7a918e8c9211b54334587793e8cbae53", + "4scattered.interval_list:md5,1b93105227a7dc81f07101a1efd31498" + ] + ] + ], + "1": [ + "versions.yml:md5,ff682cc9ad70d65a80280df57b316b03" + ], + "interval_list": [ + [ + { + "id": "test" + }, + [ + "1scattered.interval_list:md5,64f6665f9fbd257e4a300ec602f4e995", + "2scattered.interval_list:md5,f515c3da0c6accfd8e7dc33df50855c5", + "3scattered.interval_list:md5,7a918e8c9211b54334587793e8cbae53", + "4scattered.interval_list:md5,1b93105227a7dc81f07101a1efd31498" + ] + ] + ], + "versions": [ + "versions.yml:md5,ff682cc9ad70d65a80280df57b316b03" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-05-22T21:26:22.252885" + }, + "test_gatk4_intervallisttools -stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "1scattered.interval_list:md5,d41d8cd98f00b204e9800998ecf8427e", + "2scattered.interval_list:md5,d41d8cd98f00b204e9800998ecf8427e", + "3scattered.interval_list:md5,d41d8cd98f00b204e9800998ecf8427e", + "4scattered.interval_list:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "1": [ + "versions.yml:md5,ff682cc9ad70d65a80280df57b316b03" + ], + "interval_list": [ + [ + { + "id": "test" + }, + [ + "1scattered.interval_list:md5,d41d8cd98f00b204e9800998ecf8427e", + "2scattered.interval_list:md5,d41d8cd98f00b204e9800998ecf8427e", + "3scattered.interval_list:md5,d41d8cd98f00b204e9800998ecf8427e", + "4scattered.interval_list:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "versions": [ + "versions.yml:md5,ff682cc9ad70d65a80280df57b316b03" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-05-22T22:15:11.772344" + } +} \ No newline at end of file diff --git a/tests/modules/nf-core/gatk4/intervallisttools/nextflow.config b/modules/nf-core/gatk4/intervallisttools/tests/nextflow.config similarity index 64% rename from tests/modules/nf-core/gatk4/intervallisttools/nextflow.config rename to modules/nf-core/gatk4/intervallisttools/tests/nextflow.config index b751ad9bc1d..b24b20db0f2 100644 --- a/tests/modules/nf-core/gatk4/intervallisttools/nextflow.config +++ b/modules/nf-core/gatk4/intervallisttools/tests/nextflow.config @@ -1,9 +1,5 @@ process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - withName: GATK4_INTERVALLISTTOOLS { ext.args = '--SCATTER_COUNT 6 --SUBDIVISION_MODE BALANCING_WITHOUT_INTERVAL_SUBDIVISION_WITH_OVERFLOW --UNIQUE true --SORT true' } - } diff --git a/modules/nf-core/gatk4/intervallisttools/tests/tags.yml b/modules/nf-core/gatk4/intervallisttools/tests/tags.yml new file mode 100644 index 00000000000..bf85ff5fac3 --- /dev/null +++ b/modules/nf-core/gatk4/intervallisttools/tests/tags.yml @@ -0,0 +1,2 @@ +gatk4/intervallisttools: + - "modules/nf-core/gatk4/intervallisttools/**" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 1048d6324db..f0402b8a2a9 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -614,9 +614,6 @@ gatk4/germlinecnvcaller: gatk4/intervallisttobed: - modules/nf-core/gatk4/intervallisttobed/** - tests/modules/nf-core/gatk4/intervallisttobed/** -gatk4/intervallisttools: - - modules/nf-core/gatk4/intervallisttools/** - - tests/modules/nf-core/gatk4/intervallisttools/** gatk4/learnreadorientationmodel: - modules/nf-core/gatk4/learnreadorientationmodel/** - tests/modules/nf-core/gatk4/learnreadorientationmodel/** diff --git a/tests/modules/nf-core/gatk4/intervallisttools/main.nf b/tests/modules/nf-core/gatk4/intervallisttools/main.nf deleted file mode 100644 index 44b15362514..00000000000 --- a/tests/modules/nf-core/gatk4/intervallisttools/main.nf +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { GATK4_BEDTOINTERVALLIST } from '../../../../../modules/nf-core/gatk4/bedtointervallist/main.nf' -include { GATK4_INTERVALLISTTOOLS } from '../../../../../modules/nf-core/gatk4/intervallisttools/main.nf' - -workflow test_gatk4_intervallisttools { - - input = [ - [ id:'test' ], - file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) - ] - dict = Channel.fromPath(file(params.test_data['sarscov2']['genome']['genome_dict'], checkIfExists: true)) - .map{ dict -> [ [id:'test'], dict ] } - - GATK4_BEDTOINTERVALLIST ( input, dict ) - GATK4_INTERVALLISTTOOLS ( GATK4_BEDTOINTERVALLIST.out.interval_list ) -} diff --git a/tests/modules/nf-core/gatk4/intervallisttools/test.yml b/tests/modules/nf-core/gatk4/intervallisttools/test.yml deleted file mode 100644 index 7d326171518..00000000000 --- a/tests/modules/nf-core/gatk4/intervallisttools/test.yml +++ /dev/null @@ -1,17 +0,0 @@ -- name: gatk4 intervallisttools test_gatk4_intervallisttools - command: nextflow run ./tests/modules/nf-core/gatk4/intervallisttools -entry test_gatk4_intervallisttools -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/gatk4/intervallisttools/nextflow.config - tags: - - gatk4 - - gatk4/intervallisttools - files: - - path: output/gatk4/test.interval_list - md5sum: e51101c9357fb2d59fd30e370eefa39c - - path: output/gatk4/test_split/temp_0001_of_6/1scattered.interval_list - md5sum: 64f6665f9fbd257e4a300ec602f4e995 - - path: output/gatk4/test_split/temp_0002_of_6/2scattered.interval_list - md5sum: f515c3da0c6accfd8e7dc33df50855c5 - - path: output/gatk4/test_split/temp_0003_of_6/3scattered.interval_list - md5sum: 7a918e8c9211b54334587793e8cbae53 - - path: output/gatk4/test_split/temp_0004_of_6/4scattered.interval_list - md5sum: 1b93105227a7dc81f07101a1efd31498 - - path: output/gatk4/versions.yml From 11af7bca95501cc58b5e5ddc0e20177947f797be Mon Sep 17 00:00:00 2001 From: kokul-atx <99668099+kokul-atx@users.noreply.github.com> Date: Wed, 22 May 2024 16:30:45 -0400 Subject: [PATCH 17/24] 5663 new module viennarnarnalfold (#5664) * working on the main.nf and meta.yml initially * working on the main.nf and meta.yml initially * Adding the updates to meta.yml * Adding the latest code changes that add a working version of the tests * Fixing the version mismatch in the docker and singularity containers * Removing the trailing whitespaces * Bump parabricks 4.3.0-1 + remove stageInMode (#5646) Parabricks doesn't require stageInMode to be 'copy' Signed-off-by: Marcel Ribeiro-Dantas * glimpse2 version bump - abandoned (#4236) * chore(deps): update biocontainers/glimpse-bio docker tag to v2.0.1 * Update main.nf * Update main.nf * Update main.nf * Update main.nf * Update main.nf * Update main.nf * Update main.nf * The channel was renamed in https://github.com/nf-core/modules/pull/5117 * The Conda yml files need to match the container definitions * Typo ! There was a missing s --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Louis LE NEZET <58640615+LouisLeNezet@users.noreply.github.com> Co-authored-by: Matthieu Muffato * Update pre-commit hook renovatebot/pre-commit-hooks to v37.371.1 (#5653) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Bump csvtk version to CSVTK/JOIN and add nf-test (#5642) * Bump csvtk new version * Add nf-test * Get rid of pytest * Bump version in singularity images * Update tests/config/pytest_modules.yml --------- Co-authored-by: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> * Added task.memory to meryl modules and .meryl ext for outputs (#5655) * Stub and nf-test for fastk/fastk (#5631) * Stub and nf-test for fastk/fastk * Added chmod +r to add read permissions for docker * Added a+r * Bump csvtk version to CSVTK/SPLIT and add nf-test (#5656) * Remove leftover of previous PR * Bump version 0.30.0 of csvtk * Ad nf-test for csvtk/split * Remove csvtk/split from pytest_modules.yml * Make lint happy * Update path on tests * Update modules/nf-core/csvtk/split/tests/main.nf.test * Update modules/nf-core/csvtk/split/tests/main.nf.test * Update modules/nf-core/viennarna/rnafold/tests/main.nf.test Co-authored-by: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> * Adding the working version of ViennaRNA/RNALfold module * Adding the corrected version of meta.yml file * Removing trailing whitespaces in all files * Removing the type with backtick * Removing the whitespace from rnafold main.nf * Removing the viennarna/rnafold and removing the comments and --- from env.yml * Update modules/nf-core/viennarna/rnalfold/main.nf Co-authored-by: Florian Wuennemann * Update modules/nf-core/viennarna/rnalfold/main.nf Co-authored-by: Florian Wuennemann * Update modules/nf-core/viennarna/rnalfold/main.nf Co-authored-by: Florian Wuennemann * Update modules/nf-core/viennarna/rnalfold/tests/main.nf.test Co-authored-by: Florian Wuennemann * Update modules/nf-core/viennarna/rnalfold/tests/main.nf.test Co-authored-by: Florian Wuennemann * Update modules/nf-core/viennarna/rnalfold/tests/nf-test.config Co-authored-by: Florian Wuennemann * Deleting nf-test.config for viennarna/rnalfold as per suggested * Adding the correct test assertions and snapshots --------- Signed-off-by: Marcel Ribeiro-Dantas Co-authored-by: Marcel Ribeiro-Dantas Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Louis LE NEZET <58640615+LouisLeNezet@users.noreply.github.com> Co-authored-by: Matthieu Muffato Co-authored-by: Jose Espinosa-Carrasco Co-authored-by: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Co-authored-by: Usman Rashid Co-authored-by: Florian Wuennemann --- .../viennarna/rnalfold/environment.yml | 7 +++ modules/nf-core/viennarna/rnalfold/main.nf | 46 +++++++++++++++++ modules/nf-core/viennarna/rnalfold/meta.yml | 45 ++++++++++++++++ .../viennarna/rnalfold/tests/main.nf.test | 51 +++++++++++++++++++ .../rnalfold/tests/main.nf.test.snap | 32 ++++++++++++ .../nf-core/viennarna/rnalfold/tests/tags.yml | 2 + 6 files changed, 183 insertions(+) create mode 100644 modules/nf-core/viennarna/rnalfold/environment.yml create mode 100644 modules/nf-core/viennarna/rnalfold/main.nf create mode 100644 modules/nf-core/viennarna/rnalfold/meta.yml create mode 100644 modules/nf-core/viennarna/rnalfold/tests/main.nf.test create mode 100644 modules/nf-core/viennarna/rnalfold/tests/main.nf.test.snap create mode 100644 modules/nf-core/viennarna/rnalfold/tests/tags.yml diff --git a/modules/nf-core/viennarna/rnalfold/environment.yml b/modules/nf-core/viennarna/rnalfold/environment.yml new file mode 100644 index 00000000000..688cf1527bf --- /dev/null +++ b/modules/nf-core/viennarna/rnalfold/environment.yml @@ -0,0 +1,7 @@ +name: "viennarna_rnalfold" +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - "bioconda::viennarna=2.6.4" diff --git a/modules/nf-core/viennarna/rnalfold/main.nf b/modules/nf-core/viennarna/rnalfold/main.nf new file mode 100644 index 00000000000..dcdb94e5d76 --- /dev/null +++ b/modules/nf-core/viennarna/rnalfold/main.nf @@ -0,0 +1,46 @@ +process VIENNARNA_RNALFOLD { + tag '$rna_fastq' + label 'process_single' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/viennarna:2.6.4--py310pl5321h6cc9453_1': + 'biocontainers/viennarna:2.6.4--py310pl5321h6cc9453_1' }" + + input: + path fasta + + output: + path "*.lfold" , emit: rnalfold_txt + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + """ + RNALfold \\ + ${args} \\ + --infile=$fasta \\ + --outfile=${fasta.baseName}.lfold + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + RNALfold: \$( RNAfold --version |& sed '1!d ; s/RNALfold //') + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + + """ + touch ${fasta.baseName}.lfold + touch ${fasta}.ps + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + RNALfold: \$( RNAfold --version |& sed '1!d ; s/RNALfold //') + END_VERSIONS + """ +} diff --git a/modules/nf-core/viennarna/rnalfold/meta.yml b/modules/nf-core/viennarna/rnalfold/meta.yml new file mode 100644 index 00000000000..7c7d24a1890 --- /dev/null +++ b/modules/nf-core/viennarna/rnalfold/meta.yml @@ -0,0 +1,45 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "viennarna_rnalfold" +description: calculate locally stable secondary structures of RNAs +keywords: + - RNA + - fasta + - rna_structure +tools: + - "viennarna": + description: | + calculate locally stable secondary structures of RNAs + + Compute locally stable RNA secondary structure with a maximal base pair span. + For a sequence of length n and a base pair span of L the algorithm uses only + O(n+L*L) memory and O(n*L*L) CPU time. Thus it is practical to “scan” very + large genomes for short RNA structures. Output consists of a list of + secondary structure components of size <= L, one entry per line. Each + output line contains the predicted local structure its energy in + kcal/mol and the starting position of the local structure. + homepage: "https://www.tbi.univie.ac.at/RNA/" + documentation: "https://viennarna.readthedocs.io/en/latest/" + doi: 10.1186/1748-7188-6-26 + licence: ["custom"] + +input: + - fasta: + type: file + description: | + A fasta file containing RNA or transcript sequences + pattern: "*.{fasta,fa}" +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - rnalfold_txt: + type: file + description: The text Output of RNALfold + pattern: "*.{lfold}" + +authors: + - "@kokul-atx" +maintainers: + - "@kokul-atx" diff --git a/modules/nf-core/viennarna/rnalfold/tests/main.nf.test b/modules/nf-core/viennarna/rnalfold/tests/main.nf.test new file mode 100644 index 00000000000..803e9cb7f89 --- /dev/null +++ b/modules/nf-core/viennarna/rnalfold/tests/main.nf.test @@ -0,0 +1,51 @@ +nextflow_process { + + name "Test Process VIENNARNA_RNALFOLD" + script "../main.nf" + process "VIENNARNA_RNALFOLD" + + tag "modules" + tag "modules_nfcore" + tag "viennarna" + tag "viennarna/rnalfold" + + test("rnalfold - fasta") { + when { + process { + """ + input[0] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/transcriptome.fasta', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.rnalfold_txt, process.out.versions).match() } + ) + } + + } + + test("rnalfold - fasta - stub") { + + options "-stub" + + when { + process { + """ + input[0] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/transcriptome.fasta', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.rnalfold_txt, process.out.versions).match() } + ) + } + + } + +} diff --git a/modules/nf-core/viennarna/rnalfold/tests/main.nf.test.snap b/modules/nf-core/viennarna/rnalfold/tests/main.nf.test.snap new file mode 100644 index 00000000000..a5c5675373b --- /dev/null +++ b/modules/nf-core/viennarna/rnalfold/tests/main.nf.test.snap @@ -0,0 +1,32 @@ +{ + "rnalfold - fasta - stub": { + "content": [ + [ + "transcriptome.lfold:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + "versions.yml:md5,3b9113f5d82fc10d06058b4f7bb950d1" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-22T14:57:28.674233378" + }, + "rnalfold - fasta": { + "content": [ + [ + "transcriptome.lfold:md5,d02fb7aee647542f2015908181178ed5" + ], + [ + "versions.yml:md5,3b9113f5d82fc10d06058b4f7bb950d1" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-22T14:57:21.617525597" + } +} \ No newline at end of file diff --git a/modules/nf-core/viennarna/rnalfold/tests/tags.yml b/modules/nf-core/viennarna/rnalfold/tests/tags.yml new file mode 100644 index 00000000000..4fb7b172e47 --- /dev/null +++ b/modules/nf-core/viennarna/rnalfold/tests/tags.yml @@ -0,0 +1,2 @@ +viennarna/rnalfold: + - "modules/nf-core/viennarna/rnalfold/**" From 5238da4ecaf3df6f8f0c3785fdeeaf264b55b8ec Mon Sep 17 00:00:00 2001 From: Wei-An Chen <53973160+Vivian-chen16@users.noreply.github.com> Date: Wed, 22 May 2024 16:54:13 -0400 Subject: [PATCH 18/24] Add checkm/lineagewf nf tests. (#5652) * Add checkm/lineagewf nf tests. * Remove files contain timestamp from snapshot * Remove pytest files * Delete checkm_lineagewf entry in pytest_modules.yml * Apply suggestions from code review Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com> --------- Co-authored-by: Wei-An Chen Co-authored-by: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com> Co-authored-by: Maxime U Garcia Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com> --- .../checkm/lineagewf/tests/main.nf.test | 38 +++++++++++++++++++ .../checkm/lineagewf/tests/main.nf.test.snap | 24 ++++++++++++ .../nf-core/checkm/lineagewf/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 -- .../modules/nf-core/checkm/lineagewf/main.nf | 24 ------------ .../nf-core/checkm/lineagewf/nextflow.config | 5 --- .../modules/nf-core/checkm/lineagewf/test.yml | 34 ----------------- 7 files changed, 64 insertions(+), 66 deletions(-) create mode 100644 modules/nf-core/checkm/lineagewf/tests/main.nf.test create mode 100644 modules/nf-core/checkm/lineagewf/tests/main.nf.test.snap create mode 100644 modules/nf-core/checkm/lineagewf/tests/tags.yml delete mode 100644 tests/modules/nf-core/checkm/lineagewf/main.nf delete mode 100644 tests/modules/nf-core/checkm/lineagewf/nextflow.config delete mode 100644 tests/modules/nf-core/checkm/lineagewf/test.yml diff --git a/modules/nf-core/checkm/lineagewf/tests/main.nf.test b/modules/nf-core/checkm/lineagewf/tests/main.nf.test new file mode 100644 index 00000000000..050bfd85fee --- /dev/null +++ b/modules/nf-core/checkm/lineagewf/tests/main.nf.test @@ -0,0 +1,38 @@ +nextflow_process { + + name "Test Process CHECKM_LINEAGEWF" + script "../main.nf" + process "CHECKM_LINEAGEWF" + tag "modules" + tag "modules_nfcore" + tag "checkm" + tag "checkm/lineagewf" + + test("Should run without failures") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['contigs_fasta'], checkIfExists: true) + ] + input[1] = 'fasta' + input[2] = [] // Download CheckM database + """ + } + } + + then { + assert process.success + assert file(process.out.checkm_output[0][1]).list().find { file(it).name == "checkm.log" } + assert snapshot( + path(process.out.marker_file[0][1]).readLines().any{it.contains("PF00312.17")}, + process.out.checkm_tsv, + process.out.versions + ).match() + } + + } + +} diff --git a/modules/nf-core/checkm/lineagewf/tests/main.nf.test.snap b/modules/nf-core/checkm/lineagewf/tests/main.nf.test.snap new file mode 100644 index 00000000000..07db6bbf81a --- /dev/null +++ b/modules/nf-core/checkm/lineagewf/tests/main.nf.test.snap @@ -0,0 +1,24 @@ +{ + "Should run without failures": { + "content": [ + true, + [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,d5559764f563c4b55223e4e4a3dc1ec9" + ] + ], + [ + "versions.yml:md5,fd7a8db316717ab0695e47d7d0a645ff" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-05-22T19:13:13.504227996" + } +} \ No newline at end of file diff --git a/modules/nf-core/checkm/lineagewf/tests/tags.yml b/modules/nf-core/checkm/lineagewf/tests/tags.yml new file mode 100644 index 00000000000..04438be8401 --- /dev/null +++ b/modules/nf-core/checkm/lineagewf/tests/tags.yml @@ -0,0 +1,2 @@ +checkm/lineagewf: + - modules/nf-core/checkm/lineagewf/** diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index f0402b8a2a9..8f1ca8cc69f 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -265,9 +265,6 @@ cellrangeratac/mkfastq: cellrangeratac/mkref: - modules/nf-core/cellrangeratac/mkref/** - tests/modules/nf-core/cellrangeratac/mkref/** -checkm/lineagewf: - - modules/nf-core/checkm/lineagewf/** - - tests/modules/nf-core/checkm/lineagewf/** checkm/qa: - modules/nf-core/checkm/qa/** - tests/modules/nf-core/checkm/qa/** diff --git a/tests/modules/nf-core/checkm/lineagewf/main.nf b/tests/modules/nf-core/checkm/lineagewf/main.nf deleted file mode 100644 index eb7bedd8110..00000000000 --- a/tests/modules/nf-core/checkm/lineagewf/main.nf +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { CHECKM_LINEAGEWF } from '../../../../../modules/nf-core/checkm/lineagewf/main.nf' - -workflow test_checkm_lineagewf { - - input = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['contigs_fasta'], checkIfExists: true) ] - fasta_ext = 'fasta' - - CHECKM_LINEAGEWF ( input, fasta_ext, [] ) -} - -workflow test_checkm_lineagewf_multi { - - input = [ [ id:'test', single_end:false ], // meta map - [ file(params.test_data['sarscov2']['illumina']['contigs_fasta'], checkIfExists: true), - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] ] - fasta_ext = 'fasta' - - CHECKM_LINEAGEWF ( input, fasta_ext, [] ) -} diff --git a/tests/modules/nf-core/checkm/lineagewf/nextflow.config b/tests/modules/nf-core/checkm/lineagewf/nextflow.config deleted file mode 100644 index 8730f1c4b93..00000000000 --- a/tests/modules/nf-core/checkm/lineagewf/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/checkm/lineagewf/test.yml b/tests/modules/nf-core/checkm/lineagewf/test.yml deleted file mode 100644 index 8fcaf067293..00000000000 --- a/tests/modules/nf-core/checkm/lineagewf/test.yml +++ /dev/null @@ -1,34 +0,0 @@ -- name: checkm lineagewf - command: nextflow run ./tests/modules/nf-core/checkm/lineagewf -entry test_checkm_lineagewf -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/checkm/lineagewf/nextflow.config - tags: - - checkm - - checkm/lineagewf - files: - - path: output/checkm/test.tsv - md5sum: d5559764f563c4b55223e4e4a3dc1ec9 - - path: output/checkm/test/checkm.log - contains: - - "INFO: Parsing HMM hits to marker genes:" - - path: output/checkm/test/lineage.ms - contains: - - "# [Lineage Marker File]" - - "contigs" - - "UID1" - -- name: checkm lineagewf_multi - command: nextflow run ./tests/modules/nf-core/checkm/lineagewf -entry test_checkm_lineagewf_multi -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/checkm/lineagewf/nextflow.config - tags: - - checkm - - checkm/lineagewf - files: - - path: output/checkm/test.tsv - md5sum: 7e0fa177dcf151b84b7751813fbde3d1 - - path: output/checkm/test/checkm.log - contains: - - "INFO: Parsing HMM hits to marker genes:" - - path: output/checkm/test/lineage.ms - contains: - - "# [Lineage Marker File]" - - "contigs" - - "UID1" - - "genome" From 63d6994f4f85c0628b7f2ac1e7097136c1b4be34 Mon Sep 17 00:00:00 2001 From: Adelaide Rhodes <75856507+BlueBicycleBlog@users.noreply.github.com> Date: Wed, 22 May 2024 16:54:58 -0400 Subject: [PATCH 19/24] added module 10xbamtofastq (#5671) * added module 10xbamtofastq * remove extra test file * Update main.nf.test * Update main.nf * Rename module and fix tests --------- Co-authored-by: Harshil Patel Co-authored-by: Harshil Patel --- modules/nf-core/bamtofastq10x/environment.yml | 9 +++ modules/nf-core/bamtofastq10x/main.nf | 45 +++++++++++++++ modules/nf-core/bamtofastq10x/meta.yml | 48 ++++++++++++++++ .../nf-core/bamtofastq10x/tests/main.nf.test | 55 +++++++++++++++++++ .../bamtofastq10x/tests/main.nf.test.snap | 47 ++++++++++++++++ modules/nf-core/bamtofastq10x/tests/tags.yml | 2 + 6 files changed, 206 insertions(+) create mode 100644 modules/nf-core/bamtofastq10x/environment.yml create mode 100644 modules/nf-core/bamtofastq10x/main.nf create mode 100644 modules/nf-core/bamtofastq10x/meta.yml create mode 100644 modules/nf-core/bamtofastq10x/tests/main.nf.test create mode 100644 modules/nf-core/bamtofastq10x/tests/main.nf.test.snap create mode 100644 modules/nf-core/bamtofastq10x/tests/tags.yml diff --git a/modules/nf-core/bamtofastq10x/environment.yml b/modules/nf-core/bamtofastq10x/environment.yml new file mode 100644 index 00000000000..d612f512e6f --- /dev/null +++ b/modules/nf-core/bamtofastq10x/environment.yml @@ -0,0 +1,9 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +name: "bamtofastq10x" +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - "bioconda::10x_bamtofastq=1.4.1" diff --git a/modules/nf-core/bamtofastq10x/main.nf b/modules/nf-core/bamtofastq10x/main.nf new file mode 100644 index 00000000000..be1b14415be --- /dev/null +++ b/modules/nf-core/bamtofastq10x/main.nf @@ -0,0 +1,45 @@ +process BAMTOFASTQ10X { + 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/10x_bamtofastq:1.4.1--hdbdd923_2': + 'biocontainers/10x_bamtofastq:1.4.1--hdbdd923_2' }" + + input: + tuple val(meta), path(bam) + + output: + tuple val(meta), path("*.fastq.gz"), emit: fastq + 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}" + """ + bamtofastq \\ + $args \\ + $bam \\ + ${prefix}.fastq.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bamtofastq10x: \$(bamtofastq --version |& sed '1!d ; s/bamtofastq //') + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.fastq.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bamtofastq10x: \$(bamtofastq --version |& sed '1!d ; s/bamtofastq //') + END_VERSIONS + """ +} diff --git a/modules/nf-core/bamtofastq10x/meta.yml b/modules/nf-core/bamtofastq10x/meta.yml new file mode 100644 index 00000000000..2ac31a5cf82 --- /dev/null +++ b/modules/nf-core/bamtofastq10x/meta.yml @@ -0,0 +1,48 @@ +name: bamtofastq10x + +description: Tool for converting 10x BAMs produced by Cell Ranger, Space Ranger, Cell Ranger ATAC, Cell Ranger DNA, and Long Ranger back to FASTQ files that can be used as inputs to re-run analysis + +keywords: + - bam + - convert + - fastq + - 10x + +tools: + - bamtofastq10x: + description: Tool for converting 10x BAMs produced by Cell Ranger, Space Ranger, Cell Ranger ATAC, Cell Ranger DNA, and Long Ranger back to FASTQ files that can be used as inputs to re-run analysis + homepage: https://github.com/10XGenomics/bamtofastq + documentation: https://github.com/10XGenomics/bamtofastq + tool_dev_url: https://github.com/10XGenomics/bamtofastq + licence: ["MIT"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + - bam: + type: file + description: BAM file + pattern: "*.bam" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + + - fastq: + type: file + description: fastq compressed file + pattern: "*.fastq.gz" + +authors: + - "@BlueBicycleBlog" +maintainers: + - "@BlueBicycleBlog" diff --git a/modules/nf-core/bamtofastq10x/tests/main.nf.test b/modules/nf-core/bamtofastq10x/tests/main.nf.test new file mode 100644 index 00000000000..2b455ae8447 --- /dev/null +++ b/modules/nf-core/bamtofastq10x/tests/main.nf.test @@ -0,0 +1,55 @@ +nextflow_process { + + name "Test Process BAMTOFASTQ10X" + script "../main.nf" + process "BAMTOFASTQ10X" + + tag "modules" + tag "modules_nfcore" + tag "bamtofastq10x" + + test("human - bam") { + when { + process { + """ + input[0] = Channel.of([ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/10xgenomics/10x_cr12.bam', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + + ) + } + } + + + test("human - bam - stub") { + + options "-stub" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/10xgenomics/10x_cr12.bam', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll( + { assert process.success } + ) + } + + } +} diff --git a/modules/nf-core/bamtofastq10x/tests/main.nf.test.snap b/modules/nf-core/bamtofastq10x/tests/main.nf.test.snap new file mode 100644 index 00000000000..d534674592d --- /dev/null +++ b/modules/nf-core/bamtofastq10x/tests/main.nf.test.snap @@ -0,0 +1,47 @@ +{ + "human - bam": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + [ + "bamtofastq_S1_L000_I1_001.fastq.gz:md5,a33682ac881de7a7453d79721b7621a0", + "bamtofastq_S1_L000_R1_001.fastq.gz:md5,5ccebf77d8636d7a7cdfc59737aea79f", + "bamtofastq_S1_L000_R2_001.fastq.gz:md5,2ee7c90e4307deba74065cfd00a65002" + ] + ] + ] + ], + "1": [ + "versions.yml:md5,845cd1d09c8a3d0059da9d074a9e5436" + ], + "fastq": [ + [ + { + "id": "test" + }, + [ + [ + "bamtofastq_S1_L000_I1_001.fastq.gz:md5,a33682ac881de7a7453d79721b7621a0", + "bamtofastq_S1_L000_R1_001.fastq.gz:md5,5ccebf77d8636d7a7cdfc59737aea79f", + "bamtofastq_S1_L000_R2_001.fastq.gz:md5,2ee7c90e4307deba74065cfd00a65002" + ] + ] + ] + ], + "versions": [ + "versions.yml:md5,845cd1d09c8a3d0059da9d074a9e5436" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.0" + }, + "timestamp": "2024-05-22T16:43:24.999397" + } +} \ No newline at end of file diff --git a/modules/nf-core/bamtofastq10x/tests/tags.yml b/modules/nf-core/bamtofastq10x/tests/tags.yml new file mode 100644 index 00000000000..fe62227fef6 --- /dev/null +++ b/modules/nf-core/bamtofastq10x/tests/tags.yml @@ -0,0 +1,2 @@ +bamtofastq10x: + - "modules/nf-core/bamtofastq10x/**" From 00409369b2aff69bded4f0a9e7a80e17d933b426 Mon Sep 17 00:00:00 2001 From: KamilMaliszArdigen <32459801+KamilMaliszArdigen@users.noreply.github.com> Date: Wed, 22 May 2024 23:07:47 +0200 Subject: [PATCH 20/24] Added nf-test stub for gatk4/variantfiltration (#5676) * Added nf-test stub for gatk4/variantfiltration * Update for lint * Update for lint --- .../variantfiltration/tests/main.nf.test | 87 +++++++++++++++++++ .../variantfiltration/tests/main.nf.test.snap | 30 +++++++ .../gatk4/variantfiltration/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 - .../nf-core/gatk4/variantfiltration/main.nf | 51 ----------- .../gatk4/variantfiltration/nextflow.config | 10 --- .../nf-core/gatk4/variantfiltration/test.yml | 47 ---------- 7 files changed, 119 insertions(+), 111 deletions(-) create mode 100644 modules/nf-core/gatk4/variantfiltration/tests/main.nf.test create mode 100644 modules/nf-core/gatk4/variantfiltration/tests/main.nf.test.snap create mode 100644 modules/nf-core/gatk4/variantfiltration/tests/tags.yml delete mode 100644 tests/modules/nf-core/gatk4/variantfiltration/main.nf delete mode 100644 tests/modules/nf-core/gatk4/variantfiltration/nextflow.config delete mode 100644 tests/modules/nf-core/gatk4/variantfiltration/test.yml diff --git a/modules/nf-core/gatk4/variantfiltration/tests/main.nf.test b/modules/nf-core/gatk4/variantfiltration/tests/main.nf.test new file mode 100644 index 00000000000..36b7438d392 --- /dev/null +++ b/modules/nf-core/gatk4/variantfiltration/tests/main.nf.test @@ -0,0 +1,87 @@ +nextflow_process { + + name "Test Process GATK4_VARIANTFILTRATION" + script "../main.nf" + process "GATK4_VARIANTFILTRATION" + + tag "modules" + tag "modules_nfcore" + tag "gatk4" + tag "gatk4/variantfiltration" + + test("test_gatk4_variantfiltration_vcf_input") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.idx', checkIfExists: true) + ] + input[1] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + input[2] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ] + input[3] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions, + file(process.out.vcf.get(0).get(1)).name, + file(process.out.tbi.get(0).get(1)).name).match() }, + ) + } + + } + + test("test_gatk4_variantfiltration_gz_input") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + input[2] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ] + input[3] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions, + file(process.out.vcf.get(0).get(1)).name, + file(process.out.tbi.get(0).get(1)).name).match() }, + ) + } + + } + +} + diff --git a/modules/nf-core/gatk4/variantfiltration/tests/main.nf.test.snap b/modules/nf-core/gatk4/variantfiltration/tests/main.nf.test.snap new file mode 100644 index 00000000000..36c03f7c1e5 --- /dev/null +++ b/modules/nf-core/gatk4/variantfiltration/tests/main.nf.test.snap @@ -0,0 +1,30 @@ +{ + "test_gatk4_variantfiltration_gz_input": { + "content": [ + [ + "versions.yml:md5,96943659275ba62de1f0d283a2f6e97b" + ], + "test.vcf.gz", + "test.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-05-22T22:43:27.609784" + }, + "test_gatk4_variantfiltration_vcf_input": { + "content": [ + [ + "versions.yml:md5,96943659275ba62de1f0d283a2f6e97b" + ], + "test.vcf.gz", + "test.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.2" + }, + "timestamp": "2024-05-22T22:42:55.316294" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4/variantfiltration/tests/tags.yml b/modules/nf-core/gatk4/variantfiltration/tests/tags.yml new file mode 100644 index 00000000000..4818037d795 --- /dev/null +++ b/modules/nf-core/gatk4/variantfiltration/tests/tags.yml @@ -0,0 +1,2 @@ +gatk4/variantfiltration: + - "modules/nf-core/gatk4/variantfiltration/**" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 8f1ca8cc69f..b58d208c833 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -653,9 +653,6 @@ gatk4/splitcram: gatk4/splitintervals: - modules/nf-core/gatk4/splitintervals/** - tests/modules/nf-core/gatk4/splitintervals/** -gatk4/variantfiltration: - - modules/nf-core/gatk4/variantfiltration/** - - tests/modules/nf-core/gatk4/variantfiltration/** gatk4/variantrecalibrator: - modules/nf-core/gatk4/variantrecalibrator/** - tests/modules/nf-core/gatk4/variantrecalibrator/** diff --git a/tests/modules/nf-core/gatk4/variantfiltration/main.nf b/tests/modules/nf-core/gatk4/variantfiltration/main.nf deleted file mode 100644 index 82451a3d0de..00000000000 --- a/tests/modules/nf-core/gatk4/variantfiltration/main.nf +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { GATK4_VARIANTFILTRATION } from '../../../../../modules/nf-core/gatk4/variantfiltration/main.nf' - -// Basic parameters with uncompressed VCF input -workflow test_gatk4_variantfiltration_vcf_input { - - input = [ - [ id:'test' ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_idx'], checkIfExists: true) - ] - - fasta = [ [ id:'genome' ], // meta map - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - ] - fai = [ [ id:'genome' ], // meta map - file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) - ] - dict = [ [ id:'genome' ], // meta map - file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) - ] - - GATK4_VARIANTFILTRATION ( input, fasta, fai, dict ) -} - -// Basic parameters with compressed VCF input -workflow test_gatk4_variantfiltration_gz_input { - - input = [ - [ id:'test' ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz_tbi'], checkIfExists: true) - ] - - fasta = [ [ id:'genome' ], // meta map - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - ] - fai = [ [ id:'genome' ], // meta map - file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) - ] - dict = [ [ id:'genome' ], // meta map - file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) - ] - - GATK4_VARIANTFILTRATION ( input, fasta, fai, dict ) -} - - diff --git a/tests/modules/nf-core/gatk4/variantfiltration/nextflow.config b/tests/modules/nf-core/gatk4/variantfiltration/nextflow.config deleted file mode 100644 index 4b930f2880a..00000000000 --- a/tests/modules/nf-core/gatk4/variantfiltration/nextflow.config +++ /dev/null @@ -1,10 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: GATK4_VARIANTFILTRATION { - ext.args = "--filter-name \'test_filter\' --filter-expression \'MQ0 > 0\'" - ext.prefix = { "${meta.id}.filtered" } - } - -} diff --git a/tests/modules/nf-core/gatk4/variantfiltration/test.yml b/tests/modules/nf-core/gatk4/variantfiltration/test.yml deleted file mode 100644 index 9a265684335..00000000000 --- a/tests/modules/nf-core/gatk4/variantfiltration/test.yml +++ /dev/null @@ -1,47 +0,0 @@ -- name: gatk4 variantfiltration test_gatk4_variantfiltration_vcf_input - command: nextflow run ./tests/modules/nf-core/gatk4/variantfiltration -entry test_gatk4_variantfiltration_vcf_input -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/gatk4/variantfiltration/nextflow.config - tags: - - gatk4/variantfiltration - - gatk4 - files: - - path: output/gatk4/test.filtered.vcf.gz - contains: - [ - "BaseQRankSum=-1.318;DP=17;ExcessHet=3.0103;MLEAC=1,0,0;MLEAF=0.500,0.00,0.00;MQRankSum=0.000;RAW_MQandDP=61200,17;ReadPosRankSum=2.365", - ] - - path: output/gatk4/test.filtered.vcf.gz.tbi - - path: output/gatk4/versions.yml - -- name: gatk4 variantfiltration test_gatk4_variantfiltration_vcf_input_stubs - command: nextflow run ./tests/modules/nf-core/gatk4/variantfiltration -entry test_gatk4_variantfiltration_vcf_input -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/gatk4/variantfiltration/nextflow.config -stub-run - tags: - - gatk4/variantfiltration - - gatk4 - files: - - path: output/gatk4/test.filtered.vcf.gz - - path: output/gatk4/test.filtered.vcf.gz.tbi - - path: output/gatk4/versions.yml - -- name: gatk4 variantfiltration test_gatk4_variantfiltration_gz_input - command: nextflow run ./tests/modules/nf-core/gatk4/variantfiltration -entry test_gatk4_variantfiltration_gz_input -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/gatk4/variantfiltration/nextflow.config - tags: - - gatk4/variantfiltration - - gatk4 - files: - - path: output/gatk4/test.filtered.vcf.gz - contains: - [ - "BaseQRankSum=-1.318;DP=17;ExcessHet=3.0103;MLEAC=1,0,0;MLEAF=0.500,0.00,0.00;MQRankSum=0.000;RAW_MQandDP=61200,17;ReadPosRankSum=2.365", - ] - - path: output/gatk4/test.filtered.vcf.gz.tbi - - path: output/gatk4/versions.yml - -- name: gatk4 variantfiltration test_gatk4_variantfiltration_gz_input_stubs - command: nextflow run ./tests/modules/nf-core/gatk4/variantfiltration -entry test_gatk4_variantfiltration_gz_input -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/gatk4/variantfiltration/nextflow.config -stub-run - tags: - - gatk4/variantfiltration - - gatk4 - files: - - path: output/gatk4/test.filtered.vcf.gz - - path: output/gatk4/test.filtered.vcf.gz.tbi - - path: output/gatk4/versions.yml From e37348cc0271072ac6a3de88f87067ccb00de323 Mon Sep 17 00:00:00 2001 From: Brenna Novotny <51127670+bnovotny@users.noreply.github.com> Date: Wed, 22 May 2024 19:19:15 -0400 Subject: [PATCH 21/24] Add nf-test to chromap/chromap (#5678) * Add nf-test to chromap/chromap * Add nf-test to chromap/chromap (tags added) * Update modules/nf-core/chromap/chromap/tests/main.nf.test * Update modules/nf-core/chromap/chromap/tests/tags.yml * Update pytest_modules.yml * Update main.nf.test * Update main.nf.test.snap * Update main.nf.test * Update main.nf.test.snap --------- Co-authored-by: Maxime U Garcia Co-authored-by: Maxime U Garcia --- .../chromap/chromap/tests/main.nf.test | 145 ++++++++++++++++++ .../chromap/chromap/tests/main.nf.test.snap | 130 ++++++++++++++++ .../chromap/chromap/tests/nextflow.config | 7 + .../nf-core/chromap/chromap/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 - tests/modules/nf-core/chromap/chromap/main.nf | 87 ----------- .../nf-core/chromap/chromap/nextflow.config | 9 -- .../modules/nf-core/chromap/chromap/test.yml | 32 ---- 8 files changed, 284 insertions(+), 131 deletions(-) create mode 100644 modules/nf-core/chromap/chromap/tests/main.nf.test create mode 100644 modules/nf-core/chromap/chromap/tests/main.nf.test.snap create mode 100644 modules/nf-core/chromap/chromap/tests/nextflow.config create mode 100644 modules/nf-core/chromap/chromap/tests/tags.yml delete mode 100644 tests/modules/nf-core/chromap/chromap/main.nf delete mode 100644 tests/modules/nf-core/chromap/chromap/nextflow.config delete mode 100644 tests/modules/nf-core/chromap/chromap/test.yml diff --git a/modules/nf-core/chromap/chromap/tests/main.nf.test b/modules/nf-core/chromap/chromap/tests/main.nf.test new file mode 100644 index 00000000000..c57e740ffde --- /dev/null +++ b/modules/nf-core/chromap/chromap/tests/main.nf.test @@ -0,0 +1,145 @@ +nextflow_process { + + name "Test Process CHROMAP_CHROMAP" + script "../main.nf" + process "CHROMAP_CHROMAP" + + tag "modules" + tag "modules_nfcore" + tag "chromap" + tag "chromap/chromap" + tag "chromap/index" + + test("test_chromap_chromap_single_end") { + + setup { + run("CHROMAP_INDEX") { + script "../../index/main.nf" + process { + """ + input[0] = Channel.of([ + [:], // meta map + [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + ]) + """ + } + } + } + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], // meta map + [file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)] + ]) + input[1] = Channel.of([[:], [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]]) + input[2] = CHROMAP_INDEX.out.index + input[3] = [] + input[4] = [] + input[5] = [] + input[6] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test_chromap_chromap_paired_end") { + + setup { + run("CHROMAP_INDEX") { + script "../../index/main.nf" + process { + """ + input[0] = Channel.of([ + [:], // meta map + [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + ]) + """ + } + } + } + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ]) + input[1] = Channel.of([[:], [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]]) + input[2] = CHROMAP_INDEX.out.index + input[3] = [] + input[4] = [] + input[5] = [] + input[6] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + + test("test_chromap_chromap_paired_bam") { + + setup { + run("CHROMAP_INDEX") { + script "../../index/main.nf" + process { + """ + input[0] = Channel.of([ + [:], // meta map + [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] + ]) + """ + } + } + } + + when { + config "./nextflow.config" + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ]) + input[1] = Channel.of([[:], [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]]) + input[2] = CHROMAP_INDEX.out.index + input[3] = [] + input[4] = [] + input[5] = [] + input[6] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions") }, + { assert snapshot(file(process.out.bam[0][1]).name).match() } + ) + } + + } +} diff --git a/modules/nf-core/chromap/chromap/tests/main.nf.test.snap b/modules/nf-core/chromap/chromap/tests/main.nf.test.snap new file mode 100644 index 00000000000..e3a184deb6a --- /dev/null +++ b/modules/nf-core/chromap/chromap/tests/main.nf.test.snap @@ -0,0 +1,130 @@ +{ + "test_chromap_chromap_paired_end": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bed.gz:md5,54c1feb6f714b72f73befae8435e242b" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + + ], + "4": [ + "versions.yml:md5,80647c2956e504334ad25ce31d33b539" + ], + "bam": [ + + ], + "bed": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bed.gz:md5,54c1feb6f714b72f73befae8435e242b" + ] + ], + "pairs": [ + + ], + "tagAlign": [ + + ], + "versions": [ + "versions.yml:md5,80647c2956e504334ad25ce31d33b539" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.1" + }, + "timestamp": "2024-05-22T19:08:55.497043" + }, + "test_chromap_chromap_paired_bam": { + "content": [ + "test.bam" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.1" + }, + "timestamp": "2024-05-22T19:09:02.957218" + }, + "test_chromap_chromap_single_end": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bed.gz:md5,c45f5bb1c6eb56359760ce3827bfe3f4" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + + ], + "4": [ + "versions.yml:md5,80647c2956e504334ad25ce31d33b539" + ], + "bam": [ + + ], + "bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.bed.gz:md5,c45f5bb1c6eb56359760ce3827bfe3f4" + ] + ], + "pairs": [ + + ], + "tagAlign": [ + + ], + "versions": [ + "versions.yml:md5,80647c2956e504334ad25ce31d33b539" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.1" + }, + "timestamp": "2024-05-22T19:08:47.822066" + }, + "versions": { + "content": [ + [ + "versions.yml:md5,80647c2956e504334ad25ce31d33b539" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.1" + }, + "timestamp": "2024-05-22T19:09:02.94685" + } +} diff --git a/modules/nf-core/chromap/chromap/tests/nextflow.config b/modules/nf-core/chromap/chromap/tests/nextflow.config new file mode 100644 index 00000000000..51b96a98917 --- /dev/null +++ b/modules/nf-core/chromap/chromap/tests/nextflow.config @@ -0,0 +1,7 @@ +process { + + withName: CHROMAP_CHROMAP { + ext.args = '--SAM' + } + +} diff --git a/modules/nf-core/chromap/chromap/tests/tags.yml b/modules/nf-core/chromap/chromap/tests/tags.yml new file mode 100644 index 00000000000..3b288fa273a --- /dev/null +++ b/modules/nf-core/chromap/chromap/tests/tags.yml @@ -0,0 +1,2 @@ +chromap/chromap: + - modules/nf-core/chromap/chromap/** diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index b58d208c833..a0f6ad1c1c9 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -268,9 +268,6 @@ cellrangeratac/mkref: checkm/qa: - modules/nf-core/checkm/qa/** - tests/modules/nf-core/checkm/qa/** -chromap/chromap: - - modules/nf-core/chromap/chromap/** - - tests/modules/nf-core/chromap/chromap/** circexplorer2/annotate: - modules/nf-core/circexplorer2/annotate/** - tests/modules/nf-core/circexplorer2/annotate/** diff --git a/tests/modules/nf-core/chromap/chromap/main.nf b/tests/modules/nf-core/chromap/chromap/main.nf deleted file mode 100644 index 0509022d0da..00000000000 --- a/tests/modules/nf-core/chromap/chromap/main.nf +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { CHROMAP_INDEX } from '../../../../../modules/nf-core/chromap/index/main.nf' -include { CHROMAP_CHROMAP as CHROMAP_CHROMAP_BASE } from '../../../../../modules/nf-core/chromap/chromap/main.nf' -include { CHROMAP_CHROMAP as CHROMAP_CHROMAP_SAM } from '../../../../../modules/nf-core/chromap/chromap/main.nf' - -workflow test_chromap_chromap_single_end { - - // Test single-end and gz compressed output - input = [ - [ id:'test', single_end:true ], // meta map - [ - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) - ] - ] - fasta = [ - [ id:'test' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - - CHROMAP_INDEX ( fasta ) - CHROMAP_CHROMAP_BASE ( - input, // meta + read data - fasta, // reference genome - CHROMAP_INDEX.out.index, // reference index - [], // barcode file - [], // barcode whitelist - [], // chromosome order file - [] // pairs chromosome order file - ) -} - -workflow test_chromap_chromap_paired_end { - - // Test paired-end and gz compressed output - input = [ - [ id:'test', single_end:false ], // meta map - [ - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) - ] - ] - fasta = [ - [ id:'test' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - - CHROMAP_INDEX ( fasta ) - CHROMAP_CHROMAP_BASE ( - input, // meta + read data - fasta, // reference genome - CHROMAP_INDEX.out.index, // reference index - [], // barcode file - [], // barcode whitelist - [], // chromosome order file - [] // pairs chromosome order file - ) -} - -workflow test_chromap_chromap_paired_bam { - - // Test paired-end and bam output - input = [ - [ id:'test', single_end:false ], // meta map - [ - file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) - ] - ] - fasta = [ - [ id:'test' ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - - CHROMAP_INDEX ( fasta ) - CHROMAP_CHROMAP_SAM ( - input, // meta + read data - fasta, // reference genome - CHROMAP_INDEX.out.index, // reference index - [], // barcode file - [], // barcode whitelist - [], // chromosome order file - [] // pairs chromosome order file - ) -} diff --git a/tests/modules/nf-core/chromap/chromap/nextflow.config b/tests/modules/nf-core/chromap/chromap/nextflow.config deleted file mode 100644 index 1e979bb9e8e..00000000000 --- a/tests/modules/nf-core/chromap/chromap/nextflow.config +++ /dev/null @@ -1,9 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: CHROMAP_CHROMAP_SAM { - ext.args = '--SAM' - } - -} diff --git a/tests/modules/nf-core/chromap/chromap/test.yml b/tests/modules/nf-core/chromap/chromap/test.yml deleted file mode 100644 index 7c1a9a0edcf..00000000000 --- a/tests/modules/nf-core/chromap/chromap/test.yml +++ /dev/null @@ -1,32 +0,0 @@ -- name: chromap chromap test_chromap_chromap_single_end - command: nextflow run ./tests/modules/nf-core/chromap/chromap -entry test_chromap_chromap_single_end -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/chromap/chromap/nextflow.config - tags: - - chromap/chromap - - chromap - files: - - path: output/chromap/genome.index - - path: output/chromap/test.bed.gz - md5sum: 25e40bde24c7b447292cd68573728694 - - path: output/chromap/versions.yml - -- name: chromap chromap test_chromap_chromap_paired_end - command: nextflow run ./tests/modules/nf-core/chromap/chromap -entry test_chromap_chromap_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/chromap/chromap/nextflow.config - tags: - - chromap/chromap - - chromap - files: - - path: output/chromap/genome.index - - path: output/chromap/test.bed.gz - md5sum: 7cdc8448882b75811e0c784f5f20aef2 - - path: output/chromap/versions.yml - -- name: chromap chromap test_chromap_chromap_paired_bam - command: nextflow run ./tests/modules/nf-core/chromap/chromap -entry test_chromap_chromap_paired_bam -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/chromap/chromap/nextflow.config - tags: - - chromap/chromap - - chromap - files: - - path: output/chromap/genome.index - - path: output/chromap/test.bam - md5sum: 7f8af20a3fa52b2a8967977f0376f466 - - path: output/chromap/versions.yml From 5f7195c5a3e889a03c31c43aec72a65f8b1f9282 Mon Sep 17 00:00:00 2001 From: Usman Rashid Date: Thu, 23 May 2024 20:02:54 +1200 Subject: [PATCH 22/24] Migrated merqury to nf-test and moved to merqury/merqury to make room for merqury/hapmers (#5657) * Migrated to nf-test * Moved to merqury/merqury * Fixed test issues * Moved pngs to name check * Added version warn and trio mode test --- .../merqury/{ => merqury}/environment.yml | 2 +- modules/nf-core/merqury/{ => merqury}/main.nf | 32 +- .../nf-core/merqury/{ => merqury}/meta.yml | 9 +- .../merqury/merqury/tests/main.nf.test | 189 +++++++ .../merqury/merqury/tests/main.nf.test.snap | 494 ++++++++++++++++++ .../nf-core/merqury/merqury/tests/tags.yml | 2 + tests/config/pytest_modules.yml | 3 - tests/modules/nf-core/merqury/main.nf | 26 - tests/modules/nf-core/merqury/nextflow.config | 10 - tests/modules/nf-core/merqury/test.yml | 34 -- 10 files changed, 723 insertions(+), 78 deletions(-) rename modules/nf-core/merqury/{ => merqury}/environment.yml (80%) rename modules/nf-core/merqury/{ => merqury}/main.nf (66%) rename modules/nf-core/merqury/{ => merqury}/meta.yml (94%) create mode 100644 modules/nf-core/merqury/merqury/tests/main.nf.test create mode 100644 modules/nf-core/merqury/merqury/tests/main.nf.test.snap create mode 100644 modules/nf-core/merqury/merqury/tests/tags.yml delete mode 100644 tests/modules/nf-core/merqury/main.nf delete mode 100644 tests/modules/nf-core/merqury/nextflow.config delete mode 100644 tests/modules/nf-core/merqury/test.yml diff --git a/modules/nf-core/merqury/environment.yml b/modules/nf-core/merqury/merqury/environment.yml similarity index 80% rename from modules/nf-core/merqury/environment.yml rename to modules/nf-core/merqury/merqury/environment.yml index b73f4aea5a8..722c47c1f20 100644 --- a/modules/nf-core/merqury/environment.yml +++ b/modules/nf-core/merqury/merqury/environment.yml @@ -1,4 +1,4 @@ -name: merqury +name: merqury_merqury channels: - conda-forge - bioconda diff --git a/modules/nf-core/merqury/main.nf b/modules/nf-core/merqury/merqury/main.nf similarity index 66% rename from modules/nf-core/merqury/main.nf rename to modules/nf-core/merqury/merqury/main.nf index 26aac4f3136..ca8795a9e3c 100644 --- a/modules/nf-core/merqury/main.nf +++ b/modules/nf-core/merqury/merqury/main.nf @@ -1,7 +1,8 @@ -process MERQURY { +process MERQURY_MERQURY { tag "$meta.id" label 'process_low' + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/merqury:1.3--hdfd78af_1': @@ -26,6 +27,7 @@ process MERQURY { tuple val(meta), path("${prefix}.qv") , emit: assembly_qv tuple val(meta), path("${prefix}.*.qv") , emit: scaffold_qv tuple val(meta), path("*.hist.ploidy") , emit: read_ploidy + tuple val(meta), path("*.hapmers.blob.png") , emit: hapmers_blob_png , optional: true path "versions.yml" , emit: versions when: @@ -34,7 +36,7 @@ process MERQURY { script: // def args = task.ext.args ?: '' prefix = task.ext.prefix ?: "${meta.id}" - def VERSION = 1.3 + def VERSION = 1.3 // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ # Nextflow changes the container --entrypoint to /bin/bash (container default entrypoint: /usr/local/env-execute) # Check for container variable initialisation script and source it. @@ -56,4 +58,30 @@ process MERQURY { merqury: $VERSION END_VERSIONS """ + + stub: + prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = 1.3 // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + """ + touch ${prefix}_only.bed + touch ${prefix}_only.wig + touch ${prefix}.completeness.stats + touch ${prefix}.dist_only.hist + touch ${prefix}.spectra-cn.fl.png + touch ${prefix}.spectra-cn.hist + touch ${prefix}.spectra-cn.ln.png + touch ${prefix}.spectra-cn.st.png + touch ${prefix}.spectra-asm.fl.png + touch ${prefix}.spectra-asm.hist + touch ${prefix}.spectra-asm.ln.png + touch ${prefix}.spectra-asm.st.png + touch ${prefix}.qv + touch ${prefix}.${prefix}.qv + touch ${prefix}.hist.ploidy + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + merqury: $VERSION + END_VERSIONS + """ } diff --git a/modules/nf-core/merqury/meta.yml b/modules/nf-core/merqury/merqury/meta.yml similarity index 94% rename from modules/nf-core/merqury/meta.yml rename to modules/nf-core/merqury/merqury/meta.yml index 88825386833..19cb11b38f4 100644 --- a/modules/nf-core/merqury/meta.yml +++ b/modules/nf-core/merqury/merqury/meta.yml @@ -1,4 +1,4 @@ -name: "merqury" +name: "merqury_merqury" description: k-mer based assembly evaluation. keywords: - "k-mer" @@ -9,7 +9,7 @@ tools: description: "Evaluate genome assemblies with k-mers and more." tool_dev_url: "https://github.com/marbl/merqury" doi: "10.1186/s13059-020-02134-9" - licence: "['PUBLIC DOMAIN']" + licence: ["PUBLIC DOMAIN"] input: - meta: type: map @@ -92,7 +92,12 @@ output: type: file description: "Ploidy estimate from read k-mer database" pattern: "*.hist.ploidy" + - hapmers_blob_png: + type: file + description: "Hap-mer blob plot" + pattern: "*.hapmers.blob.png" authors: - "@mahesh-panchal" maintainers: - "@mahesh-panchal" + - "@gallvp" diff --git a/modules/nf-core/merqury/merqury/tests/main.nf.test b/modules/nf-core/merqury/merqury/tests/main.nf.test new file mode 100644 index 00000000000..34c7b46c931 --- /dev/null +++ b/modules/nf-core/merqury/merqury/tests/main.nf.test @@ -0,0 +1,189 @@ +nextflow_process { + + name "Test Process MERQURY_MERQURY" + script "../main.nf" + process "MERQURY_MERQURY" + + tag "modules" + tag "modules_nfcore" + tag "merqury" + tag "merqury/merqury" + tag "meryl/count" + tag "meryl/unionsum" + + setup { + run("MERYL_COUNT") { + script "../../../meryl/count" + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.test_data['homo_sapiens']['illumina']['test_1_fastq_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_2_fastq_gz'], checkIfExists: true) + ] + ] + input[1] = 21 + """ + } + } + + run("MERYL_UNIONSUM") { + script "../../../meryl/unionsum" + process { + """ + input[0] = MERYL_COUNT.out.meryl_db + input[1] = 21 + """ + } + } + } + + test("homo_sapiens-genome") { + + when { + process { + """ + assembly = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + ] + input[0] = MERYL_UNIONSUM.out.meryl_db.join( Channel.value( assembly ) ) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.assembly_only_kmers_bed, + process.out.assembly_only_kmers_wig, + process.out.stats, + process.out.dist_hist, + process.out.spectra_cn_hist, + process.out.spectra_asm_hist, + process.out.assembly_qv, + process.out.scaffold_qv, + process.out.read_ploidy, + process.out.versions, + file(process.out.spectra_cn_fl_png[0][1]).name, + file(process.out.spectra_cn_ln_png[0][1]).name, + file(process.out.spectra_cn_st_png[0][1]).name, + file(process.out.spectra_asm_fl_png[0][1]).name, + file(process.out.spectra_asm_ln_png[0][1]).name, + file(process.out.spectra_asm_st_png[0][1]).name + ).match() + }, + { assert process.out.hapmers_blob_png == [] } + ) + } + + } + + test("homo_sapiens-genome-trio") { + + setup { + run("MERYL_COUNT", alias: "MATERNAL_COUNT") { + script "../../../meryl/count" + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.test_data['homo_sapiens']['illumina']['test2_1_fastq_gz'], checkIfExists: true) + ] + ] + input[1] = 21 + """ + } + } + + run("MERYL_COUNT", alias: "PATERNAL_COUNT") { + script "../../../meryl/count" + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + [ + file(params.test_data['homo_sapiens']['illumina']['test2_2_fastq_gz'], checkIfExists: true) + ] + ] + input[1] = 21 + """ + } + } + } + + when { + process { + """ + ch_assembly = Channel.value([ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + ]) + + ch_input = MERYL_UNIONSUM.out.meryl_db + | join( MATERNAL_COUNT.out.meryl_db ) + | join( PATERNAL_COUNT.out.meryl_db ) + | join( ch_assembly ) + | map { meta, meryl, mat_meryl, pat_meryl, fasta -> [ meta, [ meryl, mat_meryl, pat_meryl ], fasta ] } + input[0] = ch_input + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.assembly_only_kmers_bed, + process.out.assembly_only_kmers_wig, + process.out.stats, + process.out.dist_hist, + process.out.spectra_cn_hist, + process.out.spectra_asm_hist, + process.out.assembly_qv, + process.out.scaffold_qv, + process.out.read_ploidy, + process.out.versions, + process.out.spectra_cn_fl_png[0][1] .collect { file(it).name }.join(','), + process.out.spectra_cn_ln_png[0][1] .collect { file(it).name }.join(','), + process.out.spectra_cn_st_png[0][1] .collect { file(it).name }.join(','), + file(process.out.spectra_asm_fl_png[0][1]).name, + file(process.out.spectra_asm_ln_png[0][1]).name, + file(process.out.spectra_asm_st_png[0][1]).name, + file(process.out.hapmers_blob_png[0][1]).name, + ).match() + } + ) + } + + } + + test("homo_sapiens-genome-stub") { + + options '-stub' + + when { + process { + """ + assembly = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + ] + input[0] = MERYL_UNIONSUM.out.meryl_db.join( Channel.value( assembly ) ) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/nf-core/merqury/merqury/tests/main.nf.test.snap b/modules/nf-core/merqury/merqury/tests/main.nf.test.snap new file mode 100644 index 00000000000..d96fa7efca5 --- /dev/null +++ b/modules/nf-core/merqury/merqury/tests/main.nf.test.snap @@ -0,0 +1,494 @@ +{ + "homo_sapiens-genome-stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_only.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test_only.wig:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "10": [ + [ + { + "id": "test", + "single_end": false + }, + "test.spectra-asm.ln.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "11": [ + [ + { + "id": "test", + "single_end": false + }, + "test.spectra-asm.st.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "12": [ + [ + { + "id": "test", + "single_end": false + }, + "test.qv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "13": [ + [ + { + "id": "test", + "single_end": false + }, + "test.test.qv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "14": [ + [ + { + "id": "test", + "single_end": false + }, + "test.hist.ploidy:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "15": [ + + ], + "16": [ + "versions.yml:md5,825a4c61369638389227eee16dfb08b5" + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.completeness.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.dist_only.hist:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + { + "id": "test", + "single_end": false + }, + "test.spectra-cn.fl.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": false + }, + "test.spectra-cn.hist:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": false + }, + "test.spectra-cn.ln.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": false + }, + "test.spectra-cn.st.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + [ + { + "id": "test", + "single_end": false + }, + "test.spectra-asm.fl.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "9": [ + [ + { + "id": "test", + "single_end": false + }, + "test.spectra-asm.hist:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "assembly_only_kmers_bed": [ + [ + { + "id": "test", + "single_end": false + }, + "test_only.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "assembly_only_kmers_wig": [ + [ + { + "id": "test", + "single_end": false + }, + "test_only.wig:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "assembly_qv": [ + [ + { + "id": "test", + "single_end": false + }, + "test.qv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "dist_hist": [ + [ + { + "id": "test", + "single_end": false + }, + "test.dist_only.hist:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "hapmers_blob_png": [ + + ], + "read_ploidy": [ + [ + { + "id": "test", + "single_end": false + }, + "test.hist.ploidy:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "scaffold_qv": [ + [ + { + "id": "test", + "single_end": false + }, + "test.test.qv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "spectra_asm_fl_png": [ + [ + { + "id": "test", + "single_end": false + }, + "test.spectra-asm.fl.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "spectra_asm_hist": [ + [ + { + "id": "test", + "single_end": false + }, + "test.spectra-asm.hist:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "spectra_asm_ln_png": [ + [ + { + "id": "test", + "single_end": false + }, + "test.spectra-asm.ln.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "spectra_asm_st_png": [ + [ + { + "id": "test", + "single_end": false + }, + "test.spectra-asm.st.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "spectra_cn_fl_png": [ + [ + { + "id": "test", + "single_end": false + }, + "test.spectra-cn.fl.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "spectra_cn_hist": [ + [ + { + "id": "test", + "single_end": false + }, + "test.spectra-cn.hist:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "spectra_cn_ln_png": [ + [ + { + "id": "test", + "single_end": false + }, + "test.spectra-cn.ln.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "spectra_cn_st_png": [ + [ + { + "id": "test", + "single_end": false + }, + "test.spectra-cn.st.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "stats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.completeness.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,825a4c61369638389227eee16dfb08b5" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-22T21:00:35.907142" + }, + "homo_sapiens-genome": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "genome_only.bed:md5,b611f22cde0e410a2ca07c1eefd042d3" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "genome_only.wig:md5,19cf44989af72af597ef80d3489b4882" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.completeness.stats:md5,d923bf7c98342625d022b2c32be8dd3a" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.dist_only.hist:md5,e2e6b54b0febef1f0fcf24cd2afd0b7a" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.genome.spectra-cn.hist:md5,6140a138ba47cb2b97814c93f80b2575" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.spectra-asm.hist:md5,541c9d1f87ab5c44df5e9e0acc440f8d" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.qv:md5,6e04952bc182221c8b9e242dc3298808" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.genome.qv:md5,c554315aabcc4207c367805cf3090da3" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.unionsum.hist.ploidy:md5,16cf2fd89ed870c9cceb269e8430169a" + ] + ], + [ + "versions.yml:md5,825a4c61369638389227eee16dfb08b5" + ], + "test.genome.spectra-cn.fl.png", + "test.genome.spectra-cn.ln.png", + "test.genome.spectra-cn.st.png", + "test.spectra-asm.fl.png", + "test.spectra-asm.ln.png", + "test.spectra-asm.st.png" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-22T21:52:39.004978" + }, + "homo_sapiens-genome-trio": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "genome_only.bed:md5,b611f22cde0e410a2ca07c1eefd042d3" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "genome_only.wig:md5,19cf44989af72af597ef80d3489b4882" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.completeness.stats:md5,58b3933129832d64652babd80688eec3" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.dist_only.hist:md5,e2e6b54b0febef1f0fcf24cd2afd0b7a" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.genome.spectra-cn.hist:md5,6140a138ba47cb2b97814c93f80b2575" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.spectra-asm.hist:md5,541c9d1f87ab5c44df5e9e0acc440f8d" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.qv:md5,6e04952bc182221c8b9e242dc3298808" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.genome.qv:md5,c554315aabcc4207c367805cf3090da3" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.unionsum.hist.ploidy:md5,16cf2fd89ed870c9cceb269e8430169a" + ] + ], + [ + "versions.yml:md5,825a4c61369638389227eee16dfb08b5" + ], + "test.genome.read.test2_1.spectra-cn.fl.png,test.genome.read.test2_2.spectra-cn.fl.png,test.genome.spectra-cn.fl.png", + "test.genome.read.test2_1.spectra-cn.ln.png,test.genome.read.test2_2.spectra-cn.ln.png,test.genome.spectra-cn.ln.png", + "test.genome.read.test2_1.spectra-cn.st.png,test.genome.read.test2_2.spectra-cn.st.png,test.genome.spectra-cn.st.png", + "test.spectra-asm.fl.png", + "test.spectra-asm.ln.png", + "test.spectra-asm.st.png", + "test.hapmers.blob.png" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-23T10:37:10.601154" + } +} \ No newline at end of file diff --git a/modules/nf-core/merqury/merqury/tests/tags.yml b/modules/nf-core/merqury/merqury/tests/tags.yml new file mode 100644 index 00000000000..af157f18740 --- /dev/null +++ b/modules/nf-core/merqury/merqury/tests/tags.yml @@ -0,0 +1,2 @@ +merqury/merqury: + - "modules/nf-core/merqury/merqury/**" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index a0f6ad1c1c9..aac399c86cd 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1046,9 +1046,6 @@ melt: meningotype: - modules/nf-core/meningotype/** - tests/modules/nf-core/meningotype/** -merqury: - - modules/nf-core/merqury/** - - tests/modules/nf-core/merqury/** merquryfk/katcomp: - modules/nf-core/merquryfk/katcomp/** - tests/modules/nf-core/merquryfk/katcomp/** diff --git a/tests/modules/nf-core/merqury/main.nf b/tests/modules/nf-core/merqury/main.nf deleted file mode 100644 index 7d525446512..00000000000 --- a/tests/modules/nf-core/merqury/main.nf +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { MERYL_COUNT } from '../../../../modules/nf-core/meryl/count/main.nf' -include { MERYL_UNIONSUM } from '../../../../modules/nf-core/meryl/unionsum/main.nf' -include { MERQURY } from '../../../../modules/nf-core/merqury/main.nf' - -workflow test_merqury { - - input = [ - [ id:'test', single_end:false ], // meta map - [ - file(params.test_data['homo_sapiens']['illumina']['test_1_fastq_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_2_fastq_gz'], checkIfExists: true) - ] - ] - assembly = [ - [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - ] - - MERYL_COUNT ( input ) - MERYL_UNIONSUM ( MERYL_COUNT.out.meryl_db ) - MERQURY ( MERYL_UNIONSUM.out.meryl_db.join( Channel.value( assembly ) ) ) -} diff --git a/tests/modules/nf-core/merqury/nextflow.config b/tests/modules/nf-core/merqury/nextflow.config deleted file mode 100644 index 3b8d00cae42..00000000000 --- a/tests/modules/nf-core/merqury/nextflow.config +++ /dev/null @@ -1,10 +0,0 @@ -process { - - withName: 'MERQURY' { - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - } - - withName: 'MERYL_COUNT' { - ext.args = 'k=21' - } -} diff --git a/tests/modules/nf-core/merqury/test.yml b/tests/modules/nf-core/merqury/test.yml deleted file mode 100644 index cbc02eba44b..00000000000 --- a/tests/modules/nf-core/merqury/test.yml +++ /dev/null @@ -1,34 +0,0 @@ -- name: merqury test_merqury - command: nextflow run ./tests/modules/nf-core/merqury -entry test_merqury -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/merqury/nextflow.config - tags: - - merqury - files: - - path: output/merqury/genome_only.bed - md5sum: b611f22cde0e410a2ca07c1eefd042d3 - - path: output/merqury/genome_only.wig - md5sum: 19cf44989af72af597ef80d3489b4882 - - path: output/merqury/test.completeness.stats - - path: output/merqury/test.dist_only.hist - md5sum: e2e6b54b0febef1f0fcf24cd2afd0b7a - - path: output/merqury/test.genome.qv - md5sum: c554315aabcc4207c367805cf3090da3 - - path: output/merqury/test.genome.spectra-cn.fl.png - md5sum: 3265701cbb1ddaed6d5cb6b4560564fd - - path: output/merqury/test.genome.spectra-cn.hist - md5sum: 6140a138ba47cb2b97814c93f80b2575 - - path: output/merqury/test.genome.spectra-cn.ln.png - md5sum: 6386b604a8f0fbc43a1e3473ad9a779e - - path: output/merqury/test.genome.spectra-cn.st.png - md5sum: d5af80c91d23b182589b0ec131047f00 - - path: output/merqury/test.qv - md5sum: 6e04952bc182221c8b9e242dc3298808 - - path: output/merqury/test.spectra-asm.fl.png - md5sum: 60920481d988018a4f36a9be5b10c4ec - - path: output/merqury/test.spectra-asm.hist - md5sum: 541c9d1f87ab5c44df5e9e0acc440f8d - - path: output/merqury/test.spectra-asm.ln.png - md5sum: 54790dd54b5d8948d3676d32da1972df - - path: output/merqury/test.spectra-asm.st.png - md5sum: 010e013b5411ab2790e9a93ee70a574a - - path: output/merqury/test.unionsumdb.hist.ploidy - md5sum: f6904468b41a495c7ce255a7a5f3a302 From 0e04b949c90e686c8b07495576832d78ab9210cf Mon Sep 17 00:00:00 2001 From: Simon Pearce <24893913+SPPearce@users.noreply.github.com> Date: Thu, 23 May 2024 13:16:49 +0100 Subject: [PATCH 23/24] Swap ngscheckmate/ncm to nftest (#5679) * Swap ngscheckmate/ncm to nftest * Update main.nf.test --- modules/nf-core/ngscheckmate/ncm/main.nf | 1 + .../nf-core/ngscheckmate/ncm/tests/bam.config | 5 + .../ngscheckmate/ncm/tests/main.nf.test | 184 +++++++++++++ .../ngscheckmate/ncm/tests/main.nf.test.snap | 249 ++++++++++++++++++ .../ngscheckmate/ncm/tests}/nextflow.config | 17 +- .../nf-core/ngscheckmate/ncm/tests/tags.yml | 2 + .../nf-core/ngscheckmate/ncm/tests/vcf.config | 5 + tests/config/pytest_modules.yml | 3 - .../modules/nf-core/ngscheckmate/ncm/main.nf | 69 ----- .../modules/nf-core/ngscheckmate/ncm/test.yml | 44 ---- 10 files changed, 448 insertions(+), 131 deletions(-) create mode 100644 modules/nf-core/ngscheckmate/ncm/tests/bam.config create mode 100644 modules/nf-core/ngscheckmate/ncm/tests/main.nf.test create mode 100644 modules/nf-core/ngscheckmate/ncm/tests/main.nf.test.snap rename {tests/modules/nf-core/ngscheckmate/ncm => modules/nf-core/ngscheckmate/ncm/tests}/nextflow.config (51%) create mode 100644 modules/nf-core/ngscheckmate/ncm/tests/tags.yml create mode 100644 modules/nf-core/ngscheckmate/ncm/tests/vcf.config delete mode 100644 tests/modules/nf-core/ngscheckmate/ncm/main.nf delete mode 100644 tests/modules/nf-core/ngscheckmate/ncm/test.yml diff --git a/modules/nf-core/ngscheckmate/ncm/main.nf b/modules/nf-core/ngscheckmate/ncm/main.nf index 99921ddcc5e..d5500a257c5 100644 --- a/modules/nf-core/ngscheckmate/ncm/main.nf +++ b/modules/nf-core/ngscheckmate/ncm/main.nf @@ -48,6 +48,7 @@ process NGSCHECKMATE_NCM { """ stub: + def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "$meta.id" """ touch ${prefix}_output_corr_matrix.txt diff --git a/modules/nf-core/ngscheckmate/ncm/tests/bam.config b/modules/nf-core/ngscheckmate/ncm/tests/bam.config new file mode 100644 index 00000000000..09805c1614f --- /dev/null +++ b/modules/nf-core/ngscheckmate/ncm/tests/bam.config @@ -0,0 +1,5 @@ +process { + withName: NGSCHECKMATE_NCM { + ext.args = '-B' + } +} diff --git a/modules/nf-core/ngscheckmate/ncm/tests/main.nf.test b/modules/nf-core/ngscheckmate/ncm/tests/main.nf.test new file mode 100644 index 00000000000..9dafbdf6df1 --- /dev/null +++ b/modules/nf-core/ngscheckmate/ncm/tests/main.nf.test @@ -0,0 +1,184 @@ +nextflow_process { + + name "Test Process NGSCHECKMATE_NCM" + script "../main.nf" + process "NGSCHECKMATE_NCM" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "ngscheckmate" + tag "ngscheckmate/ncm" + tag "bedtools/makewindows" + tag "bcftools/mpileup" + + setup { + + run("BEDTOOLS_MAKEWINDOWS") { + script "../../../bedtools/makewindows/main.nf" + process { + """ + input[0] = [ [ id:'test' ], + file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + ] + """ + } + } + + run("BCFTOOLS_MPILEUP", alias: "BCFTOOLS_MPILEUP1") { + script "../../../bcftools/mpileup/main.nf" + process { + """ + input[0] = [ + [ id:'test1' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + ] + input[1] = [ [ id:'sarscov2' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + input[2] = false + """ + } + } + + run("BCFTOOLS_MPILEUP", alias: "BCFTOOLS_MPILEUP2") { + script "../../../bcftools/mpileup/main.nf" + process { + """ + input[0] = [ + [ id:'test2' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + ] + input[1] = [ [ id:'sarscov2' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + input[2] = false + """ + } + } + + } + + + test("sarscov2 - bam") { + config "./bam.config" + when { + process { + """ + input[0] = [ [ id: 'combined_bams' ], + [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 ), + file(params.test_data['sarscov2']['illumina']['test_paired_end_methylated_sorted_bam'] , checkIfExists: true ), + file(params.test_data['sarscov2']['illumina']['test_paired_end_methylated_sorted_bam_bai'], checkIfExists: true ) + ] + ] + input[1] = BEDTOOLS_MAKEWINDOWS.out.bed + input[2] = [ [ id:'sarscov2' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.corr_matrix, + process.out.matched, + process.out.all, + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - vcf") { + config "./vcf.config" + when { + process { + """ + input[0] = BCFTOOLS_MPILEUP1.out.vcf.combine(BCFTOOLS_MPILEUP2.out.vcf.map{it[1]}).map{meta, one, two -> [meta, [one, two]]}.map{meta, stuff -> [meta, stuff.flatten()]} + input[1] = BEDTOOLS_MAKEWINDOWS.out.bed + input[2] = [ [ id:'sarscov2' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.corr_matrix, + process.out.matched, + process.out.all, + file(process.out.pdf[0][1]).name, + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - bam - stub") { + + options "-stub" + config "./bam.config" + when { + process { + """ + input[0] = [ [ id: 'combined_bams' ], + [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 ), + file(params.test_data['sarscov2']['illumina']['test_paired_end_methylated_sorted_bam'] , checkIfExists: true ), + file(params.test_data['sarscov2']['illumina']['test_paired_end_methylated_sorted_bam_bai'], checkIfExists: true ) + ] + ] + input[1] = BEDTOOLS_MAKEWINDOWS.out.bed + input[2] = [ [ id:'sarscov2' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - vcf - stub") { + + options "-stub" + config "./vcf.config" + when { + process { + """ + input[0] = BCFTOOLS_MPILEUP1.out.vcf.combine(BCFTOOLS_MPILEUP2.out.vcf.map{it[1]}) + input[1] = BEDTOOLS_MAKEWINDOWS.out.bed + input[2] = [ [ id:'sarscov2' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/ngscheckmate/ncm/tests/main.nf.test.snap b/modules/nf-core/ngscheckmate/ncm/tests/main.nf.test.snap new file mode 100644 index 00000000000..46a98ccc988 --- /dev/null +++ b/modules/nf-core/ngscheckmate/ncm/tests/main.nf.test.snap @@ -0,0 +1,249 @@ +{ + "sarscov2 - bam - stub": { + "content": [ + { + "0": [ + [ + { + "id": "combined_bams" + }, + "combined_bams_output_corr_matrix.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "combined_bams" + }, + "combined_bams_matched.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "combined_bams" + }, + "combined_bams_all.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "combined_bams" + }, + "combined_bams.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + + ], + "5": [ + "versions.yml:md5,7ac92d9cbf4fc44b3253832f3a8b2a80" + ], + "all": [ + [ + { + "id": "combined_bams" + }, + "combined_bams_all.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "corr_matrix": [ + [ + { + "id": "combined_bams" + }, + "combined_bams_output_corr_matrix.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "matched": [ + [ + { + "id": "combined_bams" + }, + "combined_bams_matched.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "pdf": [ + [ + { + "id": "combined_bams" + }, + "combined_bams.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + + ], + "versions": [ + "versions.yml:md5,7ac92d9cbf4fc44b3253832f3a8b2a80" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.1" + }, + "timestamp": "2024-05-22T15:02:55.532427413" + }, + "sarscov2 - vcf": { + "content": [ + [ + [ + { + "id": "test1" + }, + "test1_output_corr_matrix.txt:md5,0c86bdad2721c470fe6be119f291c8e5" + ] + ], + [ + [ + { + "id": "test1" + }, + "test1_matched.txt:md5,fd74956dcac279b6f58e82ea73e344f8" + ] + ], + [ + [ + { + "id": "test1" + }, + "test1_all.txt:md5,fd74956dcac279b6f58e82ea73e344f8" + ] + ], + "test1.pdf", + [ + "versions.yml:md5,7ac92d9cbf4fc44b3253832f3a8b2a80" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.1" + }, + "timestamp": "2024-05-22T19:53:29.123160766" + }, + "sarscov2 - bam": { + "content": [ + [ + [ + { + "id": "combined_bams" + }, + "combined_bams_output_corr_matrix.txt:md5,b8bfd203232680b746ac91ccb290b5e3" + ] + ], + [ + [ + { + "id": "combined_bams" + }, + "combined_bams_matched.txt:md5,14d0b35765e127aab0ffa5ea5406b4ab" + ] + ], + [ + [ + { + "id": "combined_bams" + }, + "combined_bams_all.txt:md5,14d0b35765e127aab0ffa5ea5406b4ab" + ] + ], + [ + "versions.yml:md5,7ac92d9cbf4fc44b3253832f3a8b2a80" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.1" + }, + "timestamp": "2024-05-22T16:04:35.032277154" + }, + "sarscov2 - vcf - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test1" + }, + "test1_output_corr_matrix.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test1" + }, + "test1_matched.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test1" + }, + "test1_all.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test1" + }, + "test1.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + + ], + "5": [ + "versions.yml:md5,7ac92d9cbf4fc44b3253832f3a8b2a80" + ], + "all": [ + [ + { + "id": "test1" + }, + "test1_all.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "corr_matrix": [ + [ + { + "id": "test1" + }, + "test1_output_corr_matrix.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "matched": [ + [ + { + "id": "test1" + }, + "test1_matched.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "pdf": [ + [ + { + "id": "test1" + }, + "test1.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + + ], + "versions": [ + "versions.yml:md5,7ac92d9cbf4fc44b3253832f3a8b2a80" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.1" + }, + "timestamp": "2024-05-22T15:20:40.816531052" + } +} \ No newline at end of file diff --git a/tests/modules/nf-core/ngscheckmate/ncm/nextflow.config b/modules/nf-core/ngscheckmate/ncm/tests/nextflow.config similarity index 51% rename from tests/modules/nf-core/ngscheckmate/ncm/nextflow.config rename to modules/nf-core/ngscheckmate/ncm/tests/nextflow.config index e0930e01e59..cf3d42a0e98 100644 --- a/tests/modules/nf-core/ngscheckmate/ncm/nextflow.config +++ b/modules/nf-core/ngscheckmate/ncm/tests/nextflow.config @@ -1,28 +1,15 @@ process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - withName: BEDTOOLS_MAKEWINDOWS { ext.args = '-w 1' ext.prefix = 'test_split' } - - withName: BCFTOOLS_MPILEUP { + withName: BCFTOOLS_MPILEUP1 { ext.args2 = '--no-version --ploidy 1 --multiallelic-caller' ext.args3 = '--no-version' } - - withName: BCFTOOLS_MPILEUP_TWO { + withName: BCFTOOLS_MPILEUP2 { ext.args2 = '--no-version --ploidy 1 --multiallelic-caller' ext.args3 = '--no-version' } - withName: NGSCHECKMATE_NCM_VCF { - ext.args = '-V' - } - - withName: NGSCHECKMATE_NCM_BAM { - ext.args = '-B' - } - } diff --git a/modules/nf-core/ngscheckmate/ncm/tests/tags.yml b/modules/nf-core/ngscheckmate/ncm/tests/tags.yml new file mode 100644 index 00000000000..f9f60445161 --- /dev/null +++ b/modules/nf-core/ngscheckmate/ncm/tests/tags.yml @@ -0,0 +1,2 @@ +ngscheckmate/ncm: + - "modules/nf-core/ngscheckmate/ncm/**" diff --git a/modules/nf-core/ngscheckmate/ncm/tests/vcf.config b/modules/nf-core/ngscheckmate/ncm/tests/vcf.config new file mode 100644 index 00000000000..67053c14dab --- /dev/null +++ b/modules/nf-core/ngscheckmate/ncm/tests/vcf.config @@ -0,0 +1,5 @@ + process { + withName: NGSCHECKMATE_NCM { + ext.args = '-V' + } + } diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index aac399c86cd..beac40b57b5 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1202,9 +1202,6 @@ ngmerge: ngscheckmate/fastq: - modules/nf-core/ngscheckmate/fastq/** - tests/modules/nf-core/ngscheckmate/fastq/** -ngscheckmate/ncm: - - modules/nf-core/ngscheckmate/ncm/** - - tests/modules/nf-core/ngscheckmate/ncm/** ngscheckmate/patterngenerator: - modules/nf-core/ngscheckmate/patterngenerator/** - tests/modules/nf-core/ngscheckmate/patterngenerator/** diff --git a/tests/modules/nf-core/ngscheckmate/ncm/main.nf b/tests/modules/nf-core/ngscheckmate/ncm/main.nf deleted file mode 100644 index 8333b408d51..00000000000 --- a/tests/modules/nf-core/ngscheckmate/ncm/main.nf +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { NGSCHECKMATE_NCM as NGSCHECKMATE_NCM_BAM} from '../../../../../modules/nf-core/ngscheckmate/ncm/main.nf' -include { NGSCHECKMATE_NCM as NGSCHECKMATE_NCM_VCF} from '../../../../../modules/nf-core/ngscheckmate/ncm/main.nf' - -include { BEDTOOLS_MAKEWINDOWS } from '../../../../../modules/nf-core/bedtools/makewindows/main.nf' - -include { BCFTOOLS_MPILEUP } from '../../../../../modules/nf-core/bcftools/mpileup/main.nf' -include { BCFTOOLS_MPILEUP as BCFTOOLS_MPILEUP_TWO } from '../../../../../modules/nf-core/bcftools/mpileup/main.nf' - -workflow test_ngscheckmate_ncm_bam { - input = [ [ id: 'combined_bams' ], - [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 ), - file(params.test_data['sarscov2']['illumina']['test_paired_end_methylated_sorted_bam'] , checkIfExists: true ), - file(params.test_data['sarscov2']['illumina']['test_paired_end_methylated_sorted_bam_bai'], checkIfExists: true ) - ] - ] - - fasta = [ [ id:'sarscov2' ], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] - - inputBed = [ [ id:'test' ], - file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true)] - - BEDTOOLS_MAKEWINDOWS(inputBed). - bed. - set{snp_channel} - - NGSCHECKMATE_NCM_BAM(input, snp_channel, fasta) -} - -workflow test_ngscheckmate_ncm_vcf { - fasta = [ [ id:'sarscov2' ], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - - inputBed = [ [ id:'test' ], - file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) - ] - - input1 = [ [ id:'test1' ], // meta map - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) - ] - - input2 = [ [ id:'test2' ], // meta map - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) - ] - - BCFTOOLS_MPILEUP ( input1, fasta, false ) - BCFTOOLS_MPILEUP_TWO ( input2, fasta, false ) - - BCFTOOLS_MPILEUP_TWO.out.vcf. - map{it[1]}. - combine( BCFTOOLS_MPILEUP.out.vcf.map{it[1]} ). - map { [ [id: "combined_vcfs"] ,it ] }. - set { vcf_channel } - - BEDTOOLS_MAKEWINDOWS( inputBed ).bed. - set { snp_channel } - - NGSCHECKMATE_NCM_VCF(vcf_channel, snp_channel, fasta) -} - - diff --git a/tests/modules/nf-core/ngscheckmate/ncm/test.yml b/tests/modules/nf-core/ngscheckmate/ncm/test.yml deleted file mode 100644 index 32520eb61a6..00000000000 --- a/tests/modules/nf-core/ngscheckmate/ncm/test.yml +++ /dev/null @@ -1,44 +0,0 @@ -- name: ngscheckmate ncm test_ngscheckmate_ncm_bam - command: nextflow run ./tests/modules/nf-core/ngscheckmate/ncm -entry test_ngscheckmate_ncm_bam -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/ngscheckmate/ncm/nextflow.config - tags: - - ngscheckmate/ncm - - ngscheckmate - files: - - path: output/bedtools/test_split.bed - md5sum: 5058157987313b598f1c260e6965d6f7 - - path: output/bedtools/versions.yml - - path: output/ngscheckmate/combined_bams.pdf - - path: output/ngscheckmate/combined_bams_all.txt - md5sum: 14d0b35765e127aab0ffa5ea5406b4ab - - path: output/ngscheckmate/combined_bams_matched.txt - md5sum: 14d0b35765e127aab0ffa5ea5406b4ab - - path: output/ngscheckmate/combined_bams_output_corr_matrix.txt - md5sum: b8bfd203232680b746ac91ccb290b5e3 - - path: output/ngscheckmate/test.paired_end.methylated.sorted.vcf - - path: output/ngscheckmate/test.paired_end.sorted.vcf - - path: output/ngscheckmate/versions.yml - -- name: ngscheckmate ncm test_ngscheckmate_ncm_vcf - command: nextflow run ./tests/modules/nf-core/ngscheckmate/ncm -entry test_ngscheckmate_ncm_vcf -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/ngscheckmate/ncm/nextflow.config - tags: - - ngscheckmate/ncm - - ngscheckmate - files: - - path: output/bcftools/test1.bcftools_stats.txt - - path: output/bcftools/test1.vcf.gz - - path: output/bcftools/test1.vcf.gz.tbi - - path: output/bcftools/test2.bcftools_stats.txt - - path: output/bcftools/test2.vcf.gz - - path: output/bcftools/test2.vcf.gz.tbi - - path: output/bcftools/versions.yml - - path: output/bedtools/test_split.bed - md5sum: 5058157987313b598f1c260e6965d6f7 - - path: output/bedtools/versions.yml - - path: output/ngscheckmate/combined_vcfs.pdf - - path: output/ngscheckmate/combined_vcfs_all.txt - md5sum: fd74956dcac279b6f58e82ea73e344f8 - - path: output/ngscheckmate/combined_vcfs_matched.txt - md5sum: fd74956dcac279b6f58e82ea73e344f8 - - path: output/ngscheckmate/combined_vcfs_output_corr_matrix.txt - md5sum: 0c86bdad2721c470fe6be119f291c8e5 - - path: output/ngscheckmate/versions.yml From 8667d590745e0b52c8cf111f6567e838b8628916 Mon Sep 17 00:00:00 2001 From: Marcel Ribeiro-Dantas Date: Thu, 23 May 2024 08:57:03 -0400 Subject: [PATCH 24/24] Add RTNI_TNI module (#5320) * Initial work towards a module for RTN TNI Signed-off-by: Marcel Ribeiro-Dantas * Make it a simple PoC Tests are passing. From now on, I can make it more complex and closer to what I want this module to do in the end. * Add two more steps in the module * Prettify file * Use test data, add remaining steps/collect output in TNI Signed-off-by: Marcel Ribeiro-Dantas * Fix DOI in meta.yml Signed-off-by: Marcel Ribeiro-Dantas * Some ongoing changes Signed-off-by: Marcel Ribeiro-Dantas * Rename rtn_tni.R to rtn_tni.r * Fix snapshot mismatch issue Signed-off-by: Marcel Ribeiro-Dantas * Add --n_permutations + tests Signed-off-by: Marcel Ribeiro-Dantas * Get rid of the TODOs Signed-off-by: Marcel Ribeiro-Dantas * Use different dataset (real gene ids) Signed-off-by: Marcel Ribeiro-Dantas * Add support to --tfs + tests Signed-off-by: Marcel Ribeiro-Dantas * Fix indentation for ECLint check Signed-off-by: Marcel Ribeiro-Dantas * Remove quotes from environment dependencies for conda Signed-off-by: Marcel Ribeiro-Dantas --------- Signed-off-by: Marcel Ribeiro-Dantas --- modules/nf-core/rtn/tni/environment.yml | 9 ++ modules/nf-core/rtn/tni/main.nf | 43 +++++ modules/nf-core/rtn/tni/meta.yml | 49 ++++++ modules/nf-core/rtn/tni/templates/rtn_tni.r | 136 ++++++++++++++++ modules/nf-core/rtn/tni/tests/main.nf.test | 148 ++++++++++++++++++ .../nf-core/rtn/tni/tests/main.nf.test.snap | 38 +++++ modules/nf-core/rtn/tni/tests/nextflow.config | 5 + .../nf-core/rtn/tni/tests/nextflow.config2 | 5 + .../nf-core/rtn/tni/tests/nextflow.config3 | 5 + modules/nf-core/rtn/tni/tests/tags.yml | 2 + 10 files changed, 440 insertions(+) create mode 100644 modules/nf-core/rtn/tni/environment.yml create mode 100644 modules/nf-core/rtn/tni/main.nf create mode 100644 modules/nf-core/rtn/tni/meta.yml create mode 100644 modules/nf-core/rtn/tni/templates/rtn_tni.r create mode 100644 modules/nf-core/rtn/tni/tests/main.nf.test create mode 100644 modules/nf-core/rtn/tni/tests/main.nf.test.snap create mode 100644 modules/nf-core/rtn/tni/tests/nextflow.config create mode 100644 modules/nf-core/rtn/tni/tests/nextflow.config2 create mode 100644 modules/nf-core/rtn/tni/tests/nextflow.config3 create mode 100644 modules/nf-core/rtn/tni/tests/tags.yml diff --git a/modules/nf-core/rtn/tni/environment.yml b/modules/nf-core/rtn/tni/environment.yml new file mode 100644 index 00000000000..cbf8c866bcb --- /dev/null +++ b/modules/nf-core/rtn/tni/environment.yml @@ -0,0 +1,9 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +name: "rtn_tni" +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::bioconductor-rtn=2.26.0 diff --git a/modules/nf-core/rtn/tni/main.nf b/modules/nf-core/rtn/tni/main.nf new file mode 100644 index 00000000000..0be53ff4985 --- /dev/null +++ b/modules/nf-core/rtn/tni/main.nf @@ -0,0 +1,43 @@ +process RTN_TNI { + debug true + tag "{$expression_matrix.name}" + label 'process_medium' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/bioconductor-rtn:2.26.0--r43hdfd78af_0': + 'biocontainers/bioconductor-rtn:2.26.0--r43hdfd78af_0' }" + + input: + tuple val(meta), path(expression_matrix) + + output: + tuple val(meta), path("tni.rds") , emit: tni + tuple val(meta), path("tni_permutated.rds") , emit: tni_perm + tuple val(meta), path("tni_bootstrapped.rds") , emit: tni_bootstrap + tuple val(meta), path("tni_filtered.rds") , emit: tni_filtered + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + + template 'rtn_tni.r' + + stub: + def args = task.ext.args ?: '' + + """ + touch tni.rds + touch tni_permutated.rds + touch tni_bootstrapped.rds + touch tni_filtered.rds + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bioconductor-rtn: \$(Rscript -e "suppressWarnings(library(RTN)); cat(as.character(packageVersion('RTN')))") + END_VERSIONS + """ +} diff --git a/modules/nf-core/rtn/tni/meta.yml b/modules/nf-core/rtn/tni/meta.yml new file mode 100644 index 00000000000..b60300bd9e5 --- /dev/null +++ b/modules/nf-core/rtn/tni/meta.yml @@ -0,0 +1,49 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "rtn_tni" +description: Uses the RTN R package for transcriptional regulatory network inference (TNI). +keywords: + - regulatory network + - transcriptomics + - transcription factors +tools: + - "rtn": + description: "RTN: Reconstruction of Transcriptional regulatory Networks and analysis of regulons" + homepage: "https://www.bioconductor.org/packages/release/bioc/html/RTN.html" + documentation: "https://www.bioconductor.org/packages/release/bioc/vignettes/RTN/inst/doc/RTN.html" + tool_dev_url: "https://www.bioconductor.org/packages/release/bioc/html/RTN.html" + doi: "10.1038/ncomms3464" + licence: ["Artistic-2.0"] + +input: + - expression_matrix: + type: file + description: expression matrix in TSV format + pattern: "*.tsv" + +output: + - tni: + type: file + description: RDS R Object with the TNI object + pattern: "tni.rds" + - tni_perm: + type: file + description: RDS R Object with the TNI object after permutation + pattern: "tni_permutated.rds" + - tni_bootstrap: + type: file + description: RDS R Object with the TNI object after permutation and bootstrap + pattern: "tni_bootstrapped.rds" + - tni_filtered: + type: file + description: RDS R Object with the TNI object after permutation, bootstrap and filtering + pattern: "tni_filtered.rds" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@mribeirodantas" +maintainers: + - "@mribeirodantas" diff --git a/modules/nf-core/rtn/tni/templates/rtn_tni.r b/modules/nf-core/rtn/tni/templates/rtn_tni.r new file mode 100644 index 00000000000..af157d1b7cf --- /dev/null +++ b/modules/nf-core/rtn/tni/templates/rtn_tni.r @@ -0,0 +1,136 @@ +#!/usr/bin/env Rscript + +# Ported to nf-core/modules with template by Jonathan Manning + +#' Parse out options from a string without recourse to optparse +#' +#' @param x Long-form argument list like --opt1 val1 --opt2 val2 +#' +#' @return named list of options and values similar to optparse + +parse_args <- function(x){ + args_list <- unlist(strsplit(x, ' ?--')[[1]])[-1] + args_vals <- lapply(args_list, function(x) scan(text=x, what='character', quiet = TRUE)) + + # Ensure the option vectors are length 2 (key/ value) to catch empty ones + args_vals <- lapply(args_vals, function(z){ length(z) <- 2; z}) + + parsed_args <- structure(lapply(args_vals, function(x) x[2]), names = lapply(args_vals, function(x) x[1])) + parsed_args[! is.na(parsed_args)] +} + +# Load +library("RTN") +library("snow") + +################################################ +################################################ +## Pull in module inputs ## +################################################ +################################################ + +input_expr_matrix <- '$expression_matrix' +output_prefix = ifelse('$task.ext.prefix' == 'null', '$meta.id', '$task.ext.prefix') +threads <- $task.cpus +args_opt <- parse_args('$task.ext.args') + +n_perm <- ifelse('n_permutations' %in% names(args_opt), strtoi(args_opt[['n_permutations']]), 10) + +# Debug messages (stdout) +sink(stdout(), type = "message") # sink messages to stdout +message("Expression matrix file : ", input_expr_matrix) +message("Nb permutations : ", n_perm) +message("Nb threads : ", threads) +message("Output basename : ", output_prefix) +if ('tfs' %in% names(args_opt)) { + message("TFs : ", args_opt[['tfs']]) + tfs <- strsplit(args_opt[['tfs']], ',') +} else { + # Load data + data(tfsData) + tfs <- tfsData\$Lambert2018\$SYMBOL +} +sink(NULL, type="message") # close the sink + +# Preprocess +# Input 1: 'expData', a named gene expression matrix (genes on rows, samples on cols); +# Input 2: 'regulatoryElements', a vector listing genes regarded as TFs +# Input 3: 'rowAnnotation', an optional data frame with gene annotation +# Input 4: 'colAnnotation', an optional data frame with sample annotation + +exp_data <- read.csv(input_expr_matrix, sep='\t') +rownames(exp_data) <- exp_data[,1] +rowAnnotation <- exp_data[,1:2] +colnames(rowAnnotation) <- c('PROBEID', 'SYMBOL') +rowAnnotation\$SYMBOL <- toupper(rowAnnotation\$SYMBOL) +exp_data[,1:2] <- NULL + +# Regulatory Transcriptional Network Inference +tfs <- c('ENSG00000125798', 'ENSG00000125816') +rtni <- tni.constructor(expData = as.matrix(exp_data), + regulatoryElements = tfs, + rowAnnotation = rowAnnotation) + +options(cluster=snow::makeCluster(spec=threads, "SOCK")) + +# Please set nPermutations >= 1000 +rtni_permutation <- tni.permutation(rtni, nPermutations = n_perm, pValueCutoff = 1e-4) + +# Unstable interactions are subsequently removed by bootstrap analysis using the +# tni.bootstrap() function, which creates a consensus bootstrap network, referred +# here as refnet (reference network). +rtni_bootstrapped <- tni.bootstrap(rtni_permutation) + +stopCluster(getOption("cluster")) + +# remove the weakest interaction in any triplet formed by two TFs and a common +# target gene, preserving the dominant TF-target pair (ARACNe) +rtni_filtered <- tni.dpi.filter(rtni_bootstrapped) + +saveRDS(rtni, file = "tni.rds") +saveRDS(rtni_permutation, file = "tni_permutated.rds") +saveRDS(rtni_bootstrapped, file = "tni_bootstrapped.rds") +saveRDS(rtni_filtered, file = "tni_filtered.rds") + +# Plot +#pdf(paste0(output_prefix, "_RTN.pdf")) +#tni.graph(rtni_filtered, regulatoryElements = c("FOXM1", "E2F2")) +#title("Regulatory Transcriptional Network") +#mtext(output_prefix, side=3) +#dev.off() +#cat( +# paste("- Threads::", threads), +# fill=TRUE, labels=output_prefix, +# file=paste0(output_prefix, "_intercept_slope.txt"), append=FALSE +#) + +################################################ +################################################ +## R SESSION INFO ## +################################################ +################################################ + +sink(paste(output_prefix, "R_sessionInfo.log", sep = '.')) +print(sessionInfo()) +sink() + +################################################ +################################################ +## VERSIONS FILE ## +################################################ +################################################ + +r.version <- strsplit(version[['version.string']], ' ')[[1]][3] +rtn.version <- as.character(packageVersion('RTN')) + +writeLines( + c( + '"${task.process}":', + paste(' bioconductor-rtn:', rtn.version) + ), +'versions.yml') + +################################################ +################################################ +################################################ +################################################ diff --git a/modules/nf-core/rtn/tni/tests/main.nf.test b/modules/nf-core/rtn/tni/tests/main.nf.test new file mode 100644 index 00000000000..d695981acc3 --- /dev/null +++ b/modules/nf-core/rtn/tni/tests/main.nf.test @@ -0,0 +1,148 @@ +nextflow_process { + + name "Test Process RTN_TNI" + script "../main.nf" + process "RTN_TNI" + + tag "modules" + tag "modules_nfcore" + tag "rtn" + tag "rtn/tni" + + test("musmusculus tni expression matrix") { + when { + process { + """ + input[0] = [ + [id:'test'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/riboseq_expression/salmon.merged.gene_counts_length_scaled.tsv', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert file(process.out.tni[0][1]).exists() }, + { assert file(process.out.tni_perm[0][1]).exists() }, + { assert file(process.out.tni_bootstrap[0][1]).exists() }, + { assert file(process.out.tni_filtered[0][1]).exists() }, + { assert file(process.out.versions[0]).exists() }, + { assert process.stdout.contains('Nb permutations : 10') } // the default value is 10 + ) + } + + } + + test("musmusculus tni expression matrix with --n_permutations 5") { + when { + config "./nextflow.config" + process { + """ + input[0] = [ + [id:'test'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/riboseq_expression/salmon.merged.gene_counts_length_scaled.tsv', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert file(process.out.tni[0][1]).exists() }, + { assert file(process.out.tni_perm[0][1]).exists() }, + { assert file(process.out.tni_bootstrap[0][1]).exists() }, + { assert file(process.out.tni_filtered[0][1]).exists() }, + { assert file(process.out.versions[0]).exists() }, + { assert process.stdout.contains('Nb permutations : 5') } + ) + } + + } + + test("musmusculus tni expression matrix with --tfs ENSG00000125798,ENSG00000125816") { + when { + config "./nextflow.config2" + process { + """ + input[0] = [ + [id:'test'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/riboseq_expression/salmon.merged.gene_counts_length_scaled.tsv', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert file(process.out.tni[0][1]).exists() }, + { assert file(process.out.tni_perm[0][1]).exists() }, + { assert file(process.out.tni_bootstrap[0][1]).exists() }, + { assert file(process.out.tni_filtered[0][1]).exists() }, + { assert file(process.out.versions[0]).exists() }, + { assert process.stdout.contains('TFs : ENSG00000125798,ENSG00000125816') } + ) + } + + } + + test("musmusculus tni expression matrix with --n_permutations 12 and --tfs ENSG00000125798,ENSG00000125816") { + when { + config "./nextflow.config3" + process { + """ + input[0] = [ + [id:'test'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/riboseq_expression/salmon.merged.gene_counts_length_scaled.tsv', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert file(process.out.tni[0][1]).exists() }, + { assert file(process.out.tni_perm[0][1]).exists() }, + { assert file(process.out.tni_bootstrap[0][1]).exists() }, + { assert file(process.out.tni_filtered[0][1]).exists() }, + { assert file(process.out.versions[0]).exists() }, + { assert process.stdout.contains('Nb permutations : 12') }, + { assert process.stdout.contains('TFs : ENSG00000125798,ENSG00000125816') } + ) + } + + } + + test("musmusculus tni expression matrix - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [id:'test'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/riboseq_expression/salmon.merged.gene_counts_length_scaled.tsv', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert file(process.out.tni[0][1]).exists() }, + { assert file(process.out.tni_perm[0][1]).exists() }, + { assert file(process.out.tni_bootstrap[0][1]).exists() }, + { assert file(process.out.tni_filtered[0][1]).exists() }, + { assert file(process.out.versions[0]).exists() } + ) + } + + } + +} diff --git a/modules/nf-core/rtn/tni/tests/main.nf.test.snap b/modules/nf-core/rtn/tni/tests/main.nf.test.snap new file mode 100644 index 00000000000..ad96950164d --- /dev/null +++ b/modules/nf-core/rtn/tni/tests/main.nf.test.snap @@ -0,0 +1,38 @@ +{ + "versions": { + "content": [ + [ + "versions.yml:md5,47835259fd6d638971ddf96b6218ecea" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.02.0" + }, + "timestamp": "2024-05-22T12:45:47.31544" + }, + "musmusculus tni expression matrix": { + "content": [ + [ + "versions.yml:md5,47835259fd6d638971ddf96b6218ecea" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.02.0" + }, + "timestamp": "2024-05-22T12:48:05.624121" + }, + "musmusculus tni expression matrix - stub": { + "content": [ + [ + "versions.yml:md5,47835259fd6d638971ddf96b6218ecea" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.02.0" + }, + "timestamp": "2024-05-22T12:51:37.742436" + } +} \ No newline at end of file diff --git a/modules/nf-core/rtn/tni/tests/nextflow.config b/modules/nf-core/rtn/tni/tests/nextflow.config new file mode 100644 index 00000000000..ff3fefd6201 --- /dev/null +++ b/modules/nf-core/rtn/tni/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: RTN_TNI { + ext.args = "--n_permutations 5" + } +} diff --git a/modules/nf-core/rtn/tni/tests/nextflow.config2 b/modules/nf-core/rtn/tni/tests/nextflow.config2 new file mode 100644 index 00000000000..20f4230f32b --- /dev/null +++ b/modules/nf-core/rtn/tni/tests/nextflow.config2 @@ -0,0 +1,5 @@ +process { + withName: RTN_TNI { + ext.args = '--tfs ENSG00000125798,ENSG00000125816' + } +} diff --git a/modules/nf-core/rtn/tni/tests/nextflow.config3 b/modules/nf-core/rtn/tni/tests/nextflow.config3 new file mode 100644 index 00000000000..a6cafd28b63 --- /dev/null +++ b/modules/nf-core/rtn/tni/tests/nextflow.config3 @@ -0,0 +1,5 @@ +process { + withName: RTN_TNI { + ext.args = '--n_permutations 12 --tfs ENSG00000125798,ENSG00000125816' + } +} diff --git a/modules/nf-core/rtn/tni/tests/tags.yml b/modules/nf-core/rtn/tni/tests/tags.yml new file mode 100644 index 00000000000..af1dbd21874 --- /dev/null +++ b/modules/nf-core/rtn/tni/tests/tags.yml @@ -0,0 +1,2 @@ +rtn/tni: + - "modules/nf-core/rtn/tni/**"