name: rgi
description: Predict antibiotic resistance from assemblies
keywords:
  - bacteria
  - fasta
  - antibiotic resistance
modules:
  - rgi
input:
  - meta:
      type: map
      description: |
        Groovy Map containing sample information
        e.g. [ id:'test', single_end:false ]
  - fasta:
      type: file
      description: The final assembly in FASTA format
      pattern: "*.{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"
  - json:
      type: file
      description: JSON report of results for a single sample
      pattern: "*.{txt}"
  - tsv:
      type: file
      description: Tab-delimited report of results for a single sample
      pattern: "*.{txt}"
  - merged_tsv:
      type: file
      description: Tab-delimited report of results from all samples
      pattern: "*.{txt}"
  - heatmap:
      type: file
      description: Heatmap representations as text and images
      pattern: "*.{csv,eps,png}"
docs:
  meta:
    title: rgi
    description: >-
      A Bactopia Tool which uses Resistance Gene Identifier (RGI) to identify antibiotic
      resistance genes in assemblies.
  introduction: |
    The `rgi` module uses [Resistance Gene Identifier (RGI)](https://github.com/arpcard/rgi) to identify antibiotic
    resistance genes in assemblies.
  output:
    tree: |
      <BACTOPIA_DIR>
      ├── <SAMPLE_NAME>
      │   └── tools
      │       └── rgi
      │           ├── <SAMPLE_NAME>.json
      │           ├── <SAMPLE_NAME>.txt
      │           └── logs
      │               ├── nf-rgi.{begin,err,log,out,run,sh,trace}
      │               └── versions.yml
      └── bactopia-runs
          └── rgi-<TIMESTAMP>
              ├── merged-results
              │   ├── logs
              │   │   ├── rgi-concat
              │   │   │   ├── nf-merged-results.{begin,err,log,out,run,sh,trace}
              │   │   │   └── versions.yml
              │   │   └── rgi-heatmap
              │   │       ├── nf-merged-results.{begin,err,log,out,run,sh,trace}
              │   │       └── versions.yml
              │   ├── rgi-2.{csv,eps,png}
              │   └── rgi.tsv
              └── nf-reports
                  ├── rgi-dag.dot
                  ├── rgi-report.html
                  ├── rgi-timeline.html
                  └── rgi-trace.txt
    add_note: false
    folders:
      - name: Merged Results
        description: |
          Below are results that are concatenated into a single file.
        table:
          - id: rgi.tsv
            description: A merged TSV file with `rgi` results from all samples
          - id: rgi-2.{csv,eps,png}
            description: Heatmap representations as text and images, see [RGI - Heatmap](https://github.com/arpcard/rgi#generating-heat-maps-of-rgi-main-results) for more details
      - name: rgi
        description: |
          Below is a description of the _per-sample_ results from [RGI](https://github.com/arpcard/rgi).
        table:
          - id: <SAMPLE_NAME>.json
            description: A JSON file with `rgi` results
          - id: <SAMPLE_NAME>.txt
            description: A tab-delimited file with `egi` results, see [RGI - Output Details](https://github.com/arpcard/rgi#rgi-main-tab-delimited-output-details) for more details
  citations:
    - csvtk
    - rgi
