From 1c1e813c670c24bc6de121e424ba790f3e76eeeb Mon Sep 17 00:00:00 2001 From: jasmezz Date: Fri, 22 Apr 2022 16:47:48 +0200 Subject: [PATCH 01/18] 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 From 1acde9a7a1263b9fa9b9c5ed5e92c7268ecbdd2a Mon Sep 17 00:00:00 2001 From: jasmezz Date: Tue, 26 Apr 2022 16:28:39 +0200 Subject: [PATCH 02/18] Fix container volume mounts --- modules/antismash/antismashlite/main.nf | 15 +++- modules/antismash/antismashlite/meta.yml | 15 ++++ tests/modules/antismash/antismashlite/main.nf | 55 ++++++++----- .../modules/antismash/antismashlite/test.yml | 78 +++++++++++++++++-- 4 files changed, 137 insertions(+), 26 deletions(-) diff --git a/modules/antismash/antismashlite/main.nf b/modules/antismash/antismashlite/main.nf index 35ca7691..645e389f 100644 --- a/modules/antismash/antismashlite/main.nf +++ b/modules/antismash/antismashlite/main.nf @@ -7,9 +7,20 @@ process ANTISMASH_ANTISMASHLITE { 'https://depot.galaxyproject.org/singularity/antismash-lite:6.0.1--pyhdfd78af_1' : 'quay.io/biocontainers/antismash-lite:6.0.1--pyhdfd78af_1' }" + containerOptions { + workflow.containerEngine == 'singularity' ? + "-B $css_dir:/usr/local/lib/python3.8/site-packages/antismash/outputs/html/css,$detection_dir:/usr/local/lib/python3.8/site-packages/antismash/detection,$modules_dir:/usr/local/lib/python3.8/site-packages/antismash/modules" : + workflow.containerEngine == 'docker' ? + "-v \$PWD/$css_dir:/usr/local/lib/python3.8/site-packages/antismash/outputs/html/css -v \$PWD/$detection_dir:/usr/local/lib/python3.8/site-packages/antismash/detection -v \$PWD/$modules_dir:/usr/local/lib/python3.8/site-packages/antismash/modules" : + '' + } + input: tuple val(meta), path(sequence_input) path(databases) + path css_dir + path detection_dir + path modules_dir output: tuple val(meta), path("${prefix}/clusterblast/*_c*.txt") , optional: true, emit: clusterblast_file @@ -42,13 +53,13 @@ process ANTISMASH_ANTISMASHLITE { ## 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 + --databases $databases \\ + $sequence_input cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/antismash/antismashlite/meta.yml b/modules/antismash/antismashlite/meta.yml index 6a743e0e..fa7e21a6 100644 --- a/modules/antismash/antismashlite/meta.yml +++ b/modules/antismash/antismashlite/meta.yml @@ -37,6 +37,21 @@ input: type: directory description: downloaded antismash databases e.g. data/databases pattern: "*" + - css_dir: + 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" + - detection_dir: + 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" + - modules_dir: + 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: - meta: diff --git a/tests/modules/antismash/antismashlite/main.nf b/tests/modules/antismash/antismashlite/main.nf index b442a1b2..19e3b5f8 100644 --- a/tests/modules/antismash/antismashlite/main.nf +++ b/tests/modules/antismash/antismashlite/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -//include { GUNZIP } from '../../../modules/gunzip/main.nf' +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' @@ -10,40 +10,57 @@ include { ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES } from '../../../modules/anti 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) ] +// 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, UNTAR1.out.untar.map{ it[1] }, UNTAR2.out.untar.map{ it[1] }, UNTAR3.out.untar.map{ it[1] } ) +//} + +workflow test_prokka_antismashlite { + input_gunzip = [ [ id:'test' ], // meta map + file(params.test_data['bacteroides_fragilis']['genome']['genome_fna_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 = [ + 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 = [ + input_antismash_db3 = [ [], file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/antismash/modules.tar.gz', checkIfExists: true) ] + GUNZIP ( input_gunzip ) + PROKKA ( GUNZIP.out.gunzip, [], [] ) 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 ) + ANTISMASH_ANTISMASHLITE ( PROKKA.out.gbk, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.database, UNTAR1.out.untar.map{ it[1] }, UNTAR2.out.untar.map{ it[1] }, UNTAR3.out.untar.map{ it[1] } ) } - -//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/test.yml b/tests/modules/antismash/antismashlite/test.yml index c95de36c..3fcba1e4 100644 --- a/tests/modules/antismash/antismashlite/test.yml +++ b/tests/modules/antismash/antismashlite/test.yml @@ -1,5 +1,5 @@ - name: antismash antismashlite test_antismashlite - command: nextflow run ./tests/modules/antismash/antismashlite -entry test_antismashlite -c tests/config/nextflow.config + command: nextflow run tests/modules/antismash/antismashlite -entry test_antismashlite -c tests/config/nextflow.config tags: - antismash/antismashlite - antismash @@ -16,7 +16,7 @@ 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 + md5sum: 32aaf51315258af3b300d9a5bafd7bdc - path: output/antismash/test/js/antismash.js md5sum: 58e90c3d783ae014cc3d51849bcb50a2 - path: output/antismash/test/js/jquery.js @@ -30,8 +30,76 @@ - path: output/antismash/versions.yml md5sum: 7151dfd4d39173338397b2dab50acf8e - path: output/untar1/versions.yml - md5sum: 42c2c02eb6b5bc47b151bdd2c49bbb2d + md5sum: 1e4721017721c45370996318e6b807e5 - path: output/untar2/versions.yml - md5sum: 5a608b991b7d3e55cc43206939991a2d + md5sum: a6ae4977a432f3c5ef26687cec8622de - path: output/untar3/versions.yml - md5sum: ec74401950e3820b7575840571a6f00c + md5sum: a5ee00c1c426ed601ff654891ba0f645 + +- name: antismash antismashlite test_prokka_antismashlite + command: nextflow run tests/modules/antismash/antismashlite -entry test_prokka_antismashlite -c tests/config/nextflow.config + tags: + - antismash + - antismash/antismashlite + 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/index.html + md5sum: 3773c3ec61fb1e8cd9a67791b37d9b79 + - 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 + contains: [ '"seq_id": "NZ_CP069563.1"' ] + - path: output/antismash/test/test.gbk + contains: ['/tool="antismash"'] + - path: output/antismash/test/test.json + contains: ['"id": "NZ_CP069563.1"'] + - path: output/antismash/test/test.log + contains: ['antiSMASH status: SUCCESS'] + - path: output/antismash/test/test.zip + - path: output/antismash/versions.yml + md5sum: da6bed0032d0f7ad4741e0074ad6b1ff + - path: output/gunzip/genome.fna + md5sum: dafd38f5454b54fbea38245d773062a5 + - path: output/gunzip/versions.yml + md5sum: 93ce587e93791c8cf500482d42b6069f + - path: output/prokka/test/test.err + md5sum: 194fd8a1d1cde9919841a1afd4414760 + - path: output/prokka/test/test.faa + md5sum: 8fefbfa7860f280cc881c3a3b377d6da + - path: output/prokka/test/test.ffn + md5sum: 9c4d4d7dc28625bcb13c6fbd27ca13c3 + - path: output/prokka/test/test.fna + md5sum: 96aa7707b864499745e8946f169ae8e0 + - path: output/prokka/test/test.fsa + md5sum: dbe7d3d43d46920802d2aec5cd177ddc + - path: output/prokka/test/test.gbk + md5sum: 286ea011a64c0d281de3981ed2f296ff + - path: output/prokka/test/test.gff + md5sum: 9f733b702454e7750b7d4686369fe7e4 + - path: output/prokka/test/test.log + contains: ["Annotation finished successfully."] + - path: output/prokka/test/test.sqn + md5sum: a901ac190675f976e373219f0191d067 + - path: output/prokka/test/test.tbl + md5sum: 98f3b705f47b40255631ae43823e8271 + - path: output/prokka/test/test.tsv + md5sum: 26e8aa4b2212f320e82b6db7c93d4461 + - path: output/prokka/test/test.txt + md5sum: aea5834a64dff02d3588cecbe25c3914 + - path: output/prokka/versions.yml + md5sum: 286ac10895a9f26ee8dd933dbc5d2b1c + - path: output/untar1/versions.yml + md5sum: 6c1bfedb010be6dfee273aa267b1cae3 + - path: output/untar2/versions.yml + md5sum: 65db3fe9c809e5371158deae444fb343 + - path: output/untar3/versions.yml + md5sum: 713d3aa0ee24ff680a8024cc53765d60 From cc05006dbb3896cdfd65a42b9b7000e58e2a6c0a Mon Sep 17 00:00:00 2001 From: jasmezz Date: Tue, 26 Apr 2022 17:15:41 +0200 Subject: [PATCH 03/18] Update antismashlite module main.nf --- tests/modules/antismash/antismashlite/main.nf | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/tests/modules/antismash/antismashlite/main.nf b/tests/modules/antismash/antismashlite/main.nf index 19e3b5f8..14bb7552 100644 --- a/tests/modules/antismash/antismashlite/main.nf +++ b/tests/modules/antismash/antismashlite/main.nf @@ -10,32 +10,32 @@ include { ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES } from '../../../modules/anti 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) ] +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_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_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) -// ] + 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, UNTAR1.out.untar.map{ it[1] }, UNTAR2.out.untar.map{ it[1] }, UNTAR3.out.untar.map{ it[1] } ) -//} + 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, UNTAR1.out.untar.map{ it[1] }, UNTAR2.out.untar.map{ it[1] }, UNTAR3.out.untar.map{ it[1] } ) +} workflow test_prokka_antismashlite { input_gunzip = [ [ id:'test' ], // meta map From 259f993df79e0e45f2b4709053a8b121ea09967b Mon Sep 17 00:00:00 2001 From: Jasmin F <73216762+jasmezz@users.noreply.github.com> Date: Wed, 27 Apr 2022 10:06:58 +0200 Subject: [PATCH 04/18] Update tool name --- modules/antismash/antismashlite/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/antismash/antismashlite/main.nf b/modules/antismash/antismashlite/main.nf index 645e389f..6f1c0fcd 100644 --- a/modules/antismash/antismashlite/main.nf +++ b/modules/antismash/antismashlite/main.nf @@ -63,7 +63,7 @@ process ANTISMASH_ANTISMASHLITE { cat <<-END_VERSIONS > versions.yml "${task.process}": - antismash: \$(antismash --version | sed 's/antiSMASH //') + antismash-lite: \$(antismash --version | sed 's/antiSMASH //') END_VERSIONS """ } From 4a4de550b89220a3f12947cd546ad78bc1f9d479 Mon Sep 17 00:00:00 2001 From: jasmezz Date: Mon, 2 May 2022 17:30:46 +0200 Subject: [PATCH 05/18] Simplify/reduce container mount volumes --- modules/antismash/antismashlite/main.nf | 8 +++---- modules/antismash/antismashlite/meta.yml | 16 +++----------- tests/modules/antismash/antismashlite/main.nf | 6 ++--- .../modules/antismash/antismashlite/test.yml | 22 +++---------------- 4 files changed, 12 insertions(+), 40 deletions(-) diff --git a/modules/antismash/antismashlite/main.nf b/modules/antismash/antismashlite/main.nf index 6f1c0fcd..c92f983e 100644 --- a/modules/antismash/antismashlite/main.nf +++ b/modules/antismash/antismashlite/main.nf @@ -9,18 +9,16 @@ process ANTISMASH_ANTISMASHLITE { containerOptions { workflow.containerEngine == 'singularity' ? - "-B $css_dir:/usr/local/lib/python3.8/site-packages/antismash/outputs/html/css,$detection_dir:/usr/local/lib/python3.8/site-packages/antismash/detection,$modules_dir:/usr/local/lib/python3.8/site-packages/antismash/modules" : + "-B $antismash_dir:/usr/local/lib/python3.8/site-packages/antismash" : workflow.containerEngine == 'docker' ? - "-v \$PWD/$css_dir:/usr/local/lib/python3.8/site-packages/antismash/outputs/html/css -v \$PWD/$detection_dir:/usr/local/lib/python3.8/site-packages/antismash/detection -v \$PWD/$modules_dir:/usr/local/lib/python3.8/site-packages/antismash/modules" : + "-v \$PWD/$antismash_dir:/usr/local/lib/python3.8/site-packages/antismash" : '' } input: tuple val(meta), path(sequence_input) path(databases) - path css_dir - path detection_dir - path modules_dir + path(antismash_dir) // Optional input: AntiSMASH installation folder. It is not needed for using this module with conda, but required for docker/singularity (see meta.yml). output: tuple val(meta), path("${prefix}/clusterblast/*_c*.txt") , optional: true, emit: clusterblast_file diff --git a/modules/antismash/antismashlite/meta.yml b/modules/antismash/antismashlite/meta.yml index fa7e21a6..d726ad3e 100644 --- a/modules/antismash/antismashlite/meta.yml +++ b/modules/antismash/antismashlite/meta.yml @@ -37,21 +37,11 @@ input: type: directory description: downloaded antismash databases e.g. data/databases pattern: "*" - - css_dir: + - antismash_dir: 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" - - detection_dir: - 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" - - modules_dir: - 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" + antismash installation folder which is being modified during the antiSMASH database downloading step. The modified files are normally downloaded by download-antismash-databases itself, and must be retrieved by the user by manually running the command within antismash-lite. As this folder cannot be modified within the docker and singularity containers, it needs to be mounted (including all modified files from the downloading step) as a workaround. + pattern: "*" output: - meta: diff --git a/tests/modules/antismash/antismashlite/main.nf b/tests/modules/antismash/antismashlite/main.nf index 14bb7552..536d1266 100644 --- a/tests/modules/antismash/antismashlite/main.nf +++ b/tests/modules/antismash/antismashlite/main.nf @@ -11,7 +11,7 @@ include { ANTISMASH_ANTISMASHLITE } from '../../../../modules/antismash/antismas include { PROKKA } from '../../../modules/prokka/main.nf' workflow test_antismashlite { - input = [ + input_genome = [ [ id:'test' ], // meta map file(params.test_data['bacteroides_fragilis']['genome']['genome_gbff_gz'], checkIfExists: true) ] @@ -34,7 +34,7 @@ workflow test_antismashlite { 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, UNTAR1.out.untar.map{ it[1] }, UNTAR2.out.untar.map{ it[1] }, UNTAR3.out.untar.map{ it[1] } ) + ANTISMASH_ANTISMASHLITE ( input_genome, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.database, [] ) } workflow test_prokka_antismashlite { @@ -62,5 +62,5 @@ workflow test_prokka_antismashlite { 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 ( PROKKA.out.gbk, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.database, UNTAR1.out.untar.map{ it[1] }, UNTAR2.out.untar.map{ it[1] }, UNTAR3.out.untar.map{ it[1] } ) + ANTISMASH_ANTISMASHLITE ( PROKKA.out.gbk, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.database, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.antismash_dir ) } diff --git a/tests/modules/antismash/antismashlite/test.yml b/tests/modules/antismash/antismashlite/test.yml index 3fcba1e4..a2adad79 100644 --- a/tests/modules/antismash/antismashlite/test.yml +++ b/tests/modules/antismash/antismashlite/test.yml @@ -24,23 +24,17 @@ - path: output/antismash/test/js/jquery.tablesorter.min.js md5sum: 5e9e08cef4d1be0eaa538e6eb28809a7 - path: output/antismash/test/regions.js - md5sum: dfc82025379d87df63fbfce734e67725 + contains: ['"seq_id": "NZ_CP069563.1"'] - 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: 1e4721017721c45370996318e6b807e5 - - path: output/untar2/versions.yml - md5sum: a6ae4977a432f3c5ef26687cec8622de - - path: output/untar3/versions.yml - md5sum: a5ee00c1c426ed601ff654891ba0f645 + md5sum: 759431a43da33e2ef8e2d0ebd79a439b - name: antismash antismashlite test_prokka_antismashlite command: nextflow run tests/modules/antismash/antismashlite -entry test_prokka_antismashlite -c tests/config/nextflow.config tags: - - antismash - antismash/antismashlite + - antismash files: - path: output/antismash/test/NZ_CP069563.1.region001.gbk contains: ['/tool="antismash"'] @@ -69,8 +63,6 @@ md5sum: da6bed0032d0f7ad4741e0074ad6b1ff - path: output/gunzip/genome.fna md5sum: dafd38f5454b54fbea38245d773062a5 - - path: output/gunzip/versions.yml - md5sum: 93ce587e93791c8cf500482d42b6069f - path: output/prokka/test/test.err md5sum: 194fd8a1d1cde9919841a1afd4414760 - path: output/prokka/test/test.faa @@ -95,11 +87,3 @@ md5sum: 26e8aa4b2212f320e82b6db7c93d4461 - path: output/prokka/test/test.txt md5sum: aea5834a64dff02d3588cecbe25c3914 - - path: output/prokka/versions.yml - md5sum: 286ac10895a9f26ee8dd933dbc5d2b1c - - path: output/untar1/versions.yml - md5sum: 6c1bfedb010be6dfee273aa267b1cae3 - - path: output/untar2/versions.yml - md5sum: 65db3fe9c809e5371158deae444fb343 - - path: output/untar3/versions.yml - md5sum: 713d3aa0ee24ff680a8024cc53765d60 From 35cc8152b877ed30dd061261f5196e474dcc1775 Mon Sep 17 00:00:00 2001 From: jasmezz Date: Mon, 2 May 2022 17:55:39 +0200 Subject: [PATCH 06/18] Fix missing test input --- tests/modules/antismash/antismashlite/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/modules/antismash/antismashlite/main.nf b/tests/modules/antismash/antismashlite/main.nf index 536d1266..3044250a 100644 --- a/tests/modules/antismash/antismashlite/main.nf +++ b/tests/modules/antismash/antismashlite/main.nf @@ -34,7 +34,7 @@ workflow test_antismashlite { 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_genome, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.database, [] ) + ANTISMASH_ANTISMASHLITE ( input_genome, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.database, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.antismash_dir ) } workflow test_prokka_antismashlite { From fa9f0753de4b4040b5b7b9a28ffa2c7f59c4e6ca Mon Sep 17 00:00:00 2001 From: jasmezz Date: Tue, 3 May 2022 17:30:16 +0200 Subject: [PATCH 07/18] Apply review suggestions + add stub for prokka test workflow --- modules/antismash/antismashlite/main.nf | 47 +++++++++++--- modules/antismash/antismashlite/meta.yml | 8 +-- tests/modules/antismash/antismashlite/main.nf | 21 ++++++- .../modules/antismash/antismashlite/test.yml | 63 +++++++++++-------- 4 files changed, 97 insertions(+), 42 deletions(-) diff --git a/modules/antismash/antismashlite/main.nf b/modules/antismash/antismashlite/main.nf index c92f983e..a4998be6 100644 --- a/modules/antismash/antismashlite/main.nf +++ b/modules/antismash/antismashlite/main.nf @@ -22,22 +22,22 @@ process ANTISMASH_ANTISMASHLITE { 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}/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}/*.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}/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 + tuple val(meta), path("${prefix}/regions.js") , emit: json_sideloading path "versions.yml" , emit: versions when: @@ -64,4 +64,31 @@ process ANTISMASH_ANTISMASHLITE { antismash-lite: \$(antismash --version | sed 's/antiSMASH //') END_VERSIONS """ + + stub: + """ + mkdir ${prefix} + touch ${prefix}/clusterblast/stub_c.stub.txt + touch ${prefix}/css/stub.css + touch ${prefix}/images + touch ${prefix}/js/stub.js + touch ${prefix}/knownclusterblast/regionstub/ctg.stub.html + touch ${prefix}/knownclusterblast/stub._c.stub.txt + touch ${prefix}/svg/clusterblast.stub.svg + touch ${prefix}/svg/knownclusterblast.stub.svg + touch ${prefix}/stub.gbk + touch ${prefix}/stub.json + touch ${prefix}/stub.log + touch ${prefix}/stub.zip + touch ${prefix}/stub.region.stub.gbk + touch ${prefix}/clusterblastoutput.txt + touch ${prefix}/index.html + touch ${prefix}/knownclusterblastoutput.txt + touch ${prefix}/regions.js + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + antismash-lite: \$(antismash --version | sed 's/antiSMASH //') + END_VERSIONS + """ } diff --git a/modules/antismash/antismashlite/meta.yml b/modules/antismash/antismashlite/meta.yml index d726ad3e..22056202 100644 --- a/modules/antismash/antismashlite/meta.yml +++ b/modules/antismash/antismashlite/meta.yml @@ -87,11 +87,11 @@ output: pattern: "svg/knownclusterblast*.svg" - gbk_input: type: file - description: Nucleotide sequence + annotations in GenBank file format; converted from input file + description: Nucleotide sequence + annotations in GenBank 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 + description: Nucleotide sequence + annotations in JSON format; converted from GenBank file (gbk_input) pattern: "*.json" - log: type: file @@ -99,11 +99,11 @@ output: pattern: "*.log" - zip: type: file - description: Contains a compressed version of the folder in zip format + description: Contains a compressed version of the output folder in zip format pattern: "*.zip" - gbk_results: type: file - description: Nucleotide sequence + annotations in GenBank file format; one file per antiSMASH hit + description: Nucleotide sequence + annotations in GenBank format; one file per antiSMASH hit pattern: "*region*.gbk" - clusterblastoutput: type: file diff --git a/tests/modules/antismash/antismashlite/main.nf b/tests/modules/antismash/antismashlite/main.nf index 3044250a..2ef4430f 100644 --- a/tests/modules/antismash/antismashlite/main.nf +++ b/tests/modules/antismash/antismashlite/main.nf @@ -10,6 +10,23 @@ include { ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES } from '../../../modules/anti include { ANTISMASH_ANTISMASHLITE } from '../../../../modules/antismash/antismashlite/main.nf' include { PROKKA } from '../../../modules/prokka/main.nf' +process STUB_ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES { + input: + path database_css + path database_detection + path database_modules + + output: + path("antismash_db") , emit: database + path("antismash_dir"), emit: antismash_dir + + stub: + """ + mkdir antismash_db + mkdir antismash_dir + """ +} + workflow test_antismashlite { input_genome = [ [ id:'test' ], // meta map @@ -61,6 +78,6 @@ workflow test_prokka_antismashlite { 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 ( PROKKA.out.gbk, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.database, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.antismash_dir ) + STUB_ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES ( UNTAR1.out.untar.map{ it[1] }, UNTAR2.out.untar.map{ it[1] }, UNTAR3.out.untar.map{ it[1] } ) + ANTISMASH_ANTISMASHLITE ( PROKKA.out.gbk, STUB_ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.database, STUB_ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.antismash_dir ) } diff --git a/tests/modules/antismash/antismashlite/test.yml b/tests/modules/antismash/antismashlite/test.yml index a2adad79..96752b18 100644 --- a/tests/modules/antismash/antismashlite/test.yml +++ b/tests/modules/antismash/antismashlite/test.yml @@ -36,31 +36,42 @@ - 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/index.html - md5sum: 3773c3ec61fb1e8cd9a67791b37d9b79 - - 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 - contains: [ '"seq_id": "NZ_CP069563.1"' ] - - path: output/antismash/test/test.gbk - contains: ['/tool="antismash"'] - - path: output/antismash/test/test.json - contains: ['"id": "NZ_CP069563.1"'] - - path: output/antismash/test/test.log - contains: ['antiSMASH status: SUCCESS'] - - path: output/antismash/test/test.zip + - path: output/antismash/clusterblast/stub_c.stub.txt + - md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/antismash/css/stub.css + - md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/antismash/images + - md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/antismash/js/stub.js + - md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/antismash/knownclusterblast/regionstub/ctg.stub.html + - md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/antismash/knownclusterblast/stub._c.stub.txt + - md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/antismash/svg/clusterblast.stub.svg + - md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/antismash/svg/knownclusterblast.stub.svg + - md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/antismash/stub.gbk + - md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/antismash/stub.json + - md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/antismash/stub.log + - md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/antismash/stub.zip + - md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/antismash/stub.region.stub. + - md5sum: d41d8cd98f00b204e9800998ecf8427egbk + - path: output/antismash/clusterblastoutpu + - md5sum: d41d8cd98f00b204e9800998ecf8427et.txt + - path: output/antismash/index.html + - md5sum: d41d8cd98f00b204e9800998ecf8427e + - path: output/antismash/knownclusterblast + - md5sum: d41d8cd98f00b204e9800998ecf8427eoutput.txt + - path: output/antismash/regions.js + - md5sum: d41d8cd98f00b204e9800998ecf8427e - path: output/antismash/versions.yml - md5sum: da6bed0032d0f7ad4741e0074ad6b1ff + md5sum: 33e96b52f50beacd83c7e0feab8cb03b - path: output/gunzip/genome.fna md5sum: dafd38f5454b54fbea38245d773062a5 - path: output/prokka/test/test.err @@ -74,13 +85,13 @@ - path: output/prokka/test/test.fsa md5sum: dbe7d3d43d46920802d2aec5cd177ddc - path: output/prokka/test/test.gbk - md5sum: 286ea011a64c0d281de3981ed2f296ff + contains: ['NZ_CP069563.1'] - path: output/prokka/test/test.gff md5sum: 9f733b702454e7750b7d4686369fe7e4 - path: output/prokka/test/test.log contains: ["Annotation finished successfully."] - path: output/prokka/test/test.sqn - md5sum: a901ac190675f976e373219f0191d067 + contains: ['str "NZ_CP069563.1"'] - path: output/prokka/test/test.tbl md5sum: 98f3b705f47b40255631ae43823e8271 - path: output/prokka/test/test.tsv From 480c4ced783927365a36bf28b1fa0f1ab51e0951 Mon Sep 17 00:00:00 2001 From: jasmezz Date: Tue, 3 May 2022 17:35:16 +0200 Subject: [PATCH 08/18] Update meta.yml --- modules/antismash/antismashlite/meta.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/antismash/antismashlite/meta.yml b/modules/antismash/antismashlite/meta.yml index 22056202..ac52edaa 100644 --- a/modules/antismash/antismashlite/meta.yml +++ b/modules/antismash/antismashlite/meta.yml @@ -1,5 +1,7 @@ name: antismash_antismashlite -description: antiSMASH allows the rapid genome-wide identification, annotation and analysis of secondary metabolite biosynthesis gene clusters. +description: | + antiSMASH allows the rapid genome-wide identification, annotation + and analysis of secondary metabolite biosynthesis gene clusters. keywords: - secondary metabolites - BGC @@ -40,7 +42,13 @@ input: - antismash_dir: type: directory description: | - antismash installation folder which is being modified during the antiSMASH database downloading step. The modified files are normally downloaded by download-antismash-databases itself, and must be retrieved by the user by manually running the command within antismash-lite. As this folder cannot be modified within the docker and singularity containers, it needs to be mounted (including all modified files from the downloading step) as a workaround. + antismash installation folder which is being modified during the + antiSMASH database downloading step. The modified files are + normally downloaded by download-antismash-databases itself, and must be + retrieved by the user by manually running the command within antismash-lite. + As this folder cannot be modified within the docker and singularity containers, + it needs to be mounted (including all modified files from the downloading step) + as a workaround. pattern: "*" output: From 6a7aec8b41dc77d6c823e1a321208d58fc992427 Mon Sep 17 00:00:00 2001 From: jasmezz Date: Thu, 5 May 2022 10:22:02 +0200 Subject: [PATCH 09/18] Remove prokka test workflow --- modules/antismash/antismashlite/main.nf | 27 ------- tests/modules/antismash/antismashlite/main.nf | 47 ------------ .../modules/antismash/antismashlite/test.yml | 74 +------------------ 3 files changed, 3 insertions(+), 145 deletions(-) diff --git a/modules/antismash/antismashlite/main.nf b/modules/antismash/antismashlite/main.nf index a4998be6..f6f8a30d 100644 --- a/modules/antismash/antismashlite/main.nf +++ b/modules/antismash/antismashlite/main.nf @@ -64,31 +64,4 @@ process ANTISMASH_ANTISMASHLITE { antismash-lite: \$(antismash --version | sed 's/antiSMASH //') END_VERSIONS """ - - stub: - """ - mkdir ${prefix} - touch ${prefix}/clusterblast/stub_c.stub.txt - touch ${prefix}/css/stub.css - touch ${prefix}/images - touch ${prefix}/js/stub.js - touch ${prefix}/knownclusterblast/regionstub/ctg.stub.html - touch ${prefix}/knownclusterblast/stub._c.stub.txt - touch ${prefix}/svg/clusterblast.stub.svg - touch ${prefix}/svg/knownclusterblast.stub.svg - touch ${prefix}/stub.gbk - touch ${prefix}/stub.json - touch ${prefix}/stub.log - touch ${prefix}/stub.zip - touch ${prefix}/stub.region.stub.gbk - touch ${prefix}/clusterblastoutput.txt - touch ${prefix}/index.html - touch ${prefix}/knownclusterblastoutput.txt - touch ${prefix}/regions.js - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - antismash-lite: \$(antismash --version | sed 's/antiSMASH //') - END_VERSIONS - """ } diff --git a/tests/modules/antismash/antismashlite/main.nf b/tests/modules/antismash/antismashlite/main.nf index 2ef4430f..a625a0c1 100644 --- a/tests/modules/antismash/antismashlite/main.nf +++ b/tests/modules/antismash/antismashlite/main.nf @@ -2,30 +2,11 @@ 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' - -process STUB_ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES { - input: - path database_css - path database_detection - path database_modules - - output: - path("antismash_db") , emit: database - path("antismash_dir"), emit: antismash_dir - - stub: - """ - mkdir antismash_db - mkdir antismash_dir - """ -} workflow test_antismashlite { input_genome = [ @@ -53,31 +34,3 @@ workflow test_antismashlite { ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES ( UNTAR1.out.untar.map{ it[1] }, UNTAR2.out.untar.map{ it[1] }, UNTAR3.out.untar.map{ it[1] } ) ANTISMASH_ANTISMASHLITE ( input_genome, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.database, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.antismash_dir ) } - -workflow test_prokka_antismashlite { - input_gunzip = [ [ id:'test' ], // meta map - file(params.test_data['bacteroides_fragilis']['genome']['genome_fna_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) - ] - - GUNZIP ( input_gunzip ) - PROKKA ( GUNZIP.out.gunzip, [], [] ) - UNTAR1 ( input_antismash_db1 ) - UNTAR2 ( input_antismash_db2 ) - UNTAR3 ( input_antismash_db3 ) - STUB_ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES ( UNTAR1.out.untar.map{ it[1] }, UNTAR2.out.untar.map{ it[1] }, UNTAR3.out.untar.map{ it[1] } ) - ANTISMASH_ANTISMASHLITE ( PROKKA.out.gbk, STUB_ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.database, STUB_ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.antismash_dir ) -} diff --git a/tests/modules/antismash/antismashlite/test.yml b/tests/modules/antismash/antismashlite/test.yml index 96752b18..b1365414 100644 --- a/tests/modules/antismash/antismashlite/test.yml +++ b/tests/modules/antismash/antismashlite/test.yml @@ -13,7 +13,8 @@ - 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":'] + 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: 32aaf51315258af3b300d9a5bafd7bdc @@ -26,75 +27,6 @@ - path: output/antismash/test/regions.js contains: ['"seq_id": "NZ_CP069563.1"'] - path: output/antismash/test/test.log - contains: ['antiSMASH version: 6.0.1'] + contains: ["antiSMASH version: 6.0.1"] - path: output/antismash/versions.yml md5sum: 759431a43da33e2ef8e2d0ebd79a439b - -- name: antismash antismashlite test_prokka_antismashlite - command: nextflow run tests/modules/antismash/antismashlite -entry test_prokka_antismashlite -c tests/config/nextflow.config - tags: - - antismash/antismashlite - - antismash - files: - - path: output/antismash/clusterblast/stub_c.stub.txt - - md5sum: d41d8cd98f00b204e9800998ecf8427e - - path: output/antismash/css/stub.css - - md5sum: d41d8cd98f00b204e9800998ecf8427e - - path: output/antismash/images - - md5sum: d41d8cd98f00b204e9800998ecf8427e - - path: output/antismash/js/stub.js - - md5sum: d41d8cd98f00b204e9800998ecf8427e - - path: output/antismash/knownclusterblast/regionstub/ctg.stub.html - - md5sum: d41d8cd98f00b204e9800998ecf8427e - - path: output/antismash/knownclusterblast/stub._c.stub.txt - - md5sum: d41d8cd98f00b204e9800998ecf8427e - - path: output/antismash/svg/clusterblast.stub.svg - - md5sum: d41d8cd98f00b204e9800998ecf8427e - - path: output/antismash/svg/knownclusterblast.stub.svg - - md5sum: d41d8cd98f00b204e9800998ecf8427e - - path: output/antismash/stub.gbk - - md5sum: d41d8cd98f00b204e9800998ecf8427e - - path: output/antismash/stub.json - - md5sum: d41d8cd98f00b204e9800998ecf8427e - - path: output/antismash/stub.log - - md5sum: d41d8cd98f00b204e9800998ecf8427e - - path: output/antismash/stub.zip - - md5sum: d41d8cd98f00b204e9800998ecf8427e - - path: output/antismash/stub.region.stub. - - md5sum: d41d8cd98f00b204e9800998ecf8427egbk - - path: output/antismash/clusterblastoutpu - - md5sum: d41d8cd98f00b204e9800998ecf8427et.txt - - path: output/antismash/index.html - - md5sum: d41d8cd98f00b204e9800998ecf8427e - - path: output/antismash/knownclusterblast - - md5sum: d41d8cd98f00b204e9800998ecf8427eoutput.txt - - path: output/antismash/regions.js - - md5sum: d41d8cd98f00b204e9800998ecf8427e - - path: output/antismash/versions.yml - md5sum: 33e96b52f50beacd83c7e0feab8cb03b - - path: output/gunzip/genome.fna - md5sum: dafd38f5454b54fbea38245d773062a5 - - path: output/prokka/test/test.err - md5sum: 194fd8a1d1cde9919841a1afd4414760 - - path: output/prokka/test/test.faa - md5sum: 8fefbfa7860f280cc881c3a3b377d6da - - path: output/prokka/test/test.ffn - md5sum: 9c4d4d7dc28625bcb13c6fbd27ca13c3 - - path: output/prokka/test/test.fna - md5sum: 96aa7707b864499745e8946f169ae8e0 - - path: output/prokka/test/test.fsa - md5sum: dbe7d3d43d46920802d2aec5cd177ddc - - path: output/prokka/test/test.gbk - contains: ['NZ_CP069563.1'] - - path: output/prokka/test/test.gff - md5sum: 9f733b702454e7750b7d4686369fe7e4 - - path: output/prokka/test/test.log - contains: ["Annotation finished successfully."] - - path: output/prokka/test/test.sqn - contains: ['str "NZ_CP069563.1"'] - - path: output/prokka/test/test.tbl - md5sum: 98f3b705f47b40255631ae43823e8271 - - path: output/prokka/test/test.tsv - md5sum: 26e8aa4b2212f320e82b6db7c93d4461 - - path: output/prokka/test/test.txt - md5sum: aea5834a64dff02d3588cecbe25c3914 From 24b9c397dded7933bf472f64bf63eb59981cd050 Mon Sep 17 00:00:00 2001 From: jasmezz Date: Thu, 5 May 2022 13:14:39 +0200 Subject: [PATCH 10/18] Apply suggestions from code review + add support for GFF annotations --- modules/antismash/antismashlite/main.nf | 8 +++++ modules/antismash/antismashlite/meta.yml | 29 ++++++++++--------- tests/modules/antismash/antismashlite/main.nf | 2 +- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/modules/antismash/antismashlite/main.nf b/modules/antismash/antismashlite/main.nf index f6f8a30d..006852d9 100644 --- a/modules/antismash/antismashlite/main.nf +++ b/modules/antismash/antismashlite/main.nf @@ -17,6 +17,7 @@ process ANTISMASH_ANTISMASHLITE { input: tuple val(meta), path(sequence_input) + path(gff) path(databases) path(antismash_dir) // Optional input: AntiSMASH installation folder. It is not needed for using this module with conda, but required for docker/singularity (see meta.yml). @@ -46,6 +47,12 @@ process ANTISMASH_ANTISMASHLITE { script: def args = task.ext.args ?: '' prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}" + if ( sequence_input.getExtension != 'fasta' && sequence_input.getExtension != 'fna' && gff ) + log.warn "GFF input to antiSMASH can only be used if FASTA sequence input is supplied. GFF will be ignored for sample ${meta.id}" + if ( (sequence_input.getExtension == 'fasta' || sequence_input.getExtension == 'fna') && gff ) + gff_flag = "--genefinding-gff3 ${gff}" + else + gff_flag = "" """ ## We specifically do not include annotations (--genefinding-tool none) as @@ -57,6 +64,7 @@ process ANTISMASH_ANTISMASHLITE { --genefinding-tool none \\ --logfile $prefix/${prefix}.log \\ --databases $databases \\ + $gff_flag \\ $sequence_input cat <<-END_VERSIONS > versions.yml diff --git a/modules/antismash/antismashlite/meta.yml b/modules/antismash/antismashlite/meta.yml index ac52edaa..310b542e 100644 --- a/modules/antismash/antismashlite/meta.yml +++ b/modules/antismash/antismashlite/meta.yml @@ -34,21 +34,24 @@ input: - sequence_input: type: file description: nucleotide sequence file (annotated) - pattern: "*.{gbk, gb, gbff, genbank, embl}" + pattern: "*.{gbk, gb, gbff, genbank, embl, fasta, fna}" + - gff: + type: file + description: GFF3 file to extract annotated features from (only needed if sequence_input is in FASTA format) + pattern: "*.{gff, GFF}" - databases: type: directory - description: downloaded antismash databases e.g. data/databases - pattern: "*" + description: downloaded AntiSMASH databases e.g. data/databases + pattern: "*/" - antismash_dir: type: directory description: | - antismash installation folder which is being modified during the - antiSMASH database downloading step. The modified files are - normally downloaded by download-antismash-databases itself, and must be - retrieved by the user by manually running the command within antismash-lite. - As this folder cannot be modified within the docker and singularity containers, - it needs to be mounted (including all modified files from the downloading step) - as a workaround. + A local copy of an AntiSMASH installation folder. This is required when running with + docker and singularity (not required for conda), due to attempted 'modifications' of + files during database checks in the installation directory, something that cannot + be done in immutable docker/singularity containers. Therefore, a local installation + directory needs to be mounted (including all modified files from the downloading step) + to the container as a workaround. pattern: "*" output: @@ -87,11 +90,11 @@ output: pattern: "knownclusterblast/*_c*.txt" - svg_files_clusterblast: type: file - description: SVG image showing the % identity of the aligned hits against their queries + description: SVG images 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 + description: SVG images showing the % identity of the aligned hits against their queries pattern: "svg/knownclusterblast*.svg" - gbk_input: type: file @@ -127,7 +130,7 @@ output: pattern: "knownclusterblastoutput.txt" - json_sideloading: type: file - description: Sideloaded annotations of protoclusters and/or subregions (see documentation "Annotation sideloading") + description: Sideloaded annotations of protoclusters and/or subregions (see antiSMASH documentation "Annotation sideloading") pattern: "regions.js" authors: diff --git a/tests/modules/antismash/antismashlite/main.nf b/tests/modules/antismash/antismashlite/main.nf index a625a0c1..44d28129 100644 --- a/tests/modules/antismash/antismashlite/main.nf +++ b/tests/modules/antismash/antismashlite/main.nf @@ -32,5 +32,5 @@ workflow test_antismashlite { 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_genome, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.database, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.antismash_dir ) + ANTISMASH_ANTISMASHLITE ( input_genome, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.database, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.antismash_dir, [] ) } From 47a95388c2d15f080a305184f75e0d5816889008 Mon Sep 17 00:00:00 2001 From: jasmezz Date: Thu, 5 May 2022 13:17:36 +0200 Subject: [PATCH 11/18] Remove trailing whitespaces (ECLint check) --- modules/antismash/antismashlite/meta.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/antismash/antismashlite/meta.yml b/modules/antismash/antismashlite/meta.yml index 310b542e..f47dbad0 100644 --- a/modules/antismash/antismashlite/meta.yml +++ b/modules/antismash/antismashlite/meta.yml @@ -47,8 +47,8 @@ input: type: directory description: | A local copy of an AntiSMASH installation folder. This is required when running with - docker and singularity (not required for conda), due to attempted 'modifications' of - files during database checks in the installation directory, something that cannot + docker and singularity (not required for conda), due to attempted 'modifications' of + files during database checks in the installation directory, something that cannot be done in immutable docker/singularity containers. Therefore, a local installation directory needs to be mounted (including all modified files from the downloading step) to the container as a workaround. From 5d76f1c7ff26a84b590c339c9569e468655066af Mon Sep 17 00:00:00 2001 From: jasmezz Date: Wed, 11 May 2022 12:06:02 +0200 Subject: [PATCH 12/18] Add fasta/gff input option --- modules/antismash/antismashlite/main.nf | 84 ++++++++++++++-- modules/antismash/antismashlite/meta.yml | 7 +- tests/modules/antismash/antismashlite/main.nf | 95 ++++++++++++++++--- .../modules/antismash/antismashlite/test.yml | 19 +++- 4 files changed, 178 insertions(+), 27 deletions(-) diff --git a/modules/antismash/antismashlite/main.nf b/modules/antismash/antismashlite/main.nf index 006852d9..fb8def97 100644 --- a/modules/antismash/antismashlite/main.nf +++ b/modules/antismash/antismashlite/main.nf @@ -1,3 +1,76 @@ +// 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' }" + +// containerOptions { +// workflow.containerEngine == 'singularity' ? +// "-B $antismash_dir:/usr/local/lib/python3.8/site-packages/antismash" : +// workflow.containerEngine == 'docker' ? +// "-v \$PWD/$antismash_dir:/usr/local/lib/python3.8/site-packages/antismash" : +// '' +// } + +// input: +// tuple val(meta), path(sequence_input) +// path(databases) +// path(antismash_dir) // Optional input: AntiSMASH installation folder. It is not needed for using this module with conda, but required for docker/singularity (see meta.yml). + +// 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}" +// // if ( sequence_input.getExtension != 'fasta' && sequence_input.getExtension != 'fna' && gff ) +// // log.warn "GFF input to antiSMASH can only be used if FASTA sequence input is supplied. GFF will be ignored for sample ${meta.id}" +// // if ( (sequence_input.getExtension == 'fasta' || sequence_input.getExtension == 'fna') && gff ) +// // gff_flag = "--genefinding-gff3 ${gff}" +// // else +// // gff_flag = "" + +// """ +// ## We specifically do not include annotations (--genefinding-tool none) as +// ## this should be run as a separate module for versioning purposes +// antismash \\ +// $args \\ +// -c $task.cpus \\ +// --output-dir $prefix \\ +// --genefinding-tool none \\ +// --logfile $prefix/${prefix}.log \\ +// --databases $databases \\ +// $sequence_input + +// cat <<-END_VERSIONS > versions.yml +// "${task.process}": +// antismash-lite: \$(antismash --version | sed 's/antiSMASH //') +// END_VERSIONS +// """ +// } process ANTISMASH_ANTISMASHLITE { tag "$meta.id" label 'process_medium' @@ -17,9 +90,9 @@ process ANTISMASH_ANTISMASHLITE { input: tuple val(meta), path(sequence_input) - path(gff) path(databases) path(antismash_dir) // Optional input: AntiSMASH installation folder. It is not needed for using this module with conda, but required for docker/singularity (see meta.yml). + path(gff) output: tuple val(meta), path("${prefix}/clusterblast/*_c*.txt") , optional: true, emit: clusterblast_file @@ -47,24 +120,19 @@ process ANTISMASH_ANTISMASHLITE { script: def args = task.ext.args ?: '' prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}" - if ( sequence_input.getExtension != 'fasta' && sequence_input.getExtension != 'fna' && gff ) - log.warn "GFF input to antiSMASH can only be used if FASTA sequence input is supplied. GFF will be ignored for sample ${meta.id}" - if ( (sequence_input.getExtension == 'fasta' || sequence_input.getExtension == 'fna') && gff ) - gff_flag = "--genefinding-gff3 ${gff}" - else - gff_flag = "" + gff_flag = "--genefinding-gff3 ${gff}" """ ## We specifically do not include annotations (--genefinding-tool none) as ## this should be run as a separate module for versioning purposes antismash \\ $args \\ + $gff_flag \\ -c $task.cpus \\ --output-dir $prefix \\ --genefinding-tool none \\ --logfile $prefix/${prefix}.log \\ --databases $databases \\ - $gff_flag \\ $sequence_input cat <<-END_VERSIONS > versions.yml diff --git a/modules/antismash/antismashlite/meta.yml b/modules/antismash/antismashlite/meta.yml index f47dbad0..91e73709 100644 --- a/modules/antismash/antismashlite/meta.yml +++ b/modules/antismash/antismashlite/meta.yml @@ -35,10 +35,6 @@ input: type: file description: nucleotide sequence file (annotated) pattern: "*.{gbk, gb, gbff, genbank, embl, fasta, fna}" - - gff: - type: file - description: GFF3 file to extract annotated features from (only needed if sequence_input is in FASTA format) - pattern: "*.{gff, GFF}" - databases: type: directory description: downloaded AntiSMASH databases e.g. data/databases @@ -53,6 +49,9 @@ input: directory needs to be mounted (including all modified files from the downloading step) to the container as a workaround. pattern: "*" + - gff: + type: file + pattern: "*.gff" output: - meta: diff --git a/tests/modules/antismash/antismashlite/main.nf b/tests/modules/antismash/antismashlite/main.nf index 44d28129..02f9e0f9 100644 --- a/tests/modules/antismash/antismashlite/main.nf +++ b/tests/modules/antismash/antismashlite/main.nf @@ -2,35 +2,106 @@ nextflow.enable.dsl = 2 +include { ANTISMASH_ANTISMASHLITE } from '../../../../modules/antismash/antismashlite/main.nf' +include { ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES } from '../../../modules/antismash/antismashlitedownloaddatabases/main.nf' +include { GUNZIP as GUNZIP1 } from '../../../../modules/gunzip/main.nf' +include { GUNZIP as GUNZIP2 } 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' workflow test_antismashlite { - input_genome = [ - [ id:'test' ], // meta map - file(params.test_data['bacteroides_fragilis']['genome']['genome_gbff_gz'], checkIfExists: true) ] + genome_fna = [ + [ id:'test' ], + file(params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true) + ] - input_antismash_db1 = [ + genome_gff = [ + [], + file(params.test_data['bacteroides_fragilis']['genome']['genome_gff_gz'], checkIfExists: true) + ] + + antismash_db1 = [ [], file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/antismash/css.tar.gz', checkIfExists: true) ] - input_antismash_db2 = [ + antismash_db2 = [ [], file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/antismash/detection.tar.gz', checkIfExists: true) ] - input_antismash_db3 = [ + 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 ) + // input_db = [ + // file('/home/jasmin/antismash_db/', checkIfExists: true) + // ] + + // input_dir = [ + // file('/home/jasmin/antismash_dir/', checkIfExists: true) + // ] + + GUNZIP1 ( genome_fna ) + GUNZIP2 ( genome_gff ) + UNTAR1 ( antismash_db1 ) + UNTAR2 ( antismash_db2 ) + UNTAR3 ( 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_genome, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.database, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.antismash_dir, [] ) + ANTISMASH_ANTISMASHLITE ( GUNZIP1.out.gunzip, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.database, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.antismash_dir, GUNZIP2.out.gunzip.map{ it[1] } ) + // ANTISMASH_ANTISMASHLITE ( GUNZIP1.out.gunzip, input_db, input_dir, GUNZIP2.out.gunzip.map{ it[1] } ) + } +// #!/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' +// include { ANTISMASH_ANTISMASHLITE } from '../../../../modules/antismash/antismashlite/main.nf' + +// workflow test_antismashlite { +// input_genome = [ +// [ id:'test' ], // meta map +// file('/home/jasmin/Downloads/BAN001-megahit.gbk', 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) +// // ] + +// input_db = [ +// [], +// file('/home/jasmin/antismash_db/', checkIfExists: true) +// ] + +// input_dir = [ +// [], +// file('/home/jasmin/antismash_dir', checkIfExists: true) +// ] + +// // input_gff = [ +// // [], +// // file('/home/jasmin/Downloads/BAN001.gff', 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_genome, input_db, input_dir ) +// } diff --git a/tests/modules/antismash/antismashlite/test.yml b/tests/modules/antismash/antismashlite/test.yml index b1365414..bd255b41 100644 --- a/tests/modules/antismash/antismashlite/test.yml +++ b/tests/modules/antismash/antismashlite/test.yml @@ -13,11 +13,10 @@ - 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":'] + contains: ['{"version": "6.0.1", "input_file": "genome.fna.gz", "records": [{"id": "NZ_CP069563.1", "seq": {"data":'] - path: output/antismash/test/genome.zip - path: output/antismash/test/index.html - md5sum: 32aaf51315258af3b300d9a5bafd7bdc + md5sum: de787e865c3a1eec143a19d2facb4de4 - path: output/antismash/test/js/antismash.js md5sum: 58e90c3d783ae014cc3d51849bcb50a2 - path: output/antismash/test/js/jquery.js @@ -30,3 +29,17 @@ contains: ["antiSMASH version: 6.0.1"] - path: output/antismash/versions.yml md5sum: 759431a43da33e2ef8e2d0ebd79a439b + - path: output/gunzip1/genome.fna + md5sum: dafd38f5454b54fbea38245d773062a5 + - path: output/gunzip1/versions.yml + md5sum: 854e3d45d43d2bc3bedf4bd6586e3e1f + - path: output/gunzip2/genome.gff + md5sum: 9b9c848b1946d43fa68128f4d6316052 + - path: output/gunzip2/versions.yml + md5sum: 67bdab99aaaf1edfc0869bd2e6808036 + - path: output/untar1/versions.yml + md5sum: 1e4721017721c45370996318e6b807e5 + - path: output/untar2/versions.yml + md5sum: a6ae4977a432f3c5ef26687cec8622de + - path: output/untar3/versions.yml + md5sum: a5ee00c1c426ed601ff654891ba0f645 From 2b746abfbe6944261f01828de57a8eb74f94853d Mon Sep 17 00:00:00 2001 From: jasmezz Date: Wed, 11 May 2022 12:09:52 +0200 Subject: [PATCH 13/18] Fix Prettier linting issue --- tests/modules/antismash/antismashlite/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/modules/antismash/antismashlite/test.yml b/tests/modules/antismash/antismashlite/test.yml index bd255b41..6822152d 100644 --- a/tests/modules/antismash/antismashlite/test.yml +++ b/tests/modules/antismash/antismashlite/test.yml @@ -13,7 +13,8 @@ - path: output/antismash/test/genome.gbk contains: ['/tool="antismash"'] - path: output/antismash/test/genome.json - contains: ['{"version": "6.0.1", "input_file": "genome.fna.gz", "records": [{"id": "NZ_CP069563.1", "seq": {"data":'] + contains: + ['{"version": "6.0.1", "input_file": "genome.fna.gz", "records": [{"id": "NZ_CP069563.1", "seq": {"data":'] - path: output/antismash/test/genome.zip - path: output/antismash/test/index.html md5sum: de787e865c3a1eec143a19d2facb4de4 From 853e3ec08775da7b178d65cc82209058e696888a Mon Sep 17 00:00:00 2001 From: Jasmin F <73216762+jasmezz@users.noreply.github.com> Date: Wed, 11 May 2022 15:56:10 +0200 Subject: [PATCH 14/18] Remove commented code Co-authored-by: Moritz E. Beber --- modules/antismash/antismashlite/main.nf | 73 ------------------- tests/modules/antismash/antismashlite/main.nf | 58 --------------- 2 files changed, 131 deletions(-) diff --git a/modules/antismash/antismashlite/main.nf b/modules/antismash/antismashlite/main.nf index fb8def97..6f43c6d7 100644 --- a/modules/antismash/antismashlite/main.nf +++ b/modules/antismash/antismashlite/main.nf @@ -1,76 +1,3 @@ -// 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' }" - -// containerOptions { -// workflow.containerEngine == 'singularity' ? -// "-B $antismash_dir:/usr/local/lib/python3.8/site-packages/antismash" : -// workflow.containerEngine == 'docker' ? -// "-v \$PWD/$antismash_dir:/usr/local/lib/python3.8/site-packages/antismash" : -// '' -// } - -// input: -// tuple val(meta), path(sequence_input) -// path(databases) -// path(antismash_dir) // Optional input: AntiSMASH installation folder. It is not needed for using this module with conda, but required for docker/singularity (see meta.yml). - -// 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}" -// // if ( sequence_input.getExtension != 'fasta' && sequence_input.getExtension != 'fna' && gff ) -// // log.warn "GFF input to antiSMASH can only be used if FASTA sequence input is supplied. GFF will be ignored for sample ${meta.id}" -// // if ( (sequence_input.getExtension == 'fasta' || sequence_input.getExtension == 'fna') && gff ) -// // gff_flag = "--genefinding-gff3 ${gff}" -// // else -// // gff_flag = "" - -// """ -// ## We specifically do not include annotations (--genefinding-tool none) as -// ## this should be run as a separate module for versioning purposes -// antismash \\ -// $args \\ -// -c $task.cpus \\ -// --output-dir $prefix \\ -// --genefinding-tool none \\ -// --logfile $prefix/${prefix}.log \\ -// --databases $databases \\ -// $sequence_input - -// cat <<-END_VERSIONS > versions.yml -// "${task.process}": -// antismash-lite: \$(antismash --version | sed 's/antiSMASH //') -// END_VERSIONS -// """ -// } process ANTISMASH_ANTISMASHLITE { tag "$meta.id" label 'process_medium' diff --git a/tests/modules/antismash/antismashlite/main.nf b/tests/modules/antismash/antismashlite/main.nf index 02f9e0f9..50627590 100644 --- a/tests/modules/antismash/antismashlite/main.nf +++ b/tests/modules/antismash/antismashlite/main.nf @@ -36,13 +36,6 @@ workflow test_antismashlite { file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/antismash/modules.tar.gz', checkIfExists: true) ] - // input_db = [ - // file('/home/jasmin/antismash_db/', checkIfExists: true) - // ] - - // input_dir = [ - // file('/home/jasmin/antismash_dir/', checkIfExists: true) - // ] GUNZIP1 ( genome_fna ) GUNZIP2 ( genome_gff ) @@ -54,54 +47,3 @@ workflow test_antismashlite { // ANTISMASH_ANTISMASHLITE ( GUNZIP1.out.gunzip, input_db, input_dir, GUNZIP2.out.gunzip.map{ it[1] } ) } -// #!/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' -// include { ANTISMASH_ANTISMASHLITE } from '../../../../modules/antismash/antismashlite/main.nf' - -// workflow test_antismashlite { -// input_genome = [ -// [ id:'test' ], // meta map -// file('/home/jasmin/Downloads/BAN001-megahit.gbk', 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) -// // ] - -// input_db = [ -// [], -// file('/home/jasmin/antismash_db/', checkIfExists: true) -// ] - -// input_dir = [ -// [], -// file('/home/jasmin/antismash_dir', checkIfExists: true) -// ] - -// // input_gff = [ -// // [], -// // file('/home/jasmin/Downloads/BAN001.gff', 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_genome, input_db, input_dir ) -// } From bd4b70439b41e8a4e02dced451ee605fc5d727ee Mon Sep 17 00:00:00 2001 From: jasmezz Date: Thu, 12 May 2022 10:56:48 +0200 Subject: [PATCH 15/18] Streamlined some output channels, formatted tests main.nf --- modules/antismash/antismashlite/main.nf | 4 +--- modules/antismash/antismashlite/meta.yml | 14 +++----------- tests/modules/antismash/antismashlite/main.nf | 3 --- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/modules/antismash/antismashlite/main.nf b/modules/antismash/antismashlite/main.nf index 6f43c6d7..fb003a30 100644 --- a/modules/antismash/antismashlite/main.nf +++ b/modules/antismash/antismashlite/main.nf @@ -23,9 +23,7 @@ process ANTISMASH_ANTISMASHLITE { 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}/{css,images,js}") , emit: html_accessory_files 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 diff --git a/modules/antismash/antismashlite/meta.yml b/modules/antismash/antismashlite/meta.yml index 91e73709..d054e02a 100644 --- a/modules/antismash/antismashlite/meta.yml +++ b/modules/antismash/antismashlite/meta.yml @@ -67,18 +67,10 @@ output: 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: + - html_accessory_files: type: directory - description: image files for web view of antiSMASH results - pattern: "images" - - javascript: - type: file - description: JavaScript files - pattern: "js/*.js" + description: Accessory files for the HTML output + pattern: "{css/,images/,js/}" - knownclusterblast_html: type: file description: Tables with MIBiG hits in HTML format diff --git a/tests/modules/antismash/antismashlite/main.nf b/tests/modules/antismash/antismashlite/main.nf index 50627590..0f0439da 100644 --- a/tests/modules/antismash/antismashlite/main.nf +++ b/tests/modules/antismash/antismashlite/main.nf @@ -36,7 +36,6 @@ workflow test_antismashlite { file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/antismash/modules.tar.gz', checkIfExists: true) ] - GUNZIP1 ( genome_fna ) GUNZIP2 ( genome_gff ) UNTAR1 ( antismash_db1 ) @@ -44,6 +43,4 @@ workflow test_antismashlite { UNTAR3 ( antismash_db3 ) ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES ( UNTAR1.out.untar.map{ it[1] }, UNTAR2.out.untar.map{ it[1] }, UNTAR3.out.untar.map{ it[1] } ) ANTISMASH_ANTISMASHLITE ( GUNZIP1.out.gunzip, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.database, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.antismash_dir, GUNZIP2.out.gunzip.map{ it[1] } ) - // ANTISMASH_ANTISMASHLITE ( GUNZIP1.out.gunzip, input_db, input_dir, GUNZIP2.out.gunzip.map{ it[1] } ) - } From 37cc6f250b8b471af40c56d22efb39bfbb65e0ed Mon Sep 17 00:00:00 2001 From: jasmezz Date: Thu, 12 May 2022 12:14:19 +0200 Subject: [PATCH 16/18] Fixed test.yml --- tests/modules/antismash/antismashlite/test.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/tests/modules/antismash/antismashlite/test.yml b/tests/modules/antismash/antismashlite/test.yml index 6822152d..aa04c514 100644 --- a/tests/modules/antismash/antismashlite/test.yml +++ b/tests/modules/antismash/antismashlite/test.yml @@ -14,7 +14,7 @@ contains: ['/tool="antismash"'] - path: output/antismash/test/genome.json contains: - ['{"version": "6.0.1", "input_file": "genome.fna.gz", "records": [{"id": "NZ_CP069563.1", "seq": {"data":'] + ['{"version": "6.0.1", "input_file": "genome.fna", "records": [{"id": "NZ_CP069563.1", "seq": {"data":'] - path: output/antismash/test/genome.zip - path: output/antismash/test/index.html md5sum: de787e865c3a1eec143a19d2facb4de4 @@ -32,15 +32,5 @@ md5sum: 759431a43da33e2ef8e2d0ebd79a439b - path: output/gunzip1/genome.fna md5sum: dafd38f5454b54fbea38245d773062a5 - - path: output/gunzip1/versions.yml - md5sum: 854e3d45d43d2bc3bedf4bd6586e3e1f - path: output/gunzip2/genome.gff md5sum: 9b9c848b1946d43fa68128f4d6316052 - - path: output/gunzip2/versions.yml - md5sum: 67bdab99aaaf1edfc0869bd2e6808036 - - path: output/untar1/versions.yml - md5sum: 1e4721017721c45370996318e6b807e5 - - path: output/untar2/versions.yml - md5sum: a6ae4977a432f3c5ef26687cec8622de - - path: output/untar3/versions.yml - md5sum: a5ee00c1c426ed601ff654891ba0f645 From d2ef4763215dd8bd9f34761871a49d0800a7a6e9 Mon Sep 17 00:00:00 2001 From: jasmezz Date: Thu, 12 May 2022 12:19:50 +0200 Subject: [PATCH 17/18] Fix Prettier linting error --- tests/modules/antismash/antismashlite/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/modules/antismash/antismashlite/test.yml b/tests/modules/antismash/antismashlite/test.yml index aa04c514..4642319c 100644 --- a/tests/modules/antismash/antismashlite/test.yml +++ b/tests/modules/antismash/antismashlite/test.yml @@ -13,8 +13,7 @@ - path: output/antismash/test/genome.gbk contains: ['/tool="antismash"'] - path: output/antismash/test/genome.json - contains: - ['{"version": "6.0.1", "input_file": "genome.fna", "records": [{"id": "NZ_CP069563.1", "seq": {"data":'] + contains: ['{"version": "6.0.1", "input_file": "genome.fna", "records": [{"id": "NZ_CP069563.1", "seq": {"data":'] - path: output/antismash/test/genome.zip - path: output/antismash/test/index.html md5sum: de787e865c3a1eec143a19d2facb4de4 From 85b3c2bcf28efef4de8ae8d5244cccafccd77548 Mon Sep 17 00:00:00 2001 From: Jasmin F <73216762+jasmezz@users.noreply.github.com> Date: Thu, 12 May 2022 15:28:19 +0200 Subject: [PATCH 18/18] Apply suggestions from code review Co-authored-by: James A. Fellows Yates --- modules/antismash/antismashlite/meta.yml | 12 ++++++------ tests/modules/antismash/antismashlite/main.nf | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/antismash/antismashlite/meta.yml b/modules/antismash/antismashlite/meta.yml index d054e02a..b3e8564e 100644 --- a/modules/antismash/antismashlite/meta.yml +++ b/modules/antismash/antismashlite/meta.yml @@ -48,10 +48,10 @@ input: be done in immutable docker/singularity containers. Therefore, a local installation directory needs to be mounted (including all modified files from the downloading step) to the container as a workaround. - pattern: "*" + pattern: "*/" - gff: - type: file - pattern: "*.gff" + type: file + pattern: "*.gff" output: - meta: @@ -89,11 +89,11 @@ output: pattern: "svg/knownclusterblast*.svg" - gbk_input: type: file - description: Nucleotide sequence + annotations in GenBank format; converted from input file + description: Nucleotide sequence and annotations in GenBank format; converted from input file pattern: "*.gbk" - json_results: type: file - description: Nucleotide sequence + annotations in JSON format; converted from GenBank file (gbk_input) + description: Nucleotide sequence and annotations in JSON format; converted from GenBank file (gbk_input) pattern: "*.json" - log: type: file @@ -105,7 +105,7 @@ output: pattern: "*.zip" - gbk_results: type: file - description: Nucleotide sequence + annotations in GenBank format; one file per antiSMASH hit + description: Nucleotide sequence and annotations in GenBank format; one file per antiSMASH hit pattern: "*region*.gbk" - clusterblastoutput: type: file diff --git a/tests/modules/antismash/antismashlite/main.nf b/tests/modules/antismash/antismashlite/main.nf index 0f0439da..2b23c400 100644 --- a/tests/modules/antismash/antismashlite/main.nf +++ b/tests/modules/antismash/antismashlite/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { ANTISMASH_ANTISMASHLITE } from '../../../../modules/antismash/antismashlite/main.nf' +include { ANTISMASH_ANTISMASHLITE } from '../../../../modules/antismash/antismashlite/main.nf' include { ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES } from '../../../modules/antismash/antismashlitedownloaddatabases/main.nf' include { GUNZIP as GUNZIP1 } from '../../../../modules/gunzip/main.nf' include { GUNZIP as GUNZIP2 } from '../../../../modules/gunzip/main.nf' @@ -21,26 +21,26 @@ workflow test_antismashlite { file(params.test_data['bacteroides_fragilis']['genome']['genome_gff_gz'], checkIfExists: true) ] - antismash_db1 = [ + antismash_css = [ [], file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/antismash/css.tar.gz', checkIfExists: true) ] - antismash_db2 = [ + antismash_detection = [ [], file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/antismash/detection.tar.gz', checkIfExists: true) ] - antismash_db3 = [ + antismash_modules = [ [], file('https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/antismash/modules.tar.gz', checkIfExists: true) ] GUNZIP1 ( genome_fna ) GUNZIP2 ( genome_gff ) - UNTAR1 ( antismash_db1 ) - UNTAR2 ( antismash_db2 ) - UNTAR3 ( antismash_db3 ) + UNTAR1 ( antismash_css ) + UNTAR2 ( antismash_detection ) + UNTAR3 ( antismash_modules ) ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES ( UNTAR1.out.untar.map{ it[1] }, UNTAR2.out.untar.map{ it[1] }, UNTAR3.out.untar.map{ it[1] } ) ANTISMASH_ANTISMASHLITE ( GUNZIP1.out.gunzip, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.database, ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES.out.antismash_dir, GUNZIP2.out.gunzip.map{ it[1] } ) }