Skip to content

Commit

Permalink
feat: Add islandpath module (#65)
Browse files Browse the repository at this point in the history
* feat: Add islandpath module

* chore: Fix version

* feat: Include islanpath into annotation

* test: Update test trace size

* refactor: Add log to islandpath

* fix: Add log to stub

* docs: Update doc with IslandPath info

* fix: Change prokka to bakta

* refactor: Rename tsv to gff (actual format)
  • Loading branch information
jvfe authored Mar 21, 2023
1 parent ed548cb commit 0c2ba57
Show file tree
Hide file tree
Showing 8 changed files with 121 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CITATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@
> Page AJ, Taylor B, Delaney AJ, Soares J, Seemann T, Keane JA, Harris SR. SNP-sites: rapid efficient extraction of SNPs from multi-FASTA alignments. Microb Genom. 2016 Apr 29;2(4):e000056. doi: 10.1099/mgen.0.000056. PMID: 28348851; PMCID: PMC5320690.
- [Unicycler](https://pubmed.ncbi.nlm.nih.gov/28594827/)

> Wick RR, Judd LM, Gorrie CL, Holt KE. Unicycler: Resolving bacterial genome assemblies from short and long sequencing reads. PLoS Comput Biol. 2017 Jun 8;13(6):e1005595. doi: 10.1371/journal.pcbi.1005595. PMID: 28594827; PMCID: PMC5481147.
- [IslandPath](https://doi.org/10.1093/bioinformatics/bty095)
> Claire Bertelli, Fiona S L Brinkman, Improved genomic island predictions with IslandPath-DIMOB, Bioinformatics, Volume 34, Issue 13, 01 July 2018, Pages 2161–2167, https://doi.org/10.1093/bioinformatics/bty095
## Software packaging/containerisation tools

- [Anaconda](https://anaconda.com)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Annotation:
- (_optionally_) Prokka ([`prokka`](https://github.com/tseemann/prokka))
- AMR ([`RGI`](https://github.com/arpcard/rgi))
- Plasmids ([`mob_suite`](https://github.com/phac-nml/mob-suite))
- Genomic Islands ([`IslandPath`](https://github.com/brinkmanlab/islandpath))
- CAZY, VFDB, and BacMet query using DIAMOND ([`diamond`](https://github.com/bbuchfink/diamond))

Phylogeny:
Expand Down
8 changes: 8 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@ process {
]
}

withName: ISLANDPATH {
publishDir = [
path: { "${params.outdir}/annotation/islandpath/${meta.id}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

// PopPUNK

withName: POPPUNK_VISUALISE {
Expand Down
15 changes: 15 additions & 0 deletions docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,21 @@ MobRecon reconstructs individual plasmid sequences from draft genome assemblies

[Diamond](https://github.com/bbuchfink/diamond) is a sequence aligner for protein and translated DNA searches, designed for high performance analysis of big sequence data. We use DIAMOND to predict the presence of virulence factors, heavy metal resistance determinants, and carbohydrate-active enzymes using [VFDB](http://www.mgc.ac.cn/VFs/), [BacMet](http://bacmet.biomedicine.gu.se/), and [CAZy](http://www.cazy.org/) respectively.

### IslandPath

<details markdown="1">
<summary>Output files</summary>

- `annotation/islandpath/`
- `${sample_id}/` : IslandPath results will be in one directory per genome.
- `${sample_id}.tsv` : IslandPath results
- `Dimob.log` : IslandPath execution log

</details>

[IslandPath](https://github.com/brinkmanlab/islandpath) is a standalone software to predict genomic islands
in bacterial and archaeal genomes based on the presence of dinucleotide biases and mobility genes.

### Panaroo

<details markdown="1">
Expand Down
49 changes: 49 additions & 0 deletions modules/local/islandpath/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
process ISLANDPATH {
tag "$meta.id"
label 'process_medium'

conda "bioconda::islandpath=1.0.6"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/islandpath:1.0.6--hdfd78af_0':
'quay.io/biocontainers/islandpath:1.0.6--hdfd78af_0' }"

input:
tuple val(meta), path(genome)

output:
tuple val(meta), path("${prefix}.gff"), emit: gff
path "Dimob.log" , emit: log
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
// WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
def VERSION = '1.0.6'
"""
islandpath \\
$genome \\
${prefix}.gff \\
$args
cat <<-END_VERSIONS > versions.yml
"${task.process}":
islandpath: $VERSION
END_VERSIONS
"""
stub:
prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = '1.0.6'
"""
touch ${prefix}.gff
touch Dimob.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
islandpath: $VERSION
END_VERSIONS
"""
}
38 changes: 38 additions & 0 deletions modules/local/islandpath/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: islandpath
description: Genomic island prediction in bacterial and archaeal genomes
keywords:
- genomes
- genomic islands
- prediction
tools:
- islandpath:
description: Genomic island prediction in bacterial and archaeal genomes
homepage: https://github.com/brinkmanlab/islandpath
documentation: https://github.com/brinkmanlab/islandpath#readme
tool_dev_url: https://github.com/brinkmanlab/islandpath
doi: "doi:10.1093/bioinformatics/bty095"
licence: ["GPL-3.0"]

input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- genome:
type: file
description: |
Genome file in .gbk or .embl format.
output:
- gff:
type: file
description: GFF file listing the predicted genomic islands and their coordinates
pattern: "*.gff"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"

authors:
- "@jvfe"
8 changes: 5 additions & 3 deletions subworkflows/local/annotation.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ include { GET_SOFTWARE_VERSIONS } from '../../modules/local/get_software_version
include { RGI;
UPDATE_RGI_DB } from '../../modules/local/rgi'
include { MOB_RECON } from '../../modules/local/mobsuite'
include { ISLANDPATH } from '../../modules/local/islandpath/main'

//
// SUBWORKFLOWS
Expand Down Expand Up @@ -128,8 +129,8 @@ workflow ANNOTATE_ASSEMBLIES {
ch_software_versions = ch_software_versions.mix(PROKKA.out.versions.first().ifEmpty(null))
ch_ffn_files = PROKKA.out.ffn
ch_gff_files = PROKKA.out.gff
ch_gbk_files = PROKKA.out.gbk
ch_multiqc_files = ch_multiqc_files.mix(PROKKA.out.txt.collect{it[1]}.ifEmpty([]))

}
else {

Expand All @@ -144,7 +145,7 @@ workflow ANNOTATE_ASSEMBLIES {
ch_software_versions = ch_software_versions.mix(BAKTA.out.versions.first().ifEmpty(null))
ch_ffn_files = BAKTA.out.ffn
ch_gff_files = BAKTA.out.gff

ch_gbk_files = BAKTA.out.gbff
}

/*
Expand All @@ -153,7 +154,8 @@ workflow ANNOTATE_ASSEMBLIES {
MOB_RECON(assemblies)
ch_software_versions = ch_software_versions.mix(MOB_RECON.out.version.first().ifEmpty(null))


ISLANDPATH(ch_gbk_files)
ch_software_versions = ch_software_versions.mix(ISLANDPATH.out.versions.first())

/*
* Run DIAMOND blast annotation with databases
Expand Down
2 changes: 1 addition & 1 deletion tests/subworkflows/local/annotation.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ nextflow_workflow {

then {
assert workflow.success
assert workflow.trace.tasks().size() >= 8
assert workflow.trace.tasks().size() >= 9
assert workflow.out.gff.size() == 1
assert workflow.out.gff.get(0).get(1) ==~ ".*/SRR14022735.gff"
}
Expand Down

0 comments on commit 0c2ba57

Please sign in to comment.