Apply suggestions from code review + add support for GFF annotations

This commit is contained in:
jasmezz 2022-05-05 13:14:39 +02:00
parent 6a7aec8b41
commit 24b9c397dd
3 changed files with 25 additions and 14 deletions

View file

@ -17,6 +17,7 @@ process ANTISMASH_ANTISMASHLITE {
input: input:
tuple val(meta), path(sequence_input) tuple val(meta), path(sequence_input)
path(gff)
path(databases) 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(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: script:
def args = task.ext.args ?: '' def args = task.ext.args ?: ''
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}" 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 ## We specifically do not include annotations (--genefinding-tool none) as
@ -57,6 +64,7 @@ process ANTISMASH_ANTISMASHLITE {
--genefinding-tool none \\ --genefinding-tool none \\
--logfile $prefix/${prefix}.log \\ --logfile $prefix/${prefix}.log \\
--databases $databases \\ --databases $databases \\
$gff_flag \\
$sequence_input $sequence_input
cat <<-END_VERSIONS > versions.yml cat <<-END_VERSIONS > versions.yml

View file

@ -34,21 +34,24 @@ input:
- sequence_input: - sequence_input:
type: file type: file
description: nucleotide sequence file (annotated) 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: - databases:
type: directory type: directory
description: downloaded antismash databases e.g. data/databases description: downloaded AntiSMASH databases e.g. data/databases
pattern: "*" pattern: "*/"
- antismash_dir: - antismash_dir:
type: directory type: directory
description: | description: |
antismash installation folder which is being modified during the A local copy of an AntiSMASH installation folder. This is required when running with
antiSMASH database downloading step. The modified files are docker and singularity (not required for conda), due to attempted 'modifications' of
normally downloaded by download-antismash-databases itself, and must be files during database checks in the installation directory, something that cannot
retrieved by the user by manually running the command within antismash-lite. be done in immutable docker/singularity containers. Therefore, a local installation
As this folder cannot be modified within the docker and singularity containers, directory needs to be mounted (including all modified files from the downloading step)
it needs to be mounted (including all modified files from the downloading step) to the container as a workaround.
as a workaround.
pattern: "*" pattern: "*"
output: output:
@ -87,11 +90,11 @@ output:
pattern: "knownclusterblast/*_c*.txt" pattern: "knownclusterblast/*_c*.txt"
- svg_files_clusterblast: - svg_files_clusterblast:
type: file 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" pattern: "svg/clusterblast*.svg"
- svg_files_knownclusterblast: - svg_files_knownclusterblast:
type: file 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" pattern: "svg/knownclusterblast*.svg"
- gbk_input: - gbk_input:
type: file type: file
@ -127,7 +130,7 @@ output:
pattern: "knownclusterblastoutput.txt" pattern: "knownclusterblastoutput.txt"
- json_sideloading: - json_sideloading:
type: file 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" pattern: "regions.js"
authors: authors:

View file

@ -32,5 +32,5 @@ workflow test_antismashlite {
UNTAR2 ( input_antismash_db2 ) UNTAR2 ( input_antismash_db2 )
UNTAR3 ( input_antismash_db3 ) 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_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, [] )
} }