Skip to content

Commit

Permalink
Bump concoct/cutupfasta version, add stub, add nf-test (#5864)
Browse files Browse the repository at this point in the history
* Bump concoct/cutupfasta version, add stub, add nf-test

* Fix linting
  • Loading branch information
jfy133 authored Jun 21, 2024
1 parent f958600 commit 73a6d7e
Show file tree
Hide file tree
Showing 9 changed files with 163 additions and 37 deletions.
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
"""
}
2 changes: 1 addition & 1 deletion modules/nf-core/concoct/cutupfasta/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tools:
documentation: "https://concoct.readthedocs.io/en/latest/index.html"
tool_dev_url: "https://github.com/BinPro/CONCOCT"
doi: "10.1038/nmeth.3103"
licence: "['FreeBSD']"
licence: ["FreeBSD"]
input:
- meta:
type: map
Expand Down
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.

0 comments on commit 73a6d7e

Please sign in to comment.