Skip to content
11 changes: 9 additions & 2 deletions modules/ebi-metagenomics/combinedgenecaller/merge/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ process COMBINEDGENECALLER_MERGE {
tag "${meta.id}"
label 'process_single'

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

input:
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)
val(pyrodigal_version)
val(fgsrs_version)

output:
tuple val(meta), path("*.faa.gz"), emit: faa
Expand Down Expand Up @@ -42,6 +44,9 @@ process COMBINEDGENECALLER_MERGE {
is_mask_compressed = mask.name.endsWith(".gz")
mask_parameter = "--mask ${mask.name.replace(".gz", "")} "
}

def pyrodigal_version_parameter = pyrodigal_version ? "--pyrodigal-version ${pyrodigal_version} " : ""
def fgsrs_version_parameter = fgsrs_version ? "--fgsrs-version ${fgsrs_version} " : ""
"""
if [ "${is_prod_gff_compressed}" == "true" ]; then
gzip -d -c ${pyrodigal_gff} > ${pyrodigal_gff_file}
Expand Down Expand Up @@ -73,7 +78,9 @@ process COMBINEDGENECALLER_MERGE {
--pyrodigal-faa ${pyrodigal_faa_file} \\
--fgsrs-gff ${fgs_gff_file} \\
--fgsrs-ffn ${fgs_ffn_file} \\
--fgsrs-faa ${fgs_faa_file} ${mask_parameter}
--fgsrs-faa ${fgs_faa_file} ${mask_parameter} \\
${pyrodigal_version_parameter} \\
${fgsrs_version_parameter}

gzip -n ${prefix}.{faa,ffn,gff}

Expand Down
6 changes: 6 additions & 0 deletions modules/ebi-metagenomics/combinedgenecaller/merge/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ input:
type: file
description: sequence mask file (tblout files generated by Infernal cmscan or cmsearch)
pattern: "*.*"
- pyrodigal_version:
type: string
description: version string for Pyrodigal tool (optional)
- fgsrs_version:
type: string
description: version string for FragGeneScanRS tool (optional)
output:
- faa:
- meta:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ nextflow_process {
tag "combinedgenecaller"
tag "combinedgenecaller/merge"

test("combinedgenecaller merge without a maskfile") {
test("combinedgenecaller merge without a maskfile and without tool version strings") {

when {
process {
Expand All @@ -24,6 +24,8 @@ nextflow_process {
file(params.mgnify_pipelines_toolkit_testdata + '/combined_gene_caller_merge/input_fgsrs.faa', checkIfExists: true),
[]
]
input[1] = ''
input[2] = ''
"""
}
}
Expand All @@ -36,7 +38,7 @@ nextflow_process {
}
}

test("combinedgenecaller merge with a maskfile") {
test("combinedgenecaller merge with a maskfile and tool version strings") {

when {
process {
Expand All @@ -49,8 +51,10 @@ nextflow_process {
file(params.mgnify_pipelines_toolkit_testdata + '/combined_gene_caller_merge/input_fgsrs.gff', checkIfExists: true),
file(params.mgnify_pipelines_toolkit_testdata + '/combined_gene_caller_merge/input_fgsrs.ffn', checkIfExists: true),
file(params.mgnify_pipelines_toolkit_testdata + '/combined_gene_caller_merge/input_fgsrs.faa', checkIfExists: true),
file(params.mgnify_pipelines_toolkit_testdata + '/combined_gene_caller_merge/cmsearch.all.tblout.deoverlapped', checkIfExists: true),
file(params.mgnify_pipelines_toolkit_testdata + '/combined_gene_caller_merge/cmsearch.all.tblout.deoverlapped', checkIfExists: true)
]
input[1] = '2.0.0'
input[2] = '1.1.0'
"""
}
}
Expand Down
8 changes: 5 additions & 3 deletions subworkflows/ebi-metagenomics/combined_gene_caller/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ include { COMBINEDGENECALLER_MERGE } from '../../../modules/ebi-metagenomics/com
workflow COMBINED_GENE_CALLER {

take:
ch_assembly // channel: [ val(meta), [ fasta ] ]
ch_mask_file // channel: [ val(meta), [.out | .txt] ]
ch_assembly // channel: [ val(meta), [ fasta ] ]
ch_mask_file // channel: [ val(meta), [.out | .txt] ]
pyrodigal_version // string: optional version string for pyrodigal
fgsrs_version // string: optional version string for fraggenescanrs

main:

Expand Down Expand Up @@ -49,7 +51,7 @@ workflow COMBINED_GENE_CALLER {
]
}

COMBINEDGENECALLER_MERGE( ch_merge )
COMBINEDGENECALLER_MERGE( ch_merge, pyrodigal_version, fgsrs_version )

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ nextflow_workflow {
file("${moduleDir}/tests/data/test_assembly.fasta.gz", checkIfExists: true)
]
input[1] = channel.empty()
input[2] = ''
input[3] = ''
"""
}
}
Expand Down Expand Up @@ -67,6 +69,8 @@ nextflow_workflow {
[ id:'test', single_end:false ],
file("${moduleDir}/tests/data/test_tblout.deoverlapped", checkIfExists: true)
])
input[2] = ''
input[3] = ''
"""
}
}
Expand Down Expand Up @@ -106,6 +110,8 @@ nextflow_workflow {
file("${moduleDir}/tests/data/test_assembly.fasta.gz", checkIfExists: true)
]
input[1] = channel.empty()
input[2] = ''
input[3] = ''
"""
}
}
Expand Down