From 1c1e813c670c24bc6de121e424ba790f3e76eeeb Mon Sep 17 00:00:00 2001 From: jasmezz Date: Fri, 22 Apr 2022 16:47:48 +0200 Subject: [PATCH] Initial module creation --- modules/antismash/antismashlite/main.nf | 58 +++++++++ modules/antismash/antismashlite/meta.yml | 121 ++++++++++++++++++ tests/config/pytest_modules.yml | 4 + tests/modules/antismash/antismashlite/main.nf | 49 +++++++ .../antismash/antismashlite/nextflow.config | 5 + .../modules/antismash/antismashlite/test.yml | 37 ++++++ 6 files changed, 274 insertions(+) create mode 100644 modules/antismash/antismashlite/main.nf create mode 100644 modules/antismash/antismashlite/meta.yml create mode 100644 tests/modules/antismash/antismashlite/main.nf create mode 100644 tests/modules/antismash/antismashlite/nextflow.config create mode 100644 tests/modules/antismash/antismashlite/test.yml diff --git a/modules/antismash/antismashlite/main.nf b/modules/antismash/antismashlite/main.nf new file mode 100644 index 00000000..35ca7691 --- /dev/null +++ b/modules/antismash/antismashlite/main.nf @@ -0,0 +1,58 @@ +process ANTISMASH_ANTISMASHLITE { + tag "$meta.id" + label 'process_medium' + + 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' }" + + input: + tuple val(meta), path(sequence_input) + path(databases) + + output: + tuple val(meta), path("${prefix}/clusterblast/*_c*.txt") , optional: true, emit: clusterblast_file + tuple val(meta), path("$prefix/css/*.css") , emit: css_file + tuple val(meta), path("$prefix/images") , emit: image_directory + tuple val(meta), path("$prefix/js/*.js") , emit: javascript + tuple val(meta), path("${prefix}/knownclusterblast/region*/ctg*.html") , optional: true, emit: knownclusterblast_html + tuple val(meta), path("${prefix}/knownclusterblast/*_c*.txt") , optional: true, emit: knownclusterblast_txt + tuple val(meta), path("${prefix}/svg/clusterblast*.svg") , optional: true, emit: svg_files_clusterblast + tuple val(meta), path("${prefix}/svg/knownclusterblast*.svg") , optional: true, emit: svg_files_knownclusterblast + tuple val(meta), path("$prefix/*.gbk") , emit: gbk_input + tuple val(meta), path("$prefix/*.json") , emit: json_results + tuple val(meta), path("$prefix/*.log") , emit: log + tuple val(meta), path("$prefix/*.zip") , emit: zip + tuple val(meta), path("$prefix/*region*.gbk") , emit: gbk_results + tuple val(meta), path("${prefix}/clusterblastoutput.txt") , optional: true, emit: clusterblastoutput + tuple val(meta), path("$prefix/index.html") , emit: html + tuple val(meta), path("${prefix}/knownclusterblastoutput.txt") , optional: true, emit: knownclusterblastoutput + tuple val(meta), path("$prefix/regions.js") , emit: json_sideloading + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}" + + """ + ## We specifically do not include annotations (--genefinding-tool none) as + ## this should be run as a separate module for versioning purposes + antismash \\ + $sequence_input \\ + $args \\ + -c $task.cpus \\ + --output-dir $prefix \\ + --genefinding-tool none \\ + --logfile $prefix/${prefix}.log \\ + --databases $databases + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + antismash: \$(antismash --version | sed 's/antiSMASH //') + END_VERSIONS + """ +} diff --git a/modules/antismash/antismashlite/meta.yml b/modules/antismash/antismashlite/meta.yml new file mode 100644 index 00000000..6a743e0e --- /dev/null +++ b/modules/antismash/antismashlite/meta.yml @@ -0,0 +1,121 @@ +name: antismash_antismashlite +description: antiSMASH allows the rapid genome-wide identification, annotation and analysis of secondary metabolite biosynthesis gene clusters. +keywords: + - secondary metabolites + - BGC + - biosynthetic gene cluster + - genome mining + - NRPS + - RiPP + - antibiotics + - prokaryotes + - bacteria + - eukaryotes + - fungi + - antismash + +tools: + - antismashlite: + 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: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - sequence_input: + type: file + description: nucleotide sequence file (annotated) + pattern: "*.{gbk, gb, gbff, genbank, embl}" + - databases: + type: directory + description: downloaded antismash databases e.g. data/databases + pattern: "*" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - clusterblast_file: + type: file + description: Output of ClusterBlast algorithm + pattern: "clusterblast/*_c*.txt" + - css_file: + type: file + description: Style sheet containing the formatting of HTML output + pattern: "css/*.css" + - image_directory: + type: directory + description: image files for web view of antiSMASH results + pattern: "images" + - javascript: + type: file + description: JavaScript files + pattern: "js/*.js" + - knownclusterblast_html: + type: file + description: Tables with MIBiG hits in HTML format + pattern: "knownclusterblast/region*/ctg*.html" + - knownclusterblast_txt: + type: file + description: Tables with MIBiG hits + pattern: "knownclusterblast/*_c*.txt" + - svg_files_clusterblast: + type: file + description: SVG image showing the % identity of the aligned hits against their queries + pattern: "svg/clusterblast*.svg" + - svg_files_knownclusterblast: + type: file + description: SVG image showing the % identity of the aligned hits against their queries + pattern: "svg/knownclusterblast*.svg" + - gbk_input: + type: file + description: Nucleotide sequence + annotations in GenBank file format; converted from input file + pattern: "*.gbk" + - json_results: + type: file + description: Simple representation of all detected areas during the antiSMASH run in JSON format + pattern: "*.json" + - log: + type: file + description: Contains all the logging output that antiSMASH produced during its run + pattern: "*.log" + - zip: + type: file + description: Contains a compressed version of the folder in zip format + pattern: "*.zip" + - gbk_results: + type: file + description: Nucleotide sequence + annotations in GenBank file format; one file per antiSMASH hit + pattern: "*region*.gbk" + - clusterblastoutput: + type: file + description: Raw BLAST output of known clusters previously predicted by antiSMASH using the built-in ClusterBlast algorithm + pattern: "clusterblastoutput.txt" + - html: + type: file + description: Graphical web view of results in HTML format + patterN: "index.html" + - knownclusterblastoutput: + type: file + description: Raw BLAST output of known clusters of the MIBiG database + pattern: "knownclusterblastoutput.txt" + - json_sideloading: + type: file + description: Sideloaded annotations of protoclusters and/or subregions (see documentation "Annotation sideloading") + pattern: "regions.js" + +authors: + - "@jasmezz" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 19b51f3d..205f463e 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/antismashlite: + - modules/antismash/antismashlite/** + - tests/modules/antismash/antismashlite/** + antismash/antismashlitedownloaddatabases: - modules/antismash/antismashlitedownloaddatabases/** - tests/modules/antismash/antismashlitedownloaddatabases/** diff --git a/tests/modules/antismash/antismashlite/main.nf b/tests/modules/antismash/antismashlite/main.nf new file mode 100644 index 00000000..b442a1b2 --- /dev/null +++ b/tests/modules/antismash/antismashlite/main.nf @@ -0,0 +1,49 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +//include { GUNZIP } from '../../../modules/gunzip/main.nf' +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' +include { ANTISMASH_ANTISMASHLITE } from '../../../../modules/antismash/antismashlite/main.nf' +include { PROKKA } from '../../../modules/prokka/main.nf' + +workflow test_antismashlite { + input = [ + [ id:'test' ], // meta map + file(params.test_data['bacteroides_fragilis']['genome']['genome_gbff_gz'], checkIfExists: true) ] + + input_antismash_db1 = [ + [], + file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/antismash/css.tar.gz', checkIfExists: true) + ] + + input_antismash_db2 = [ + [], + file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/antismash/detection.tar.gz', checkIfExists: true) + ] + + input_antismash_db3 = [ + [], + file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/antismash/modules.tar.gz', checkIfExists: true) + ] + + UNTAR1 ( input_antismash_db1 ) + UNTAR2 ( input_antismash_db2 ) + UNTAR3 ( input_antismash_db3 ) + ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES ( UNTAR1.out.untar.map{ it[1] }, UNTAR2.out.untar.map{ it[1] }, UNTAR3.out.untar.map{ it[1] } ) + ANTISMASH_ANTISMASHLITE ( input, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.database ) +} + +//workflow test_prokka_antismashlite { +// input_gunzip = [ [ id:'test' ], // meta map +// file(params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true) ] + +// GUNZIP ( input_gunzip ) +// PROKKA ( GUNZIP.out.gunzip, [], [] ) +// ANTISMASHLITEDOWNLOADDATABASES () +// ANTISMASH ( PROKKA.out.gbk ) +// } + diff --git a/tests/modules/antismash/antismashlite/nextflow.config b/tests/modules/antismash/antismashlite/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/antismash/antismashlite/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/antismash/antismashlite/test.yml b/tests/modules/antismash/antismashlite/test.yml new file mode 100644 index 00000000..c95de36c --- /dev/null +++ b/tests/modules/antismash/antismashlite/test.yml @@ -0,0 +1,37 @@ +- name: antismash antismashlite test_antismashlite + command: nextflow run ./tests/modules/antismash/antismashlite -entry test_antismashlite -c tests/config/nextflow.config + tags: + - antismash/antismashlite + - antismash + files: + - path: output/antismash/test/NZ_CP069563.1.region001.gbk + contains: ['/tool="antismash"'] + - path: output/antismash/test/NZ_CP069563.1.region002.gbk + contains: ['/tool="antismash"'] + - path: output/antismash/test/css/bacteria.css + md5sum: 8b3c2f8b143d5245a5f42f55803c532c + - path: output/antismash/test/genome.gbk + contains: ['/tool="antismash"'] + - path: output/antismash/test/genome.json + contains: ['{"version": "6.0.1", "input_file": "genome.gbff.gz", "records": [{"id": "NZ_CP069563.1", "seq": {"data":'] + - path: output/antismash/test/genome.zip + - path: output/antismash/test/index.html + md5sum: 4792f0f4faf318035fbec5b4bf0ff76e + - path: output/antismash/test/js/antismash.js + md5sum: 58e90c3d783ae014cc3d51849bcb50a2 + - path: output/antismash/test/js/jquery.js + md5sum: 397754ba49e9e0cf4e7c190da78dda05 + - path: output/antismash/test/js/jquery.tablesorter.min.js + md5sum: 5e9e08cef4d1be0eaa538e6eb28809a7 + - path: output/antismash/test/regions.js + md5sum: dfc82025379d87df63fbfce734e67725 + - path: output/antismash/test/test.log + contains: ['antiSMASH version: 6.0.1'] + - path: output/antismash/versions.yml + md5sum: 7151dfd4d39173338397b2dab50acf8e + - path: output/untar1/versions.yml + md5sum: 42c2c02eb6b5bc47b151bdd2c49bbb2d + - path: output/untar2/versions.yml + md5sum: 5a608b991b7d3e55cc43206939991a2d + - path: output/untar3/versions.yml + md5sum: ec74401950e3820b7575840571a6f00c