Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gecco + migrate to nf-test #5372

Merged
merged 5 commits into from
Mar 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/nf-core/gecco/run/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- bioconda
- defaults
dependencies:
- bioconda::gecco=0.9.8
- bioconda::gecco=0.9.10
18 changes: 16 additions & 2 deletions modules/nf-core/gecco/run/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process GECCO_RUN {

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

input:
tuple val(meta), path(input), path(hmm)
Expand Down Expand Up @@ -44,4 +44,18 @@ process GECCO_RUN {
gecco: \$(echo \$(gecco --version) | cut -f 2 -d ' ' )
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.genes.tsv
touch ${prefix}.features.tsv
touch ${prefix}.clusters.tsv
touch NC_018507.1_cluster_1.gbk

cat <<-END_VERSIONS > versions.yml
"${task.process}":
gecco: \$(echo \$(gecco --version) | cut -f 2 -d ' ' )
END_VERSIONS
"""
}
68 changes: 68 additions & 0 deletions modules/nf-core/gecco/run/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
nextflow_process {

name "Test Process GECCO_RUN"
script "../main.nf"
process "GECCO_RUN"

tag "modules"
tag "modules_nfcore"
tag "gecco"
tag "gecco/run"

test("gecco/run - candidatus_portiera_aleyrodidarum - genome_fasta") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/genome.fasta', checkIfExists: true),
[]
]
input[1] = []
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.genes +
process.out.features +
process.out.clusters +
Comment on lines +31 to +33
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whats with the +? I've not seen that before?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's supposed to chain those outputs together and works. But thanks for the hint, I forgot to add the .match() which caused the test not to show up in the snapshot. Now it's fixed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the + is used by a few modules already, e.g. multiqc.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok... I wonder what it doss

process.out.versions
) },
{ assert path(process.out.gbk.get(0).get(1)).text.contains("MVKNDIDILILGGGCTGLSLAYYLSFLPNTVRIFLIENKFIYNND") }
)
}

}

test("gecco/run - candidatus_portiera_aleyrodidarum - genome_fasta - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/prokaryotes/candidatus_portiera_aleyrodidarum/genome/genome.fasta', checkIfExists: true),
[]
]
input[1] = []
"""
}
}

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

}

}
97 changes: 97 additions & 0 deletions modules/nf-core/gecco/run/tests/main.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions modules/nf-core/gecco/run/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gecco/run:
- "modules/nf-core/gecco/run/**"
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -820,9 +820,6 @@ gatk4spark/baserecalibrator:
gawk:
- modules/nf-core/gawk/**
- tests/modules/nf-core/gawk/**
gecco/run:
- modules/nf-core/gecco/run/**
- tests/modules/nf-core/gecco/run/**
gem2/gem2bedmappability:
- modules/nf-core/gem2/gem2bedmappability/**
- tests/modules/nf-core/gem2/gem2bedmappability/**
Expand Down
17 changes: 0 additions & 17 deletions tests/modules/nf-core/gecco/run/main.nf

This file was deleted.

5 changes: 0 additions & 5 deletions tests/modules/nf-core/gecco/run/nextflow.config

This file was deleted.

13 changes: 0 additions & 13 deletions tests/modules/nf-core/gecco/run/test.yml

This file was deleted.

Loading