diff --git a/modules/antismash/antismashlitedownloaddatabases/main.nf b/modules/antismash/antismashlitedownloaddatabases/main.nf new file mode 100644 index 00000000..1853d80a --- /dev/null +++ b/modules/antismash/antismashlitedownloaddatabases/main.nf @@ -0,0 +1,46 @@ +process ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES { + label 'process_low' + + conda (params.enable_conda ? "bioconda::antismash-lite=6.0.1" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/antismash-lite:6.0.1--pyhdfd78af_1' : + 'quay.io/biocontainers/antismash-lite:6.0.1--pyhdfd78af_1' }" + + /* + These files are normally downloaded by download-antismash-databases itself, and must be retrieved for input by manually running the command with conda or a standalone installation of antiSMASH. Therefore we do not recommend using this module for production pipelines, but rather require users to specify their own local copy of the antiSMASH database in pipelines. This is solely for use for CI tests of the nf-core/module version of antiSMASH. + Reason: Upon execution, the tool checks if certain database files are present within the container and if not, it tries to create them in /usr/local/bin, for which only root user has write permissions. Mounting those database files with this module prevents the tool from trying to create them. + */ + + containerOptions { + workflow.containerEngine == 'singularity' ? + "-B $database_css:/usr/local/lib/python3.8/site-packages/antismash/outputs/html/css,$database_detection:/usr/local/lib/python3.8/site-packages/antismash/detection,$database_modules:/usr/local/lib/python3.8/site-packages/antismash/modules" : + workflow.containerEngine == 'docker' ? + "-v \$PWD/$database_css:/usr/local/lib/python3.8/site-packages/antismash/outputs/html/css -v \$PWD/$database_detection:/usr/local/lib/python3.8/site-packages/antismash/detection -v \$PWD/$database_modules:/usr/local/lib/python3.8/site-packages/antismash/modules" : + '' + } + + input: + path database_css + path database_detection + path database_modules + + output: + path("antismash_db") , emit: database + path "versions.yml", emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + """ + download-antismash-databases \\ + --database-dir antismash_db \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + antismash: \$(antismash --version | sed 's/antiSMASH //') + END_VERSIONS + """ +} diff --git a/modules/antismash/antismashlitedownloaddatabases/meta.yml b/modules/antismash/antismashlitedownloaddatabases/meta.yml new file mode 100644 index 00000000..ad393bae --- /dev/null +++ b/modules/antismash/antismashlitedownloaddatabases/meta.yml @@ -0,0 +1,55 @@ +name: antismash_antismashlitedownloaddatabases +description: antiSMASH allows the rapid genome-wide identification, annotation and analysis of secondary metabolite biosynthesis gene clusters. This module downloads the antiSMASH databases. +keywords: + - secondary metabolites + - BGC + - biosynthetic gene cluster + - genome mining + - NRPS + - RiPP + - antibiotics + - prokaryotes + - bacteria + - eukaryotes + - fungi + - antismash + - database +tools: + - antismash: + description: antiSMASH - the antibiotics and Secondary Metabolite Analysis SHell + homepage: https://docs.antismash.secondarymetabolites.org + documentation: https://docs.antismash.secondarymetabolites.org + tool_dev_url: https://github.com/antismash/antismash + doi: "10.1093/nar/gkab335" + licence: ["AGPL v3"] + +input: + - database_css: + type: directory + description: | + antismash/outputs/html/css folder which is being created during the antiSMASH database downloading step. These files are normally downloaded by download-antismash-databases itself, and must be retrieved by the use by manually running the command with conda or a standalone installation of antiSMASH. Therefore we do not recommend using this module for production pipelines, but rather require users to specify their own local copy of the antiSMASH database in pipelines. + pattern: "css" + - database_detection: + type: directory + description: | + antismash/detection folder which is being created during the antiSMASH database downloading step. These files are normally downloaded by download-antismash-databases itself, and must be retrieved by the use by manually running the command with conda or a standalone installation of antiSMASH. Therefore we do not recommend using this module for production pipelines, but rather require users to specify their own local copy of the antiSMASH database in pipelines. + pattern: "detection" + - database_modules: + type: directory + description: | + antismash/modules folder which is being created during the antiSMASH database downloading step. These files are normally downloaded by download-antismash-databases itself, and must be retrieved by the use by manually running the command with conda or a standalone installation of antiSMASH. Therefore we do not recommend using this module for production pipelines, but rather require users to specify their own local copy of the antiSMASH database in pipelines. + pattern: "modules" + +output: + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + + - database: + type: directory + description: Download directory for antiSMASH databases + pattern: "antismash_db" + +authors: + - "@jasmezz" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index f8db3e87..9a128bd4 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -42,6 +42,10 @@ amrfinderplus/update: - modules/amrfinderplus/update/** - tests/modules/amrfinderplus/update/** +antismash/antismashlitedownloaddatabases: + - modules/antismash/antismashlitedownloaddatabases/** + - tests/modules/antismash/antismashlitedownloaddatabases/** + arriba: - modules/arriba/** - tests/modules/arriba/** diff --git a/tests/modules/antismash/antismashlitedownloaddatabases/main.nf b/tests/modules/antismash/antismashlitedownloaddatabases/main.nf new file mode 100644 index 00000000..d7289acc --- /dev/null +++ b/tests/modules/antismash/antismashlitedownloaddatabases/main.nf @@ -0,0 +1,29 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { UNTAR as UNTAR1 } from '../../../../modules/untar/main.nf' +include { UNTAR as UNTAR2 } from '../../../../modules/untar/main.nf' +include { UNTAR as UNTAR3 } from '../../../../modules/untar/main.nf' +include { ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES } from '../../../../modules/antismash/antismashlitedownloaddatabases/main.nf' + +workflow test_antismash_antismashlitedownloaddatabases { + input1 = [ + [], + file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/antismash/css.tar.gz', checkIfExists: true) + ] + input2 = [ + [], + file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/antismash/detection.tar.gz', checkIfExists: true) + ] + input3 = [ + [], + file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/antismash/modules.tar.gz', checkIfExists: true) + ] + + UNTAR1 ( input1 ) + UNTAR2 ( input2 ) + UNTAR3 ( input3 ) + + ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES ( UNTAR1.out.untar.map{ it[1] }, UNTAR2.out.untar.map{ it[1] }, UNTAR3.out.untar.map{ it[1] } ) +} diff --git a/tests/modules/antismash/antismashlitedownloaddatabases/nextflow.config b/tests/modules/antismash/antismashlitedownloaddatabases/nextflow.config new file mode 100644 index 00000000..06a716aa --- /dev/null +++ b/tests/modules/antismash/antismashlitedownloaddatabases/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} diff --git a/tests/modules/antismash/antismashlitedownloaddatabases/test.yml b/tests/modules/antismash/antismashlitedownloaddatabases/test.yml new file mode 100644 index 00000000..3493bb4b --- /dev/null +++ b/tests/modules/antismash/antismashlitedownloaddatabases/test.yml @@ -0,0 +1,14 @@ +- name: antismash antismashlitedownloaddatabases test_antismash_antismashlitedownloaddatabases + command: nextflow run tests/modules/antismash/antismashlitedownloaddatabases -entry test_antismash_antismashlitedownloaddatabases -c tests/config/nextflow.config + tags: + - antismash/antismashlitedownloaddatabases + - antismash + files: + - path: output/antismash/versions.yml + md5sum: e2656c8d2bcc7469eba40eb1ee5c91b3 + - path: output/antismash/antismash_db + - path: output/antismash/antismash_db/clusterblast + - path: output/antismash/antismash_db/clustercompare + - path: output/antismash/antismash_db/pfam + - path: output/antismash/antismash_db/resfam + - path: output/antismash/antismash_db/tigrfam