Skip to content

Commit 0983baa

Browse files
authored
Merge pull request #146 from SantiagoSanchezF/chore/combinegenecaller_add_params_to_support_tool_version_strings
chore(combinegenecaller): Add params to support tool version strings
2 parents 35f4eee + 38adca2 commit 0983baa

File tree

5 files changed

+33
-8
lines changed

5 files changed

+33
-8
lines changed

modules/ebi-metagenomics/combinedgenecaller/merge/main.nf

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ process COMBINEDGENECALLER_MERGE {
22
tag "${meta.id}"
33
label 'process_single'
44

5-
container "microbiome-informatics/mgnify-pipelines-toolkit:1.4.12"
5+
container "microbiome-informatics/mgnify-pipelines-toolkit:1.4.17"
66

77
input:
88
tuple val(meta), path(pyrodigal_gff, stageAs: "pyrodigal/"), path(pyrodigal_ffn, stageAs: "pyrodigal/"), path(pyrodigal_faa, stageAs: "pyrodigal/"), path(fgs_gff, stageAs: "fgsrs/"), path(fgs_ffn, stageAs: "fgsrs/"), path(fgs_faa, stageAs: "fgsrs/"), path(mask)
9+
val(pyrodigal_version)
10+
val(fgsrs_version)
911

1012
output:
1113
tuple val(meta), path("*.faa.gz"), emit: faa
@@ -42,6 +44,9 @@ process COMBINEDGENECALLER_MERGE {
4244
is_mask_compressed = mask.name.endsWith(".gz")
4345
mask_parameter = "--mask ${mask.name.replace(".gz", "")} "
4446
}
47+
48+
def pyrodigal_version_parameter = pyrodigal_version ? "--pyrodigal-version ${pyrodigal_version} " : ""
49+
def fgsrs_version_parameter = fgsrs_version ? "--fgsrs-version ${fgsrs_version} " : ""
4550
"""
4651
if [ "${is_prod_gff_compressed}" == "true" ]; then
4752
gzip -d -c ${pyrodigal_gff} > ${pyrodigal_gff_file}
@@ -73,7 +78,9 @@ process COMBINEDGENECALLER_MERGE {
7378
--pyrodigal-faa ${pyrodigal_faa_file} \\
7479
--fgsrs-gff ${fgs_gff_file} \\
7580
--fgsrs-ffn ${fgs_ffn_file} \\
76-
--fgsrs-faa ${fgs_faa_file} ${mask_parameter}
81+
--fgsrs-faa ${fgs_faa_file} ${mask_parameter} \\
82+
${pyrodigal_version_parameter} \\
83+
${fgsrs_version_parameter}
7784
7885
gzip -n ${prefix}.{faa,ffn,gff}
7986

modules/ebi-metagenomics/combinedgenecaller/merge/meta.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ input:
5353
type: file
5454
description: sequence mask file (tblout files generated by Infernal cmscan or cmsearch)
5555
pattern: "*.*"
56+
- pyrodigal_version:
57+
type: string
58+
description: version string for Pyrodigal tool (optional)
59+
- fgsrs_version:
60+
type: string
61+
description: version string for FragGeneScanRS tool (optional)
5662
output:
5763
- faa:
5864
- meta:

modules/ebi-metagenomics/combinedgenecaller/merge/tests/main.nf.test

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ nextflow_process {
99
tag "combinedgenecaller"
1010
tag "combinedgenecaller/merge"
1111

12-
test("combinedgenecaller merge without a maskfile") {
12+
test("combinedgenecaller merge without a maskfile and without tool version strings") {
1313

1414
when {
1515
process {
@@ -24,6 +24,8 @@ nextflow_process {
2424
file(params.mgnify_pipelines_toolkit_testdata + '/combined_gene_caller_merge/input_fgsrs.faa', checkIfExists: true),
2525
[]
2626
]
27+
input[1] = ''
28+
input[2] = ''
2729
"""
2830
}
2931
}
@@ -36,7 +38,7 @@ nextflow_process {
3638
}
3739
}
3840

39-
test("combinedgenecaller merge with a maskfile") {
41+
test("combinedgenecaller merge with a maskfile and tool version strings") {
4042

4143
when {
4244
process {
@@ -49,8 +51,10 @@ nextflow_process {
4951
file(params.mgnify_pipelines_toolkit_testdata + '/combined_gene_caller_merge/input_fgsrs.gff', checkIfExists: true),
5052
file(params.mgnify_pipelines_toolkit_testdata + '/combined_gene_caller_merge/input_fgsrs.ffn', checkIfExists: true),
5153
file(params.mgnify_pipelines_toolkit_testdata + '/combined_gene_caller_merge/input_fgsrs.faa', checkIfExists: true),
52-
file(params.mgnify_pipelines_toolkit_testdata + '/combined_gene_caller_merge/cmsearch.all.tblout.deoverlapped', checkIfExists: true),
54+
file(params.mgnify_pipelines_toolkit_testdata + '/combined_gene_caller_merge/cmsearch.all.tblout.deoverlapped', checkIfExists: true)
5355
]
56+
input[1] = '2.0.0'
57+
input[2] = '1.1.0'
5458
"""
5559
}
5660
}

subworkflows/ebi-metagenomics/combined_gene_caller/main.nf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ include { COMBINEDGENECALLER_MERGE } from '../../../modules/ebi-metagenomics/com
77
workflow COMBINED_GENE_CALLER {
88

99
take:
10-
ch_assembly // channel: [ val(meta), [ fasta ] ]
11-
ch_mask_file // channel: [ val(meta), [.out | .txt] ]
10+
ch_assembly // channel: [ val(meta), [ fasta ] ]
11+
ch_mask_file // channel: [ val(meta), [.out | .txt] ]
12+
pyrodigal_version // string: optional version string for pyrodigal
13+
fgsrs_version // string: optional version string for fraggenescanrs
1214

1315
main:
1416

@@ -49,7 +51,7 @@ workflow COMBINED_GENE_CALLER {
4951
]
5052
}
5153

52-
COMBINEDGENECALLER_MERGE( ch_merge )
54+
COMBINEDGENECALLER_MERGE( ch_merge, pyrodigal_version, fgsrs_version )
5355

5456
ch_versions = ch_versions.mix(COMBINEDGENECALLER_MERGE.out.versions)
5557

subworkflows/ebi-metagenomics/combined_gene_caller/tests/main.nf.test

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ nextflow_workflow {
3333
file("${moduleDir}/tests/data/test_assembly.fasta.gz", checkIfExists: true)
3434
]
3535
input[1] = channel.empty()
36+
input[2] = ''
37+
input[3] = ''
3638
"""
3739
}
3840
}
@@ -67,6 +69,8 @@ nextflow_workflow {
6769
[ id:'test', single_end:false ],
6870
file("${moduleDir}/tests/data/test_tblout.deoverlapped", checkIfExists: true)
6971
])
72+
input[2] = ''
73+
input[3] = ''
7074
"""
7175
}
7276
}
@@ -106,6 +110,8 @@ nextflow_workflow {
106110
file("${moduleDir}/tests/data/test_assembly.fasta.gz", checkIfExists: true)
107111
]
108112
input[1] = channel.empty()
113+
input[2] = ''
114+
input[3] = ''
109115
"""
110116
}
111117
}

0 commit comments

Comments
 (0)