Skip to content

Commit

Permalink
add bactopia tool for btyper3
Browse files Browse the repository at this point in the history
  • Loading branch information
rpetit3 committed Sep 7, 2023
1 parent 9635c20 commit f039b4f
Show file tree
Hide file tree
Showing 25 changed files with 505 additions and 52 deletions.
25 changes: 14 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@ description: A full list of Bactopia releases and a description of the changes.
---
# Changelog

## v3.0.0 bactopia/bactopia "???" - 2023/??/??
## v3.0.0 bactopia/bactopia "???" - 2023/09/??

### `Added`
- Named Workflows (!!!)
- `clean-yer-reads` - Use Bactopia's read QC steps to Clean-Yer-Read
- `teton` - Host removal and taxon classification with estimated abundances
- Bactopia Tools (`bactopia --wf <NAME>`)
- `abritamr` - A NATA accredited tool for AMR detection
- `blastn` - Search against nucleotide BLAST databases using nucleotide queries
- `blastp` - Search against protein BLAST databases using protein queries
- `blastx` - Search against protein BLAST databases using translated nucleotide queries
- `bracken` - Taxonomic classification ans species abundance estimation of sequence reads
- `bracken` - Taxonomic classification and species abundance estimation of sequence reads
- `btyper3` - Taxonomic classification of Bacillus cereus group isolates
- `midas` - Estimate bacterial species abundances from FASTQ files
- `quast` - Assess the quality of assembled contigs
- `phispy` - Predict prophages in bacterial genomes
Expand All @@ -26,6 +24,8 @@ description: A full list of Bactopia releases and a description of the changes.
- `tblastx` - Search against translated nucleotide BLAST databases using translated nucleotide queries
- per-release databases for `amrfinderplus` and `mlst`
- new directory structure for outputs
- Renamed `--R1`, `--R2`, and `--SE` to `--r1`, `--r2`, and `--se`
- `--ont` now accepts a FASTQ file
- GitHub Action to build environments
- `fastp` is default read cleaner, can use previous methods with `--use_bbmap`
- ability to use a BED file to mask regions in `snippy-core`
Expand All @@ -37,20 +37,21 @@ description: A full list of Bactopia releases and a description of the changes.
- `ariba`
- `sra-human-scrubber`
- bump program versions in modules
- `bakta`: 1.6.0 -> 1.8.1
- `blast`: 2.11.0 -> 2.14.0
- `busco`: 5.4.3 -> 5.4.7
- `csktk`: 0.25.0 -> 0.26.0
- `bakta`: 1.6.0 -> 1.8.2
- `blast`: 2.11.0 -> 2.14.1
- `busco`: 5.4.3 -> 5.5.0
- `csktk`: 0.25.0 -> 0.27.2
- `eggnog-mapper`: 2.1.9 -> 2.1.12
- `genotyphi`: 1.9.1 -> 2.0
- `gtdbtk`: 2.1.1 -> 2.3.2
- `gubbins`: 3.2.1 -> 3.3
- `iqtree`: 2.2.0.3 -> 2.2.2.7
- `fastani`: 1.33 -> 1.34
- `mob_suite`: 3.1.0 -> 3.1.6
- `mashtree`: 1.2.0 -> 1.4.5
- `mob_suite`: 3.1.0 -> 3.1.7
- `multiqc`: 1.11 -> 1.15
- `mykrobe`: 0.12.0 -> 0.12.2
- `ncbi-amrfinderplus`: 3.10.45 -> 3.11.14-8
- `ncbi-amrfinderplus`: 3.10.45 -> 3.11.18
- `ncbi-genome-download`: 0.3.1 -> 0.3.3
- `panaroo`: 1.3.0 -> 1.3.3
- `pasty`: 1.0.0 -> 1.0.3
Expand All @@ -68,6 +69,7 @@ description: A full list of Bactopia releases and a description of the changes.
- symlink in amrfinder+ update (`bactopia datasets`)
- hardcoded `--plus` in `amrfinderplus_run`
- tests for new directory structure
- `--nanohq` not being properly passed to `dragonflye`

