From 5f26cab6370e775ba8f14ceebd2cc160e54f5aa6 Mon Sep 17 00:00:00 2001 From: Sateesh Date: Sat, 12 Oct 2024 18:28:45 +0000 Subject: [PATCH] update bismark v0.24.2, rm input stageAs, add stub, update tests+snap --- .../bismark/genomepreparation/environment.yml | 2 +- .../nf-core/bismark/genomepreparation/main.nf | 25 +++- .../bismark/genomepreparation/meta.yml | 13 +- .../genomepreparation/tests/main.nf.test | 41 ++++-- .../genomepreparation/tests/main.nf.test.snap | 131 ++++++++++++------ .../bismark/genomepreparation/tests/tags.yml | 2 - 6 files changed, 156 insertions(+), 58 deletions(-) delete mode 100644 modules/nf-core/bismark/genomepreparation/tests/tags.yml diff --git a/modules/nf-core/bismark/genomepreparation/environment.yml b/modules/nf-core/bismark/genomepreparation/environment.yml index fbc3fdf202c..9bc4753bdab 100644 --- a/modules/nf-core/bismark/genomepreparation/environment.yml +++ b/modules/nf-core/bismark/genomepreparation/environment.yml @@ -2,4 +2,4 @@ channels: - conda-forge - bioconda dependencies: - - bioconda::bismark=0.24.0 + - bioconda::bismark=0.24.2 diff --git a/modules/nf-core/bismark/genomepreparation/main.nf b/modules/nf-core/bismark/genomepreparation/main.nf index 7f5a2eeedfb..58aba927b74 100644 --- a/modules/nf-core/bismark/genomepreparation/main.nf +++ b/modules/nf-core/bismark/genomepreparation/main.nf @@ -4,15 +4,15 @@ process BISMARK_GENOMEPREPARATION { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/bismark:0.24.0--hdfd78af_0' : - 'biocontainers/bismark:0.24.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/bismark:0.24.2--hdfd78af_0' : + 'biocontainers/bismark:0.24.2--hdfd78af_0' }" input: - path fasta, stageAs: "BismarkIndex/*" + tuple val(meta), path(fasta) output: - path "BismarkIndex" , emit: index - path "versions.yml" , emit: versions + tuple val(meta), path("BismarkIndex"), emit: index + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -20,6 +20,9 @@ process BISMARK_GENOMEPREPARATION { script: def args = task.ext.args ?: '' """ + mkdir BismarkIndex + mv $fasta BismarkIndex/ + bismark_genome_preparation \\ $args \\ BismarkIndex @@ -29,4 +32,16 @@ process BISMARK_GENOMEPREPARATION { bismark: \$(echo \$(bismark -v 2>&1) | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//') END_VERSIONS """ + + stub: + def args = task.ext.args ?: '' + """ + mkdir BismarkIndex + touch BismarkIndex/$fasta + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bismark: \$(echo \$(bismark -v 2>&1) | sed 's/^.*Bismark Version: v//; s/Copyright.*\$//') + END_VERSIONS + """ } diff --git a/modules/nf-core/bismark/genomepreparation/meta.yml b/modules/nf-core/bismark/genomepreparation/meta.yml index 18ca34a9f8d..c1880271b15 100644 --- a/modules/nf-core/bismark/genomepreparation/meta.yml +++ b/modules/nf-core/bismark/genomepreparation/meta.yml @@ -23,11 +23,21 @@ tools: licence: ["GPL-3.0-or-later"] identifier: biotools:bismark input: - - - fasta: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: type: file description: Input genome fasta file output: - index: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] - BismarkIndex: type: directory description: Bismark genome index directory @@ -41,3 +51,4 @@ authors: - "@phue" maintainers: - "@phue" + - "@sateeshperi" diff --git a/modules/nf-core/bismark/genomepreparation/tests/main.nf.test b/modules/nf-core/bismark/genomepreparation/tests/main.nf.test index bd9b95e38fe..3ba99722783 100644 --- a/modules/nf-core/bismark/genomepreparation/tests/main.nf.test +++ b/modules/nf-core/bismark/genomepreparation/tests/main.nf.test @@ -3,31 +3,54 @@ nextflow_process { name "Test Process BISMARK_GENOMEPREPARATION" script "../main.nf" process "BISMARK_GENOMEPREPARATION" - tag "bismark" - tag "bismark/genomepreparation" + tag "modules" + tag "bismark/genomepreparation" + tag "bismark" tag "modules_nfcore" - test("Should run bismark/genomepreparation without failures") { + test("sarscov2 genome [fasta]") { when { - params { - outdir = "$outputDir" - } process { """ - input[0] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + input[0] = Channel.of([ + [ 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).match() } + { assert process.success }, + { assert snapshot(process.out).match() } ) } + } + + test("sarscov2 genome [fasta] - stub") { + + options "-stub" + + when { + process { + """ + input[0] = Channel.of([ + [ 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).match() } + ) + } } } diff --git a/modules/nf-core/bismark/genomepreparation/tests/main.nf.test.snap b/modules/nf-core/bismark/genomepreparation/tests/main.nf.test.snap index a343efad4c4..59a80529ae0 100644 --- a/modules/nf-core/bismark/genomepreparation/tests/main.nf.test.snap +++ b/modules/nf-core/bismark/genomepreparation/tests/main.nf.test.snap @@ -1,65 +1,116 @@ { - "Should run bismark/genomepreparation without failures": { + "sarscov2 genome [fasta] - stub": { "content": [ { "0": [ [ + { + "id": "test" + }, + [ + "genome.fasta:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "1": [ + "versions.yml:md5,4d9a42530334575b18a6bde4ae72f7d6" + ], + "index": [ + [ + { + "id": "test" + }, + [ + "genome.fasta:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "versions": [ + "versions.yml:md5,4d9a42530334575b18a6bde4ae72f7d6" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-12T18:25:54.462607784" + }, + "sarscov2 genome [fasta]": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, [ [ - "BS_CT.1.bt2:md5,10a8854e5eeb95629f46d24b0d8da70c", - "BS_CT.2.bt2:md5,bc5d407e6fce3e1cdb4b23ab2a20f707", - "BS_CT.3.bt2:md5,4ed93abba181d8dfab2e303e33114777", - "BS_CT.4.bt2:md5,6c4f549575e5882ff3a97ae10ae2e7be", - "BS_CT.rev.1.bt2:md5,d37d586b41b6a36efb25839961d242cb", - "BS_CT.rev.2.bt2:md5,48bf400de85cd7324fbf6bf38fe2dc95", - "genome_mfa.CT_conversion.fa:md5,903b9f357eea4a5f36e21e78e0fe1dfa" + [ + "BS_CT.1.bt2:md5,10a8854e5eeb95629f46d24b0d8da70c", + "BS_CT.2.bt2:md5,bc5d407e6fce3e1cdb4b23ab2a20f707", + "BS_CT.3.bt2:md5,4ed93abba181d8dfab2e303e33114777", + "BS_CT.4.bt2:md5,6c4f549575e5882ff3a97ae10ae2e7be", + "BS_CT.rev.1.bt2:md5,d37d586b41b6a36efb25839961d242cb", + "BS_CT.rev.2.bt2:md5,48bf400de85cd7324fbf6bf38fe2dc95", + "genome_mfa.CT_conversion.fa:md5,903b9f357eea4a5f36e21e78e0fe1dfa" + ], + [ + "BS_GA.1.bt2:md5,a6fa4068ed10872568f32568c66cb600", + "BS_GA.2.bt2:md5,fc5b634e2f5137801e3801d62ad05f74", + "BS_GA.3.bt2:md5,4ed93abba181d8dfab2e303e33114777", + "BS_GA.4.bt2:md5,b1e855685ed634daa7df8e180c9b2fc4", + "BS_GA.rev.1.bt2:md5,17f51e65f44477962226a83b369b2bc4", + "BS_GA.rev.2.bt2:md5,d36044c5dfe37af0411f60d446585bc6", + "genome_mfa.GA_conversion.fa:md5,e529375ec2039112161465b5169fcd59" + ] ], - [ - "BS_GA.1.bt2:md5,a6fa4068ed10872568f32568c66cb600", - "BS_GA.2.bt2:md5,fc5b634e2f5137801e3801d62ad05f74", - "BS_GA.3.bt2:md5,4ed93abba181d8dfab2e303e33114777", - "BS_GA.4.bt2:md5,b1e855685ed634daa7df8e180c9b2fc4", - "BS_GA.rev.1.bt2:md5,17f51e65f44477962226a83b369b2bc4", - "BS_GA.rev.2.bt2:md5,d36044c5dfe37af0411f60d446585bc6", - "genome_mfa.GA_conversion.fa:md5,e529375ec2039112161465b5169fcd59" - ] - ], - "genome.fasta:md5,6e9fe4042a72f2345f644f239272b7e6" + "genome.fasta:md5,6e9fe4042a72f2345f644f239272b7e6" + ] ] ], "1": [ - "versions.yml:md5,92d3bda85e8d9517fce396c615141003" + "versions.yml:md5,4d9a42530334575b18a6bde4ae72f7d6" ], "index": [ [ + { + "id": "test" + }, [ [ - "BS_CT.1.bt2:md5,10a8854e5eeb95629f46d24b0d8da70c", - "BS_CT.2.bt2:md5,bc5d407e6fce3e1cdb4b23ab2a20f707", - "BS_CT.3.bt2:md5,4ed93abba181d8dfab2e303e33114777", - "BS_CT.4.bt2:md5,6c4f549575e5882ff3a97ae10ae2e7be", - "BS_CT.rev.1.bt2:md5,d37d586b41b6a36efb25839961d242cb", - "BS_CT.rev.2.bt2:md5,48bf400de85cd7324fbf6bf38fe2dc95", - "genome_mfa.CT_conversion.fa:md5,903b9f357eea4a5f36e21e78e0fe1dfa" + [ + "BS_CT.1.bt2:md5,10a8854e5eeb95629f46d24b0d8da70c", + "BS_CT.2.bt2:md5,bc5d407e6fce3e1cdb4b23ab2a20f707", + "BS_CT.3.bt2:md5,4ed93abba181d8dfab2e303e33114777", + "BS_CT.4.bt2:md5,6c4f549575e5882ff3a97ae10ae2e7be", + "BS_CT.rev.1.bt2:md5,d37d586b41b6a36efb25839961d242cb", + "BS_CT.rev.2.bt2:md5,48bf400de85cd7324fbf6bf38fe2dc95", + "genome_mfa.CT_conversion.fa:md5,903b9f357eea4a5f36e21e78e0fe1dfa" + ], + [ + "BS_GA.1.bt2:md5,a6fa4068ed10872568f32568c66cb600", + "BS_GA.2.bt2:md5,fc5b634e2f5137801e3801d62ad05f74", + "BS_GA.3.bt2:md5,4ed93abba181d8dfab2e303e33114777", + "BS_GA.4.bt2:md5,b1e855685ed634daa7df8e180c9b2fc4", + "BS_GA.rev.1.bt2:md5,17f51e65f44477962226a83b369b2bc4", + "BS_GA.rev.2.bt2:md5,d36044c5dfe37af0411f60d446585bc6", + "genome_mfa.GA_conversion.fa:md5,e529375ec2039112161465b5169fcd59" + ] ], - [ - "BS_GA.1.bt2:md5,a6fa4068ed10872568f32568c66cb600", - "BS_GA.2.bt2:md5,fc5b634e2f5137801e3801d62ad05f74", - "BS_GA.3.bt2:md5,4ed93abba181d8dfab2e303e33114777", - "BS_GA.4.bt2:md5,b1e855685ed634daa7df8e180c9b2fc4", - "BS_GA.rev.1.bt2:md5,17f51e65f44477962226a83b369b2bc4", - "BS_GA.rev.2.bt2:md5,d36044c5dfe37af0411f60d446585bc6", - "genome_mfa.GA_conversion.fa:md5,e529375ec2039112161465b5169fcd59" - ] - ], - "genome.fasta:md5,6e9fe4042a72f2345f644f239272b7e6" + "genome.fasta:md5,6e9fe4042a72f2345f644f239272b7e6" + ] ] ], "versions": [ - "versions.yml:md5,92d3bda85e8d9517fce396c615141003" + "versions.yml:md5,4d9a42530334575b18a6bde4ae72f7d6" ] } ], - "timestamp": "2023-10-17T16:14:41.509500586" + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-12T18:25:45.474877931" } } \ No newline at end of file diff --git a/modules/nf-core/bismark/genomepreparation/tests/tags.yml b/modules/nf-core/bismark/genomepreparation/tests/tags.yml deleted file mode 100644 index 279f91bba2d..00000000000 --- a/modules/nf-core/bismark/genomepreparation/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -bismark/genomepreparation: - - modules/nf-core/bismark/genomepreparation/**