2021-04-09 12:04:54 +00:00
|
|
|
// Import generic module functions
|
2021-09-27 08:41:24 +00:00
|
|
|
include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
|
2021-04-09 12:04:54 +00:00
|
|
|
|
|
|
|
params.options = [:]
|
|
|
|
options = initOptions(params.options)
|
|
|
|
|
2021-09-28 13:37:47 +00:00
|
|
|
def VERSION = '2.3.2' // No version information printed
|
|
|
|
|
2021-04-09 12:04:54 +00:00
|
|
|
process RAPIDNJ {
|
|
|
|
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-09 12:04:54 +00:00
|
|
|
|
|
|
|
conda (params.enable_conda ? "bioconda::rapidnj=2.3.2 conda-forge::biopython=1.78" : null)
|
|
|
|
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
|
|
|
container "https://depot.galaxyproject.org/singularity/mulled-v2-805c6e0f138f952f9c61cdd57c632a1a263ea990:3c52e4c8da6b3e4d69b9ca83fa4d366168898179-0"
|
|
|
|
} else {
|
|
|
|
container "quay.io/biocontainers/mulled-v2-805c6e0f138f952f9c61cdd57c632a1a263ea990:3c52e4c8da6b3e4d69b9ca83fa4d366168898179-0"
|
|
|
|
}
|
|
|
|
|
|
|
|
input:
|
|
|
|
path alignment
|
|
|
|
|
|
|
|
output:
|
2021-09-28 13:37:47 +00:00
|
|
|
path "*.sth" , emit: stockholm_alignment
|
|
|
|
path "*.tre" , emit: phylogeny
|
2021-10-01 13:04:56 +00:00
|
|
|
path "versions.yml", emit: versions
|
2021-04-09 12:04:54 +00:00
|
|
|
|
|
|
|
script:
|
|
|
|
"""
|
|
|
|
python \\
|
|
|
|
-c 'from Bio import SeqIO; SeqIO.convert("$alignment", "fasta", "alignment.sth", "stockholm")'
|
|
|
|
|
|
|
|
rapidnj \\
|
|
|
|
alignment.sth \\
|
|
|
|
$options.args \\
|
|
|
|
-i sth \\
|
|
|
|
-c $task.cpus \\
|
|
|
|
-x rapidnj_phylogeny.tre
|
|
|
|
|
2021-09-27 08:41:24 +00:00
|
|
|
cat <<-END_VERSIONS > versions.yml
|
|
|
|
${getProcessName(task.process)}:
|
2021-09-28 13:37:47 +00:00
|
|
|
${getSoftwareName(task.process)}: \$(echo $VERSION)
|
|
|
|
biopython: \$(python -c "import Bio; print(Bio.__version__)")
|
2021-09-27 08:41:24 +00:00
|
|
|
END_VERSIONS
|
2021-04-09 12:04:54 +00:00
|
|
|
"""
|
|
|
|
}
|