2021-04-07 15:31:24 +00:00
|
|
|
// Import generic module functions
|
2021-09-27 08:41:24 +00:00
|
|
|
include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
|
2021-04-07 15:31:24 +00:00
|
|
|
|
|
|
|
params.options = [:]
|
|
|
|
options = initOptions(params.options)
|
|
|
|
|
|
|
|
process GUBBINS {
|
|
|
|
label 'process_medium'
|
|
|
|
publishDir "${params.outdir}",
|
|
|
|
mode: params.publish_dir_mode,
|
2021-04-09 16:23:56 +00:00
|
|
|
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:[:], publish_by_meta:[]) }
|
2021-04-07 15:31:24 +00:00
|
|
|
|
2021-07-28 08:10:44 +00:00
|
|
|
conda (params.enable_conda ? 'bioconda::gubbins=3.0.0' : null)
|
2021-04-07 15:31:24 +00:00
|
|
|
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
2021-07-28 08:10:44 +00:00
|
|
|
container "https://depot.galaxyproject.org/singularity/gubbins:3.0.0--py39h5bf99c6_0"
|
2021-04-07 15:31:24 +00:00
|
|
|
} else {
|
2021-07-28 08:10:44 +00:00
|
|
|
container "quay.io/biocontainers/gubbins:3.0.0--py39h5bf99c6_0"
|
2021-04-07 15:31:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
input:
|
|
|
|
path alignment
|
|
|
|
|
|
|
|
output:
|
|
|
|
path "*.fasta" , emit: fasta
|
|
|
|
path "*.gff" , emit: gff
|
|
|
|
path "*.vcf" , emit: vcf
|
|
|
|
path "*.csv" , emit: stats
|
|
|
|
path "*.phylip" , emit: phylip
|
|
|
|
path "*.recombination_predictions.embl" , emit: embl_predicted
|
|
|
|
path "*.branch_base_reconstruction.embl", emit: embl_branch
|
|
|
|
path "*.final_tree.tre" , emit: tree
|
|
|
|
path "*.node_labelled.final_tree.tre" , emit: tree_labelled
|
2021-10-01 13:04:56 +00:00
|
|
|
path "versions.yml" , emit: versions
|
2021-04-07 15:31:24 +00:00
|
|
|
|
|
|
|
script:
|
|
|
|
"""
|
|
|
|
run_gubbins.py \\
|
|
|
|
--threads $task.cpus \\
|
|
|
|
$options.args \\
|
|
|
|
$alignment
|
2021-09-27 08:41:24 +00:00
|
|
|
cat <<-END_VERSIONS > versions.yml
|
|
|
|
${getProcessName(task.process)}:
|
|
|
|
${getSoftwareName(task.process)}: \$(run_gubbins.py --version 2>&1)
|
|
|
|
END_VERSIONS
|
2021-04-07 15:31:24 +00:00
|
|
|
"""
|
|
|
|
}
|