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-05-02 12:52:54 +00:00
|
|
|
def software = "${motus_downloaddb_script.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-05-02 12:52:54 +00:00
|
|
|
cp $motus_downloaddb_script ${software}
|
2022-04-17 15:22:23 +00:00
|
|
|
python ${software} \\
|
2022-04-17 15:06:06 +00:00
|
|
|
$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-07-07 07:47:41 +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
|
|
|
|
"""
|
|
|
|
}
|