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

Bump concoct/cutupfasta version, add stub, add nf-test #5864

Merged
merged 2 commits into from
Jun 21, 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
18 changes: 16 additions & 2 deletions modules/nf-core/concoct/cutupfasta/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ process CONCOCT_CUTUPFASTA {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/concoct:1.1.0--py311h245ed52_4':
'biocontainers/concoct:1.1.0--py311h245ed52_4' }"
'https://depot.galaxyproject.org/singularity/concoct:1.1.0--py312h245ed52_6':
'biocontainers/concoct:1.1.0--py312h245ed52_6' }"

input:
tuple val(meta), path(fasta)
Expand Down Expand Up @@ -37,4 +37,18 @@ process CONCOCT_CUTUPFASTA {
concoct: \$(echo \$(concoct --version 2>&1) | sed 's/concoct //g' )
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def bedfile = bed ? "-b ${prefix}.bed" : ""
if ("$fasta" == "${prefix}.fasta") error "Input and output names are the same, set prefix in module configuration to disambiguate!"
"""
touch ${prefix}.fasta

cat <<-END_VERSIONS > versions.yml
"${task.process}":
concoct: \$(echo \$(concoct --version 2>&1) | sed 's/concoct //g' )
END_VERSIONS
"""
}
60 changes: 60 additions & 0 deletions modules/nf-core/concoct/cutupfasta/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "concoct"
tag "concoct/cutupfasta"

test("sarscov2 - genome - fasta") {

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

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

}

test("sarscov2 - genome - fasta - stub") {

options "-stub"

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

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

}

}
84 changes: 84 additions & 0 deletions modules/nf-core/concoct/cutupfasta/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"sarscov2 - genome - fasta": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.fasta:md5,b7d972e6efa0b306e02e46a685310c7f"
]
],
"1": [

],
"2": [
"versions.yml:md5,9785f4f0f5f6e8d020a52a9e2c4fa3e0"
],
"bed": [

],
"fasta": [
[
{
"id": "test",
"single_end": false
},
"test.fasta:md5,b7d972e6efa0b306e02e46a685310c7f"
]
],
"versions": [
"versions.yml:md5,9785f4f0f5f6e8d020a52a9e2c4fa3e0"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-06-21T15:13:08.126117371"
},
"sarscov2 - genome - fasta - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.fasta:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [

],
"2": [
"versions.yml:md5,9785f4f0f5f6e8d020a52a9e2c4fa3e0"
],
"bed": [

],
"fasta": [
[
{
"id": "test",
"single_end": false
},
"test.fasta:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,9785f4f0f5f6e8d020a52a9e2c4fa3e0"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-06-21T15:13:20.929503446"
}
}
2 changes: 2 additions & 0 deletions modules/nf-core/concoct/cutupfasta/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
concoct/cutupfasta:
- "modules/nf-core/concoct/cutupfasta/**"
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,6 @@ concoct/concoct:
concoct/concoctcoveragetable:
- modules/nf-core/concoct/concoctcoveragetable/**
- tests/modules/nf-core/concoct/concoctcoveragetable/**
concoct/cutupfasta:
- modules/nf-core/concoct/cutupfasta/**
- tests/modules/nf-core/concoct/cutupfasta/**
concoct/extractfastabins:
- modules/nf-core/concoct/extractfastabins/**
- tests/modules/nf-core/concoct/extractfastabins/**
Expand Down
16 changes: 0 additions & 16 deletions tests/modules/nf-core/concoct/cutupfasta/main.nf

This file was deleted.

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

This file was deleted.

10 changes: 0 additions & 10 deletions tests/modules/nf-core/concoct/cutupfasta/test.yml

This file was deleted.

Loading