Skip to content

Commit

Permalink
update bismark v0.24.2, rm input stageAs, add stub, update tests+snap
Browse files Browse the repository at this point in the history
  • Loading branch information
sateeshperi committed Oct 12, 2024
1 parent 7fd374e commit 5f26cab
Show file tree
Hide file tree
Showing 6 changed files with 156 additions and 58 deletions.
2 changes: 1 addition & 1 deletion modules/nf-core/bismark/genomepreparation/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ channels:
- conda-forge
- bioconda
dependencies:
- bioconda::bismark=0.24.0
- bioconda::bismark=0.24.2
25 changes: 20 additions & 5 deletions modules/nf-core/bismark/genomepreparation/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,25 @@ 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

script:
def args = task.ext.args ?: ''
"""
mkdir BismarkIndex
mv $fasta BismarkIndex/
bismark_genome_preparation \\
$args \\
BismarkIndex
Expand All @@ -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
"""
}
13 changes: 12 additions & 1 deletion modules/nf-core/bismark/genomepreparation/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -41,3 +51,4 @@ authors:
- "@phue"
maintainers:
- "@phue"
- "@sateeshperi"
41 changes: 32 additions & 9 deletions modules/nf-core/bismark/genomepreparation/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -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() }
)
}
}

}
131 changes: 91 additions & 40 deletions modules/nf-core/bismark/genomepreparation/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -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"
}
}
2 changes: 0 additions & 2 deletions modules/nf-core/bismark/genomepreparation/tests/tags.yml

This file was deleted.

0 comments on commit 5f26cab

Please sign in to comment.