Skip to content

Commit

Permalink
Bump GUNC and add gunc/run test (nf-core#6920)
Browse files Browse the repository at this point in the history
* Bump GUNC and add gunc/run test

* Fix meta, use input_dir

* Add snapshots

* Change strategy to preserve filenames

* Add gunc/mergecheckm test

* Update tags

* Fix test names

* Update snapshots

* Add stubs

* Add stub snaps

* Address review comments

* Set args in nextflow.config again

* Comment problematic tests

* Comment another test

---------

Co-authored-by: Edmund Miller <[email protected]>
  • Loading branch information
dialvarezs and edmundmiller authored Nov 26, 2024
1 parent 2a8530b commit b6515a0
Show file tree
Hide file tree
Showing 16 changed files with 489 additions and 28 deletions.
3 changes: 2 additions & 1 deletion modules/nf-core/gunc/downloaddb/environment.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
channels:
- conda-forge
- bioconda

dependencies:
- bioconda::gunc=1.0.5
- bioconda::gunc=1.0.6
4 changes: 2 additions & 2 deletions modules/nf-core/gunc/downloaddb/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process GUNC_DOWNLOADDB {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/gunc:1.0.5--pyhdfd78af_0' :
'biocontainers/gunc:1.0.5--pyhdfd78af_0' }"
'https://depot.galaxyproject.org/singularity/gunc:1.0.6--pyhdfd78af_0' :
'biocontainers/gunc:1.0.6--pyhdfd78af_0' }"

input:
val db_name
Expand Down
18 changes: 9 additions & 9 deletions modules/nf-core/gunc/downloaddb/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"content": [
"gunc_db_progenomes2.1.dmnd",
[
"versions.yml:md5,ab391d00f34801f2caa143c4c05eba56"
"versions.yml:md5,5ce1c695848ee48977b982a369b01141"
]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
"nf-test": "0.9.1",
"nextflow": "24.10.0"
},
"timestamp": "2024-09-06T10:25:14.217951"
"timestamp": "2024-11-01T07:23:05.696265018"
},
"test-gunc-downloaddb-stub": {
"content": [
Expand All @@ -19,20 +19,20 @@
"progenomes.dmnd:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"1": [
"versions.yml:md5,ab391d00f34801f2caa143c4c05eba56"
"versions.yml:md5,5ce1c695848ee48977b982a369b01141"
],
"db": [
"progenomes.dmnd:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"versions": [
"versions.yml:md5,ab391d00f34801f2caa143c4c05eba56"
"versions.yml:md5,5ce1c695848ee48977b982a369b01141"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
"nf-test": "0.9.1",
"nextflow": "24.10.0"
},
"timestamp": "2024-09-06T10:25:20.120206"
"timestamp": "2024-11-01T07:23:16.109775313"
}
}
3 changes: 2 additions & 1 deletion modules/nf-core/gunc/mergecheckm/environment.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
channels:
- conda-forge
- bioconda

dependencies:
- bioconda::gunc=1.0.5
- bioconda::gunc=1.0.6
14 changes: 12 additions & 2 deletions modules/nf-core/gunc/mergecheckm/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process GUNC_MERGECHECKM {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/gunc:1.0.5--pyhdfd78af_0' :
'biocontainers/gunc:1.0.5--pyhdfd78af_0' }"
'https://depot.galaxyproject.org/singularity/gunc:1.0.6--pyhdfd78af_0' :
'biocontainers/gunc:1.0.6--pyhdfd78af_0' }"

