name: ariba
description: Gene identification through local assemblies
icon: false
keywords:
  - fastq
  - assembly
  - resistance
  - virulence
modules:
  - ariba_getref
  - ariba_run
input:
  - meta:
    type: map
    description: |
      Groovy Map containing sample information
      e.g. [ id:'test', single_end:false ]
  - reads:
    type: file
    description: |
      List of input FastQ files of size 1 and 2 for single-end and paired-end data,
      respectively.
  - db:
    type: file
    description: An database to query using ARIBA
output:
  - meta:
      type: map
      description: |
        Groovy Map containing sample information
        e.g. [ id:'test', single_end:false ]
  - results:
      type: file
      description: The full results of ARIBA for each sample
      pattern: "*"
  - merged_report:
      type: file
      description: A merged TSV of the ARIBA reports
      pattern: "ariba-report.tsv"
  - merged_summary:
      type: file
      description: A merged CSV of the ARIBA summaries
      pattern: "ariba-summary.csv"
  - versions:
      type: file
      description: File containing software versions
      pattern: "versions.yml"
docs:
  meta:
    title: ariba
    description: >-
      A Bactopia Tool which uses ARIBA to rapidly identify genes in
      a database by creating local assemblies.
  introduction: |
      The `ariba` module uses [ARIBA](https://github.com/sanger-pathogens/ariba) 
      to rapidly identify genes in a database by creating local assemblies.
  output:
    tree: |
      <BACTOPIA_DIR>
      ├── <SAMPLE_NAME>
      │   └── tools
      │       └── ariba
      │           └── card
      │               ├── <SAMPLE_NAME>-report.tsv
      │               ├── <SAMPLE_NAME>-summary.csv
      │               ├── assembled_genes.fa.gz
      │               ├── assembled_seqs.fa.gz
      │               ├── assemblies.fa.gz
      │               ├── debug.report.tsv
      │               ├── log.clusters.gz
      │               ├── logs
      │               │   ├── nf-ariba.{begin,err,log,out,run,sh,trace}
      │               │   └── versions.yml
      │               └── version_info.txt
      └── bactopia-runs
          └── ariba-<TIMESTAMP>
              ├── merged-results
              │   ├── card-report.tsv
              │   ├── card-summary.csv
              │   └── logs
              │       ├── card-report
              │       │   ├── nf-merged-results.{begin,err,log,out,run,sh,trace}
              │       │   └── versions.yml
              │       └── card-summary
              │           ├── nf-merged-results.{begin,err,log,out,run,sh,trace}
              │           └── versions.yml
              └── nf-reports
                  ├── ariba-dag.dot
                  ├── ariba-report.html
                  ├── ariba-timeline.html
                  └── ariba-trace.txt
    add_note: true
    folders:
      - name: Merged Results
        description: |
          Below are results that are concatenated into a single file.
        is_extensions: true
        table:
          - id: -report.tsv
            description: A merged TSV file with `ariba` results from all samples
          - id: -summary.csv
            description: A merged CSV file created with `ariba summary`
      - name: Ariba
        description: |
          Below is a description of the _per-sample_ results from [ARIBA](https://github.com/sanger-pathogens/ariba/wiki/Task:-run).
        table:
          - id: <SAMPLE_NAME>-report.tsv
            description: A report of the ARIBA analysis results
          - id: <SAMPLE_NAME>-summary.csv
            description: A summary of the report created using `ariba summary`
          - id: assembled_genes.fa.gz
            description: All the assembled genes
          - id: assembled_seqs.fa.gz
            description: All the assembled sequences that match the reference
          - id: assemblies.fa.gz
            description: All the raw local assembles
          - id: debug.report.tsv
            description: Contains the results from `report.tsv` in addition to synonymous mutations
          - id: log.clusters.gz
            description: A log of the ARIBA analysis
          - id: version_info.txt
            description: Contains info on the versions of ARIBA and its dependencies
  citations:
    - ariba
    - csvtk
