nf-core_modules/modules/motus/downloaddb/main.nf

39 lines
1.2 KiB
Text
Raw Normal View History

2022-04-14 16:56:42 +00:00
process MOTUS_DOWNLOADDB {
label 'process_low'
conda (params.enable_conda ? "bioconda::motus=3.0.1" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/motus:3.0.1--pyhdfd78af_0':
'quay.io/biocontainers/motus:3.0.1--pyhdfd78af_0' }"
input:
path motus_downloaddb_script
2022-04-14 16:56:42 +00:00
output:
path "db_mOTU/" , emit: db
2022-04-17 15:22:23 +00:00
path "versions.yml" , emit: versions
2022-04-14 16:56:42 +00:00
when:
task.ext.when == null || task.ext.when
script:
2022-04-17 15:22:23 +00:00
def args = task.ext.args ?: ''
2022-05-02 12:52:54 +00:00
def software = "${motus_downloaddb_script.simpleName}_copy.py"
2022-04-14 16:56:42 +00:00
"""
## must copy script file to working directory,
2022-04-14 16:56:42 +00:00
## otherwise the reference_db will be download to bin folder
## other than current directory
2022-05-02 12:52:54 +00:00
cp $motus_downloaddb_script ${software}
2022-04-17 15:22:23 +00:00
python ${software} \\
$args \\
2022-04-14 16:56:42 +00:00
-t $task.cpus
## clean up
2022-04-17 15:22:23 +00:00
rm ${software}
2022-04-14 16:56:42 +00:00
cat <<-END_VERSIONS > versions.yml
"${task.process}":
2022-05-02 12:41:41 +00:00
mOTUs: \$(echo \$(motus -h 2>&1) | sed 's/^.*Version: //; s/References.*\$//')
2022-04-14 16:56:42 +00:00
END_VERSIONS
"""
}