Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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: 9 additions & 9 deletions modules/nf-core/genmap/map/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ process GENMAP_MAP {
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "$meta.id"
def bed = regions ? "--selection ${regions}" : ""
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}_map"
def bed = regions ? "--selection ${regions}" : ""

if ("$index" == "${prefix}") error "Input and output names are the same, set prefix in module configuration to disambiguate!"
"""
Expand All @@ -43,13 +43,13 @@ process GENMAP_MAP {
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "$meta.id"
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}_map"
def token_args = args.tokenize(" ")
def wig = token_args.contains("-w") || token_args.contains("--wig") ? "touch ${prefix}.wig" : ""
def bg = token_args.contains("-bg") || token_args.contains("--bedgraph") ? "touch ${prefix}.bedgraph" : ""
def txt = token_args.contains("-t") || token_args.contains("--txt") ? "touch ${prefix}.txt" : ""
def csv = token_args.contains("-d") || token_args.contains("--csv") ? "touch ${prefix}.csv" : ""
def wig = token_args.contains("-w") || token_args.contains("--wig") ? "touch ${prefix}.wig" : ""
def bg = token_args.contains("-bg") || token_args.contains("--bedgraph") ? "touch ${prefix}.bedgraph" : ""
def txt = token_args.contains("-t") || token_args.contains("--txt") ? "touch ${prefix}.txt" : ""
def csv = token_args.contains("-d") || token_args.contains("--csv") ? "touch ${prefix}.csv" : ""

if ("$index" == "${prefix}") error "Input and output names are the same, set prefix in module configuration to disambiguate!"
"""
Expand Down
79 changes: 79 additions & 0 deletions modules/nf-core/genmap/map/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "genmap"
tag "genmap/index"
tag "genmap/map"

setup {
run("GENMAP_INDEX") {
script "../../index/main.nf"
process {
"""
input[0] = [
[id:"test"],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists:true)
]
"""
}
}
}

test("sarscov2 - index bed") {

when {
params {
module_args = "-K 50 -E 2 -w -t -bg -d"
}
process {
"""
input[0] = GENMAP_INDEX.out.index.view()
input[1] = [
[id:"bed"],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists:true)
]
"""
}
}
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}


test("sarscov2 - index bed -- stub") {
options '-stub'
when {
params {
module_args = "-K 50 -E 2 -w -t -bg -d"
}
process {
"""
input[0] = GENMAP_INDEX.out.index
input[1] = [
[id:"bed"],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists:true)
]
"""
}
}
then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out,
path(process.out.versions[0]).yaml
).match() }
)
}
}
}
169 changes: 169 additions & 0 deletions modules/nf-core/genmap/map/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
{
"sarscov2 - index bed": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test_map.wig:md5,c940a5c35af6ac1c11ecc87b7662fc2a"
]
],
"1": [
[
{
"id": "test"
},
"test_map.bedgraph:md5,27ca54c920f3ff0c5985384e557a40f2"
]
],
"2": [
[
{
"id": "test"
},
"test_map.txt:md5,7f9aeaa3d174bb5e6f552efd4f857b4e"
]
],
"3": [
[
{
"id": "test"
},
"test_map.csv:md5,4167a6c7ffbecc1a239c5c1e16b2cbc5"
]
],
"4": [
"versions.yml:md5,c510ddb0e56c8961d4cf9d538a789087"
],
"bedgraph": [
[
{
"id": "test"
},
"test_map.bedgraph:md5,27ca54c920f3ff0c5985384e557a40f2"
]
],
"csv": [
[
{
"id": "test"
},
"test_map.csv:md5,4167a6c7ffbecc1a239c5c1e16b2cbc5"
]
],
"txt": [
[
{
"id": "test"
},
"test_map.txt:md5,7f9aeaa3d174bb5e6f552efd4f857b4e"
]
],
"versions": [
"versions.yml:md5,c510ddb0e56c8961d4cf9d538a789087"
],
"wig": [
[
{
"id": "test"
},
"test_map.wig:md5,c940a5c35af6ac1c11ecc87b7662fc2a"
]
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.4"
},
"timestamp": "2025-04-11T16:10:45.401177409"
},
"sarscov2 - index bed -- stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test_map.wig:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
[
{
"id": "test"
},
"test_map.bedgraph:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"2": [
[
{
"id": "test"
},
"test_map.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"3": [
[
{
"id": "test"
},
"test_map.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"4": [
"versions.yml:md5,c510ddb0e56c8961d4cf9d538a789087"
],
"bedgraph": [
[
{
"id": "test"
},
"test_map.bedgraph:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"csv": [
[
{
"id": "test"
},
"test_map.csv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"txt": [
[
{
"id": "test"
},
"test_map.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,c510ddb0e56c8961d4cf9d538a789087"
],
"wig": [
[
{
"id": "test"
},
"test_map.wig:md5,d41d8cd98f00b204e9800998ecf8427e"
]
]
},
{
"GENMAP_MAP": {
"genmap": "1.3.0"
}
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.4"
},
"timestamp": "2025-04-11T16:10:51.374175856"
}
}
5 changes: 5 additions & 0 deletions modules/nf-core/genmap/map/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: "GENMAP_MAP" {
ext.args = params.module_args
}
}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ gangstr:
gatk/indelrealigner:
- modules/nf-core/gatk/indelrealigner/**
- tests/modules/nf-core/gatk/indelrealigner/**
genmap/map:
- modules/nf-core/genmap/map/**
- tests/modules/nf-core/genmap/map/**
gget/gget:
- modules/nf-core/gget/gget/**
- tests/modules/nf-core/gget/gget/**
Expand Down
22 changes: 0 additions & 22 deletions tests/modules/nf-core/genmap/map/main.nf

This file was deleted.

14 changes: 0 additions & 14 deletions tests/modules/nf-core/genmap/map/nextflow.config

This file was deleted.

15 changes: 0 additions & 15 deletions tests/modules/nf-core/genmap/map/test.yml

This file was deleted.

Loading