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:
|
2022-04-17 15:10:48 +00:00
|
|
|
path motus_downloaddb_script
|
2022-04-14 16:56:42 +00:00
|
|
|
|
|
|
|
output:
|
2022-04-17 15:10:54 +00:00
|
|
|
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-04-28 12:14:30 +00:00
|
|
|
def software = "${motus_downloaddb.simpleName}_copy.py"
|
2022-04-14 16:56:42 +00:00
|
|
|
"""
|
2022-04-17 15:19:58 +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-04-17 15:22:23 +00:00
|
|
|
cp $motus_downloaddb ${software}
|
|
|
|
python ${software} \\
|
2022-04-17 15:06:06 +00:00
|
|
|
$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
|
|
|
|
"""
|
|
|
|
}
|