input:
tuple val(meta), path(gunc_file), path(checkm_file)
Expand Down Expand Up @@ -33,4 +33,14 @@ process GUNC_MERGECHECKM {
gunc: \$( gunc --version )
END_VERSIONS
"""

stub:
"""
touch gunc_merge_checkm.tsv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
gunc: \$( gunc --version )
END_VERSIONS
"""
}
175 changes: 175 additions & 0 deletions modules/nf-core/gunc/mergecheckm/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
nextflow_process {

name "Test Process GUNC_MERGECHECKM"
script "../main.nf"
process "GUNC_MERGECHECKM"
config "./nextflow.config"

tag "modules_nfcore"
tag "modules"
tag "gunc"
tag "gunc/mergecheckm"
tag "gunc/run"
tag "gunc/downloaddb"
tag "checkm/lineagewf"
tag "checkm/qa"

// commented out because GitHub runners are not able to run this test
// test("gunc - mergecheckm") {

// setup {
// run("CHECKM_LINEAGEWF") {
// script "../../../checkm/lineagewf/main.nf"
// process {
// """
// input[0] = [
// [id: 'test'], // meta map
// file(
// params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/contigs.fasta',
// checkIfExists: true
// )
// ]
// input[1] = 'fasta'
// input[2] = [] // Download CheckM database
// """
// }
// }

// run("CHECKM_QA") {
// script "../../../checkm/qa/main.nf"
// process {
// """
// input[0] = CHECKM_LINEAGEWF.out.checkm_output
// .join(CHECKM_LINEAGEWF.out.marker_file)
// .map { sample_data -> sample_data + [file('NO_FILE')] }
// input[1] = []
// """
// }
// }

// run("GUNC_DOWNLOADDB") {
// script "../../downloaddb/main.nf"
// process {
// """
// input[0] = 'progenomes'
// """
// }
// }

// run("GUNC_RUN") {
// script "../../run/main.nf"
// process {
// """
// input[0] = [
// [id: 'test'],
// [file(
// params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/contigs.fasta',
// checkIfExists: true
// )]
// ]
// input[1] = GUNC_DOWNLOADDB.out.db
// """
// }
// }
// }

// when {
// params {
// outdir = "${launchDir}/tests/results"
// }
// process {
// """
// input[0] = GUNC_RUN.out.maxcss_level_tsv.join(CHECKM_QA.out.output)
// """
// }
// }

// then {
// assertAll(
// { assert process.success },
// { assert snapshot(process.out).match() }
// )
// }

// }

test("gunc - mergecheckm - stub") {

options "-stub"

setup {
run("CHECKM_LINEAGEWF") {
script "../../../checkm/lineagewf/main.nf"
process {
"""
input[0] = [
[id: 'test'], // meta map
file(
params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/contigs.fasta',
checkIfExists: true
)
]
input[1] = 'fasta'
input[2] = [] // Download CheckM database
"""
}
}

run("CHECKM_QA") {
script "../../../checkm/qa/main.nf"
process {
"""
input[0] = CHECKM_LINEAGEWF.out.checkm_output
.join(CHECKM_LINEAGEWF.out.marker_file)
.map { v -> v + [file('NO_FILE')] }
input[1] = []
"""
}
}

run("GUNC_DOWNLOADDB") {
script "../../downloaddb/main.nf"
process {
"""
input[0] = 'progenomes'
"""
}
}

run("GUNC_RUN") {
script "../../run/main.nf"
process {
"""
input[0] = [
[id: 'test'],
[file(
params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/contigs.fasta',
checkIfExists: true
)]
]
input[1] = GUNC_DOWNLOADDB.out.db
"""
}
}
}

when {
params {
outdir = "${launchDir}/tests/results"
}
process {
"""
input[0] = GUNC_RUN.out.maxcss_level_tsv.join(CHECKM_QA.out.output)
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}
}
68 changes: 68 additions & 0 deletions modules/nf-core/gunc/mergecheckm/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"gunc - mergecheckm": {
"content": [
{
"0": [
[
{
"id": "test"
},
"GUNC_checkM.merged.tsv:md5,24cbd3c76a36cb90ac993c83525a2c1b"
]
],
"1": [
"versions.yml:md5,a94747201129170b1cfbce5e59de62b0"
],
"tsv": [
[
{
"id": "test"
},
"GUNC_checkM.merged.tsv:md5,24cbd3c76a36cb90ac993c83525a2c1b"
]
],
"versions": [
"versions.yml:md5,a94747201129170b1cfbce5e59de62b0"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.0"
},
"timestamp": "2024-11-22T09:37:48.146410153"
},
"gunc - mergecheckm - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"gunc_merge_checkm.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,a94747201129170b1cfbce5e59de62b0"
],
"tsv": [
[
{
"id": "test"
},
"gunc_merge_checkm.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,a94747201129170b1cfbce5e59de62b0"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.0"
},
"timestamp": "2024-11-21T16:47:06.752273424"
}
}
5 changes: 5 additions & 0 deletions modules/nf-core/gunc/mergecheckm/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: CHECKM_QA {
ext.args = '--tab_table'
}
}
6 changes: 6 additions & 0 deletions modules/nf-core/gunc/mergecheckm/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gunc/run:
- modules/nf-core/gunc/mergecheckm/**
- modules/nf-core/gunc/run/**
- modules/nf-core/gunc/downloaddb/**
- modules/nf-core/checkm/lineagewf/**
- modules/nf-core/checkm/qa/**
3 changes: 2 additions & 1 deletion modules/nf-core/gunc/run/environment.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
channels:
- conda-forge
- bioconda

dependencies:
- bioconda::gunc=1.0.5
- bioconda::gunc=1.0.6
Loading

0 comments on commit b6515a0

Please sign in to comment.