name: bakta
description: Rapid annotation of bacterial genomes and plasmids
icon: false
tags:
  - annotation
  - fasta
  - prokaryote
modules:
  - bakta_download
  - bakta_run
input:
  - meta:
      type: map
      description: |
        Groovy Map containing sample information
        e.g. [ id:'test', single_end:false ]
  - fasta:
      type: file
      description: |
        FASTA file to be annotated. Has to contain at least a non-empty string dummy value.
  - db:
      type: file
      description: |
        Path to the Bakta database
  - proteins:
      type: file
      description: FASTA file of trusted proteins to first annotate from (optional)
  - prodigal_tf:
      type: file
      description: Training file to use for Prodigal (optional)
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: annotations as simple human readble tab separated values
      pattern: "*.tsv"
  - gff:
      type: file
      description: annotations & sequences in GFF3 format
      pattern: "*.gff3"
  - gbff:
      type: file
      description: annotations & sequences in (multi) GenBank format
      pattern: "*.gbff"
  - embl:
      type: file
      description: annotations & sequences in (multi) EMBL format
      pattern: "*.embl"
  - fna:
      type: file
      description: replicon/contig DNA sequences as FASTA
      pattern: "*.fna"
  - faa:
      type: file
      description: CDS/sORF amino acid sequences as FASTA
      pattern: "*.faa"
  - ffn:
      type: file
      description: feature nucleotide sequences as FASTA
      pattern: "*.ffn"
  - hypotheticals_tsv:
      type: file
      description: further information on hypothetical protein CDS as simple human readble tab separated values
      pattern: "*.hypotheticals.tsv"
  - hypotheticals_faa:
      type: file
      description: hypothetical protein CDS amino acid sequences as FASTA
      pattern: "*.hypotheticals.faa"

docs:
  meta:
    title: bakta
    description: >-
      A Bactopia Tool which uses Bakta to rapidly provide extensive annotations (tRNA, tmRNA,
      rRNA, ncRNA, CRISPR, CDS, pseudogenes, and sORFs) in a standardized fashion.
  introduction: |
    The `bakta` module uses [Bakta](https://github.com/oschwengers/bakta) to rapidly annotate bacterial 
    genomes and plasmids in a standardized fashion. Bakta makes use of a large database ([40+ GB](https://doi.org/10.5281/zenodo.4247252))
    to provide extensive annotations including: tRNA, tmRNA, rRNA, ncRNA, CRISPR, CDS, and sORFs.
  output:
    tree: | 
      <BACTOPIA_DIR>
      ├── <SAMPLE_NAME>
      │   └── main
      │       └── annotator
      │           └── bakta
      │               ├── <SAMPLE_NAME>-blastdb.tar.gz
      │               ├── <SAMPLE_NAME>.embl.gz
      │               ├── <SAMPLE_NAME>.faa.gz
      │               ├── <SAMPLE_NAME>.ffn.gz
      │               ├── <SAMPLE_NAME>.fna.gz
      │               ├── <SAMPLE_NAME>.gbff.gz
      │               ├── <SAMPLE_NAME>.gff3.gz
      │               ├── <SAMPLE_NAME>.hypotheticals.faa.gz
      │               ├── <SAMPLE_NAME>.hypotheticals.tsv
      │               ├── <SAMPLE_NAME>.tsv
      │               ├── <SAMPLE_NAME>.txt
      │               └── logs
      │                   ├── nf-bakta.{begin,err,log,out,run,sh,trace}
      │                   └── versions.yml
      └── bactopia-runs
          └── bakta-<TIMESTAMP>
              └── nf-reports
                  ├── bakta-dag.dot
                  ├── bakta-report.html
                  ├── bakta-timeline.html
                  └── bakta-trace.txt
    add_note: false
    folders:
      - name: Bakta
        description: |
          Below is a description of the _per-sample_ results from [Bakta](https://github.com/oschwengers/bakta).
        is_extensions: true
        table:
        - id: .blastdb.tar.gz
          description: A gzipped tar archive of BLAST+ database of the contigs, genes, and proteins
        - id: .embl.gz
          description: Annotations & sequences in (multi) EMBL format
        - id: .faa.gz
          description: CDS/sORF amino acid sequences as FASTA
        - id: .ffn.gz
          description: Feature nucleotide sequences as FASTA
        - id: .fna.gz
          description: Replicon/contig DNA sequences as FASTA
        - id: .gbff.gz
          description: Annotations & sequences in (multi) GenBank format
        - id: .gff3.gz
          description: Annotations & sequences in GFF3 format
        - id: .hypotheticals.faa.gz
          description: Hypothetical protein CDS amino acid sequences as FASTA
        - id: .hypotheticals.tsv
          description: Further information on hypothetical protein CDS as simple human readable tab separated values
        - id: .tsv
          description: Annotations as simple human readable tab separated values
        - id: .txt
          description: Broad summary of `Bakta` annotations
  citations:
    - bakta
