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

40 lines
1.3 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
2022-05-03 16:27:39 +00:00
## mOTUs version number is not available from command line.
## mOTUs save the version number in index database folder.
## mOTUs will check the database version is same version as exec version.
2022-04-14 16:56:42 +00:00
cat <<-END_VERSIONS > versions.yml
"${task.process}":
2022-05-03 16:27:39 +00:00
mOTUs: \$(grep motus db_mOTU/db_mOTU_versions | sed 's/motus\\t//g')
2022-04-14 16:56:42 +00:00
END_VERSIONS
"""
}