Skip to content

Commit c1a3901

Browse files
authored
Update AMPCOMBI_PARSETABLES to Include extra output channel (#11989)
* Include extra output channel * Switch database due to dead link for DRAMP * Fix variable tests * Fix lintign
1 parent cc4d441 commit c1a3901

4 files changed

Lines changed: 68 additions & 33 deletions

File tree

modules/nf-core/ampcombi2/parsetables/main.nf

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ process AMPCOMBI2_PARSETABLES {
33
label 'process_medium'
44

55
conda "${moduleDir}/environment.yml"
6-
container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ?
7-
'https://depot.galaxyproject.org/singularity/ampcombi:3.0.0--pyhdfd78af_0':
8-
'quay.io/biocontainers/ampcombi:3.0.0--pyhdfd78af_0' }"
6+
container "${workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container
7+
? 'https://depot.galaxyproject.org/singularity/ampcombi:3.0.0--pyhdfd78af_0'
8+
: 'quay.io/biocontainers/ampcombi:3.0.0--pyhdfd78af_0'}"
99

1010
input:
1111
tuple val(meta), path(amp_input)
@@ -16,18 +16,19 @@ process AMPCOMBI2_PARSETABLES {
1616
path opt_interproscan
1717

1818
output:
19-
tuple val(meta), path("${prefix}/") , emit: sample_dir
20-
tuple val(meta), path("Ampcombi_parse_tables.log") , emit: full_log , optional:true
21-
tuple val(meta), path("amp_${opt_amp_db}_database/") , emit: db , optional:true
19+
tuple val(meta), path("${prefix}/"), emit: sample_dir
20+
tuple val(meta), path("${prefix}/${prefix}_ampcombi.tsv"), emit: tsv, optional: true
21+
tuple val(meta), path("Ampcombi_parse_tables.log"), emit: full_log, optional: true
22+
tuple val(meta), path("amp_${opt_amp_db}_database/"), emit: db, optional: true
2223
tuple val("${task.process}"), val('ampcombi'), eval("ampcombi --version | sed 's/ampcombi //'"), emit: versions_ampcombi, topic: versions
2324

2425
when:
2526
task.ext.when == null || task.ext.when
2627

2728
script:
28-
def args = task.ext.args ?: ''
29-
prefix = task.ext.prefix ?: "${meta.id}"
30-
def db_dir = opt_amp_db_dir ? "--amp_database_dir ${opt_amp_db_dir}" : ""
29+
def args = task.ext.args ?: ''
30+
prefix = task.ext.prefix ?: "${meta.id}"
31+
def db_dir = opt_amp_db_dir ? "--amp_database_dir ${opt_amp_db_dir}" : ""
3132
def interpro = opt_interproscan ? "--interproscan_output ${opt_interproscan}" : ""
3233

3334
"""

modules/nf-core/ampcombi2/parsetables/meta.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,19 @@ output:
8787
description: The output directory that contains the summary output and related
8888
alignment files for one sample.
8989
pattern: "/*"
90+
tsv:
91+
- - meta:
92+
type: map
93+
description: |
94+
Groovy Map containing sample information
95+
e.g. `[ id:'sample1', single_end:false ]`
96+
- ${prefix}/${prefix}_ampcombi.tsv:
97+
type: file
98+
description: A TSV file containing the summary of the AMP detection results for
99+
one sample.
100+
pattern: "/*_ampcombi.tsv"
101+
ontologies:
102+
- edam: "http://edamontology.org/format_3475" # TSV
90103
full_log:
91104
- - meta:
92105
type: map

modules/nf-core/ampcombi2/parsetables/tests/main.nf.test

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ nextflow_process {
2828
input[0] = amp_input
2929
input[1] = faa_input
3030
input[2] = gbk_input
31-
input[3] = 'DRAMP'
31+
input[3] = 'APD'
3232
input[4] = []
3333
input[5] = []
3434
"""
@@ -38,10 +38,12 @@ nextflow_process {
3838
then {
3939
assertAll(
4040
{ assert process.success },
41-
{ assert snapshot(process.out.sample_dir.collect { file(it[1]).getName() } +
42-
process.out.full_log.collect { file(it[1]).readLines().contains("File downloaded successfully") } +
43-
process.out.db.collect { file(it[1]).getName() } +
44-
process.out.findAll { key, val -> key.startsWith('versions') } ).match() }
41+
{ assert snapshot(
42+
process.out.sample_dir.collect { file(it[1]).getName() },
43+
path(process.out.tsv[0][1]).getText().contains("sample_1"),
44+
path(process.out.full_log[0][1]).getText().contains("Creating MMseqs2 directory for fasta file in"),
45+
process.out.db.collect { file(it[1]).getName() },
46+
process.out.findAll { key, val -> key.startsWith('versions') } ).match() },
4547
)
4648
}
4749
}
@@ -63,7 +65,7 @@ nextflow_process {
6365
input[0] = amp_input
6466
input[1] = faa_input
6567
input[2] = gbk_input
66-
input[3] = 'DRAMP'
68+
input[3] = 'APD'
6769
input[4] = []
6870
input[5] = []
6971
"""

modules/nf-core/ampcombi2/parsetables/tests/main.nf.test.snap

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,27 @@
22
"ampcombi2_parsetables - metagenome": {
33
"content": [
44
[
5-
"sample_1",
6-
false,
7-
"amp_DRAMP_database",
8-
{
9-
"versions_ampcombi": [
10-
[
11-
"AMPCOMBI2_PARSETABLES",
12-
"ampcombi",
13-
"3.0.0"
14-
]
5+
"sample_1"
6+
],
7+
true,
8+
true,
9+
[
10+
"amp_APD_database"
11+
],
12+
{
13+
"versions_ampcombi": [
14+
[
15+
"AMPCOMBI2_PARSETABLES",
16+
"ampcombi",
17+
"3.0.0"
1518
]
16-
}
17-
]
19+
]
20+
}
1821
],
19-
"timestamp": "2026-04-23T19:09:35.917379447",
22+
"timestamp": "2026-06-12T15:33:40.134609032",
2023
"meta": {
2124
"nf-test": "0.9.5",
22-
"nextflow": "25.10.4"
25+
"nextflow": "26.04.3"
2326
}
2427
},
2528
"ampcombi2_parsetables - metagenome - stub": {
@@ -43,10 +46,18 @@
4346
{
4447
"id": "sample_1"
4548
},
46-
"Ampcombi_parse_tables.log:md5,d41d8cd98f00b204e9800998ecf8427e"
49+
"sample_1_ampcombi.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
4750
]
4851
],
4952
"2": [
53+
[
54+
{
55+
"id": "sample_1"
56+
},
57+
"Ampcombi_parse_tables.log:md5,d41d8cd98f00b204e9800998ecf8427e"
58+
]
59+
],
60+
"3": [
5061
[
5162
{
5263
"id": "sample_1"
@@ -67,7 +78,7 @@
6778
]
6879
]
6980
],
70-
"3": [
81+
"4": [
7182
[
7283
"AMPCOMBI2_PARSETABLES",
7384
"ampcombi",
@@ -116,6 +127,14 @@
116127
]
117128
]
118129
],
130+
"tsv": [
131+
[
132+
{
133+
"id": "sample_1"
134+
},
135+
"sample_1_ampcombi.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
136+
]
137+
],
119138
"versions_ampcombi": [
120139
[
121140
"AMPCOMBI2_PARSETABLES",
@@ -125,10 +144,10 @@
125144
]
126145
}
127146
],
128-
"timestamp": "2026-04-23T19:17:18.712188072",
147+
"timestamp": "2026-06-12T14:49:48.909595472",
129148
"meta": {
130149
"nf-test": "0.9.5",
131-
"nextflow": "25.10.4"
150+
"nextflow": "26.04.3"
132151
}
133152
}
134153
}

0 commit comments

Comments
 (0)