name: fastani
description: fast alignment-free computation of whole-genome Average Nucleotide Identity (ANI)
icon: false
tags:
  - ani
  - fastani
  - simularity
modules:
  - fastani
input:
  - meta:
      type: map
      description: |
        Groovy Map containing sample information
        e.g. [ id:'test', single_end:false ]
  - query:
      type: file
      description: FASTA files to query against a reference
      pattern: "*.{fna,fna.gz}"
  - reference:
      type: file
      description: Reference FASTA to be queried against
      pattern: "*.{fna,fna.gz}"
output:
  - meta:
      type: map
      description: |
        Groovy Map containing sample information
        e.g. [ id:'test', single_end:false ]
  - tsv:
      type: file
      description: A summary of the per-reference FastANI result
      pattern: "*.tsv"
  - merged_tsv:
      type: file
      description: A merged TSV of all FastANI result files
      pattern: "fastani.tsv"
  - versions:
      type: file
      description: File containing software versions
      pattern: 'versions.yml'
docs:
  meta:
    title: fastani
    description: >-
      A Bactopia Tool which uses FastANI to calculate the average nucleotide identity
      (ANI) between your samples.
  introduction: |
    The `fastani` module uses [FastANI](https://github.com/ParBLiSS/FastANI) to calculate the average 
    nucleotide identity (ANI) between your samples.
    
    Although, sometimes you might be more interested in calculating the ANI of your samples against
    a reference genome. Fortunately, using [ncbi-genome-download](https://github.com/kblin/ncbi-genome-download),
    the `fastani` module allows you specify either a specific NCBI Assembly RefSeq accession (`--accession`) 
    or a species name (`--species`) for which to download all RefSeq genomes.
  output:
    tree: |
      <BACTOPIA_DIR>
      └── bactopia-runs
          └── fastani-<TIMESTAMP>
              ├── fastani
              │   ├── <SAMPLE_NAME>.tsv
              │   └── logs
              │       └── <REFERENCE_NAME>
              │           ├── nf-fastani.{begin,err,log,out,run,sh,trace}
              │           └── versions.yml
              ├── merged-results
              │   ├── fastani.tsv
              │   └── logs
              │       └── fastani-concat
              │           ├── nf-merged-results.{begin,err,log,out,run,sh,trace}
              │           └── versions.yml
              └── nf-reports
                  ├── fastani-dag.dot
                  ├── fastani-report.html
                  ├── fastani-timeline.html
                  └── fastani-trace.txt
    add_note: false
    folders:
      - name: Merged Results
        description: |
          Below are results that are concatenated into a single file.
        table:
          - id: fastani.tsv
            description: A merged TSV file with `FastANI` results from all samples
      - name: FastANI
        description: |
          Below is a description of the _per-sample_ results from [FastANI](https://github.com/ParBLiSS/FastANI).
        table:
          - id: <SAMPLE_NAME>.tsv
            description: FastANI results of all samples against a single samples
  citations:
    - csvtk
    - fastani
    - ncbigenomedownload
