name: genotyphi
description: Salmonella Typhi genotyping with Mykrobe outputs
icon: false
keywords:
  - fastq
  - genotype
  - Salmonella Typhi
modules:
  - genotyphi
  - mykrobe
input:
  - meta:
    type: map
    description: |
      Groovy Map containing sample information
      e.g. [ id:'test', single_end:false ]
  - reads:
      type: file
      description: Sequence reads in FASTQ format
      pattern: "*.fastq.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: A tab-delimited file of per-sample GenoTyphi results
      pattern: "*.tsv"
  - merged_tsv:
      type: file
      description: A merged TSV of all GenoTyphi results
      pattern: "*.tsv"
  - csv:
      type: file
      description: AMR predictions in CSV format
      pattern: "*.csv"
  - json:
      type: file
      description: AMR predictions in JSON format
      pattern: "*.json"
docs:
  meta:
    title: genotyphi
    description: >-
      A Bactopia Tool which uses GenoTyphi to genotype Salmonella Typhi from the outputs
      of Mykrobe.
  introduction: |
      The `genotyphi` module uses [GenoTyphi](https://github.com/katholt/genotyphi) to genotype Salmonella Typhi
      from the outputs of [Mykrobe](https://github.com/Mykrobe-tools/mykrobe).
  output:
    tree: |
      <BACTOPIA_DIR>
      ├── <SAMPLE_NAME>
      │   └── tools
      │       └── genotyphi
      │           ├── logs
      │           │   ├── genotyphi
      │           │   │   ├── nf-genotyphi.{begin,err,log,out,run,sh,trace}
      │           │   │   └── versions.yml
      │           │   └── mykrobe
      │           │       ├── nf-genotyphi.{begin,err,log,out,run,sh,trace}
      │           │       └── versions.yml
      │           ├── test.csv
      │           ├── test.json
      │           └── test_predictResults.tsv
      └── bactopia-runs
          └── genotyphi-<TIMESTAMP>
              ├── merged-results
              │   ├── genotyphi.tsv
              │   └── logs
              │       └── genotyphi-concat
              │           ├── nf-merged-results.{begin,err,log,out,run,sh,trace}
              │           └── versions.yml
              └── nf-reports
                  ├── genotyphi-dag.dot
                  ├── genotyphi-report.html
                  ├── genotyphi-timeline.html
                  └── genotyphi-trace.txt
    add_note: false
    folders:
      - name: Merged Results
        description: |
          Below are results that are concatenated into a single file.
        table:
          - id: genotyphi.tsv
            description: A merged TSV file with `GenoTyphi` results from all samples
      - name: GenoTyphi
        description: |
          Below is a description of the _per-sample_ results from [GenoTyphi](https://github.com/katholt/genotyphi). A
          full description of the GenoTyphi output is available at [GenoTyphi - Output](https://github.com/katholt/genotyphi/blob/main/README.md#explanation-of-columns-in-the-output)
        table:
          - id: <SAMPLE_NAME>_predictResults.tsv
            description: A tab-delimited file with `GenoTyphi` results
          - id: <SAMPLE_NAME>.csv
            description: The output of `mykrobe predict` in comma-separated format
          - id: <SAMPLE_NAME>.json
            description: The output of `mykrobe predict` in JSON format
  citations:
    - csvtk
    - genotyphi
    - mykrobe