### `Removed`
- Bactopia Steps
Expand All @@ -90,6 +92,7 @@ description: A full list of Bactopia releases and a description of the changes.
- add module for pneumocat [nf-core/modules#3592](https://github.com/nf-core/modules/pull/3592)
- add module for abritamr/run [nf-core/modules#3725](https://github.com/nf-core/modules/pull/3725)
- fix hostrange() missing 1 required positional argument: 'database_directory' [phac-nml/mob-suite#149](https://github.com/phac-nml/mob-suite/pull/149)
- add module for btyper3 [nf-core/modules#3817](https://github.com/nf-core/modules/pull/3817)

## v2.2.0 bactopia/bactopia "Tornado Tempo" - 2022/11/28

Expand Down
14 changes: 14 additions & 0 deletions citations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,20 @@ tools:
cite: |
Lu J, Breitwieser FP, Thielen P, and Salzberg SL [Bracken: estimating species abundance in metagenomics data.](https://doi.org/10.7717/peerj-cs.104) _PeerJ Computer Science_, 3, e104. (2017)
btyper2:
name: BTyper3
link: https://github.com/lmc297/BTyper3
description: In silico taxonomic classification of Bacillus cereus group genomes using whole-genome sequencing data
cite: |
Carroll LM, Wiedmann M, Kovac J [Proposal of a Taxonomic Nomenclature for the Bacillus cereus Group Which Reconciles Genomic Definitions of Bacterial Species with Clinical and Industrial Phenotypes.](https://doi.org/10.1128/mBio.00034-20) _mBio_, 11(1). (2020)
btyper3:
name: BTyper3
link: https://github.com/lmc297/BTyper3
description: In silico taxonomic classification of Bacillus cereus group genomes using whole-genome sequencing data
cite: |
Carroll LM, Cheng RA, Kovac J [No Assembly Required: Using BTyper3 to Assess the Congruency of a Proposed Taxonomic Framework for the Bacillus cereus Group With Historical Typing Methods.](https://doi.org/10.3389/fmicb.2020.580691) _Frontiers in Microbiology_, 11, 580691. (2020)
busco:
name: BUSCO
link: https://gitlab.com/ezlab/busco
Expand Down
7 changes: 7 additions & 0 deletions conf/tests.config
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ params {
se = "${params.test_data_dir}/species/portiera/nanopore/ERR3772599.fastq.gz"
}
}
'bacillus_anthracis' {
'genome' {
name = 'GCF_000008445'
length = '5503926'
fna_gz = "${params.test_data_dir}/species/bacillus_anthracis/genome/GCF_000008445.fna.gz"
}
}
'escherichia_coli' {
'genome' {
name = 'GCF_001695515'
Expand Down
13 changes: 9 additions & 4 deletions conf/workflows.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ params {
]
modules = [
'abricate', 'abritamr', 'agrvate', 'amrfinderplus', 'blastn', 'blastp', 'blastx',
'busco', 'bracken', 'checkm', 'ectyper', 'emmtyper', 'fastani', 'gamma', 'genotyphi',
'hicap', 'hpsuissero', 'ismapper', 'kleborate', 'kraken2', 'legsta', 'lissero',
'mashdist', 'mcroni', 'meningotype', 'midas', 'mlst', 'mobsuite',
'btyper3', 'busco', 'bracken', 'checkm', 'ectyper', 'emmtyper', 'fastani', 'gamma',
'genotyphi', 'hicap', 'hpsuissero', 'ismapper', 'kleborate', 'kraken2', 'legsta',
'lissero', 'mashdist', 'mcroni', 'meningotype', 'midas', 'mlst', 'mobsuite',
'mykrobe', 'ngmaster', 'pasty', 'pbptyper', 'phispy', 'plasmidfinder',
'pneumocat', 'quast', 'rgi', 'seqsero2', 'seroba', 'shigatyper',
'shigeifinder', 'sistr', 'spatyper', 'ssuissero', 'staphopiasccmec',
Expand Down Expand Up @@ -204,10 +204,15 @@ params {
path = "modules/nf-core/blast/blastx"
}
'bracken' {
description = "Taxonomic classification ans species abundance estimation of sequence reads"
description = "Taxonomic classification and species abundance estimation of sequence reads"
ext = "fastq"
path = "modules/nf-core/bracken"
}
'btyper3' {
description = "Taxonomic classification of Bacillus cereus group isolates"
ext = "fna"
path = "modules/nf-core/btyper3"
}
'busco' {
description = "Assembly completeness based on evolutionarily informed expectations"
ext = "fna"
Expand Down
2 changes: 1 addition & 1 deletion data/conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ requirements:
- pip
- python >3.8
run:
- bactopia-py >=1.0.7
- bactopia-py >=1.0.8
- conda >=22.11.0
- coreutils
- mamba >=1.1.0
Expand Down
64 changes: 64 additions & 0 deletions modules/nf-core/btyper3/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// Import generic module functions
include { get_resources; initOptions; saveFiles } from '../../../lib/nf/functions'
RESOURCES = get_resources(workflow.profile, params.max_memory, params.max_cpus)
options = initOptions(params.containsKey("options") ? params.options : [:], 'btyper3')
options.btype = options.btype ?: "tools"
conda_tools = "bioconda::btyper3=3.4.0"
conda_name = conda_tools.replace("=", "-").replace(":", "-").replace(" ", "-")
conda_env = file("${params.condadir}/${conda_name}").exists() ? "${params.condadir}/${conda_name}" : conda_tools

process BTYPER3 {
tag "$meta.id"
label 'process_low'

conda (params.enable_conda ? conda_env : null)
container "${ workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/btyper3:3.4.0--pyhdfd78af_0' :
'quay.io/biocontainers/btyper3:3.4.0--pyhdfd78af_0' }"

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

output:
tuple val(meta), path("results/*_final_results.txt"), emit: tsv
tuple val(meta), path("results/*") , emit: results
path "*.{log,err}" , emit: logs, optional: true
path ".command.*" , emit: nf_logs
path "versions.yml", emit: versions

script:
prefix = options.suffix ? "${options.suffix}" : "${meta.id}"
def is_compressed = fasta.getName().endsWith(".gz") ? true : false
def fasta_name = fasta.getName().replace(".gz", "")
"""
# Btyper3 does not accept compressed files
if [ "$is_compressed" == "true" ]; then
gzip -c -d $fasta > $fasta_name
fi
btyper3 \\
$options.args \\
--output ./ \\
--input ${fasta_name}
mv btyper3_final_results/ results/
cat <<-END_VERSIONS > versions.yml
"${task.process}":
btyper3: \$(echo \$(btyper3 --version 2>&1) | sed 's/^.*btyper3 //;' ))
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
mkdir results
touch results/${prefix}_final_results.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
btyper3: \$(echo \$(btyper3 --version 2>&1) | sed 's/^.*btyper3 //;' ))
END_VERSIONS
"""
}
49 changes: 49 additions & 0 deletions modules/nf-core/btyper3/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json
name: "btyper3"
description: Taxonomic classification of Bacillus cereus group isolates from assemblies
keywords:
- bacteria
- classify
- fasta
tools:
- "btyper3":
description: "In silico taxonomic classification of Bacillus cereus group isolates using assembled genomes"
homepage: "https://github.com/lmc297/BTyper3"
documentation: "https://github.com/lmc297/BTyper3"
tool_dev_url: "https://github.com/lmc297/BTyper3"
doi: "10.3389/fmicb.2020.580691"
licence: "['GPL v3']"

input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test', single_end:false ]`
- fasta:
type: file
description: A genome assembly in FASTA format.
pattern: "*.{fasta|fasta.gz|fa|fa.gz|fna|fna.gz}"

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"
- tsv:
type: file
description: Tab-delimited file of Btyper3 results
pattern: "*_final_results.txt"
- results:
type: file
description: A directory of results from Btyper3 run
pattern: "results/*"

authors:
- "@rpetit3"
13 changes: 13 additions & 0 deletions modules/nf-core/btyper3/params.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
This file includes default parameter values.
*/

params {
// BTyper3
bt_virulence_identity = 70
bt_virulence_coverage = 80
bt_identity = 50
bt_coverage = 70
bt_overlap = 70
bt_opts = ""
}
62 changes: 62 additions & 0 deletions modules/nf-core/btyper3/params.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://raw.githubusercontent.com/bactopia/bactopia/master/modules/nf-core/btyper3/params.json",
"title": "BTyper3 Module",
"description": "A module for taxonomic classification of Bacillus cereus group isolates.",
"type": "object",
"definitions": {
"btyper3_parameters": {
"title": "BTyper3 Parameters",
"type": "object",
"description": "",
"default": "",
"fa_icon": "fas fa-exclamation-circle",
"properties": {
"bt_virulence_identity": {
"type": "integer",
"default": 70,
"description": "Minimum percent amino acid/nucleotide identity threshold for a virulence gene to be considered present",
"fa_icon": "fas fa-expand-arrows-alt"
},
"bt_virulence_coverage": {
"type": "integer",
"default": 80,
"description": "Minimum percent coverage threshold for a virulence gene to be considered present",
"fa_icon": "fas fa-expand-arrows-alt",
"hidden": true
},
"bt_identity": {
"type": "integer",
"default": 50,
"description": "Minimum percent amino acid identity threshold for a Bt toxin gene to be considered present",
"fa_icon": "fas fa-expand-arrows-alt"
},
"bt_coverage": {
"type": "integer",
"default": 70,
"description": "Minimum percent coverage threshold for a Bt toxin gene to be considered present",
"fa_icon": "fas fa-expand-arrows-alt",
"hidden": true
},
"bt_overlap": {
"type": "integer",
"default": 70,
"description": "Specify maximum proportion of overlap for overlapping Bt toxin genes to be considered separate genes",
"fa_icon": "fas fa-expand-arrows-alt",
"hidden": true
},
"bt_opts": {
"type": "string",
"default": "",
"description": "Additional options to pass to BTyper3",
"fa_icon": "fas fa-expand-arrows-alt"
}
}
}
},
"allOf": [
{
"$ref": "#/definitions/btyper3_parameters"
}
]
}
4 changes: 2 additions & 2 deletions modules/nf-core/mobsuite/recon/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ process MOBSUITE_RECON {

conda (params.enable_conda ? conda_env : null)
container "${ workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mob_suite:3.1.7--pyhdfd78af_0' :
'quay.io/biocontainers/mob_suite:3.1.7--pyhdfd78af_0' }"
'https://depot.galaxyproject.org/singularity/mob_suite:3.1.7--pyh7cba7a3_0' :
'quay.io/biocontainers/mob_suite:3.1.7--pyh7cba7a3_0' }"

input:
tuple val(meta), path(fasta)
Expand Down
4 changes: 2 additions & 2 deletions subworkflows/local/bakta/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
- path: bactopia/GCF_000292685/main/annotator/bakta/logs/nf-bakta.trace
contains: ['nextflow.trace']
- path: bactopia/GCF_000292685/main/annotator/bakta/logs/versions.yml
md5sum: d5fb03089ddb50a63665273a7ad5392a
md5sum: ee5f7160b00c4e0f9dcd1e18498743ea

- name: bakta-test-tarball
command: bash -c 'nextflow run ./subworkflows/local/bakta/test.nf -entry test_bakta_tarball --wf bakta -c nextflow.config ${BACTOPIA_ARGS}'
Expand Down Expand Up @@ -81,4 +81,4 @@
- path: bactopia/GCF_000292685/main/annotator/bakta/logs/nf-bakta.trace
contains: ['nextflow.trace']
- path: bactopia/GCF_000292685/main/annotator/bakta/logs/versions.yml
md5sum: bba31b9d1a7b68c115f520e720708648
md5sum: 54890aa121e8fef6a3a007fa7c9fd90d
Loading

0 comments on commit f039b4f

Please sign in to comment.