name: tblastn
description: Search against translated nucleotide BLAST databases using protein queries
icon: false
keywords:
  - fasta
  - blast
  - alignment
modules:
  - tblastn
input:
  - meta:
    type: map
    description: |
      Groovy Map containing sample information
      e.g. [ id:'test', single_end:false ]
  - fasta:
      type: file
      description: Input fasta file containing queries sequences
      pattern: "*.{fa,fasta}"
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: TBLASTN results in TSV format
      pattern: "*.tblastn.tsv"
  - merged_tsv:
      type: file
      description: A merged TSV of TBLASTN results for all samples
      pattern: "*.tsv"
docs:
  meta:
    title: tblastn
    description: >
      A Bactopia Tool which uses TBLASTN to query protein sequences against translated nucleotide databases.
  introduction: |
      The `tblastn` module uses [TBLASTN](https://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Web&PAGE_TYPE=Blastdocs)
      to query protein sequences against translated nucleotide databases (contigs) for each sample.
  output:
    tree: |
      <BACTOPIA_DIR>
      ├── <SAMPLE_NAME>
      │   └── tools
      │       └── tblastn
      │           ├── <SAMPLE_NAME>.tblastn.tsv
      │           └── logs
      │               ├── nf-tblastn.{begin,err,log,out,run,sh,trace}
      │               └── versions.yml
      └── bactopia-runs
          └── tblastn-<TIMESTAMP>
              ├── merged-results
              │   ├── tblastn.tsv
              │   └── logs
              │       └── tblastn-concat
              │           ├── nf-merged-results.{begin,err,log,out,run,sh,trace}
              │           └── versions.yml
              └── nf-reports
                  ├── tblastn-dag.dot
                  ├── tblastn-report.html
                  ├── tblastn-timeline.html
                  └── tblastn-trace.txt
    add_note: false
    folders:
      - name: Merged Results
        description: |
          Below are results that are concatenated into a single file.
        table:
          - id: tblastn.tsv
            description: A merged TSV file with `tblastn` results from all samples
      - name: tblastn
        description: |
          Below is a description of the _per-sample_ results from [TBLASTN](https://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Web&PAGE_TYPE=Blastdocs).
        table:
          - id: <SAMPLE_NAME>.tblastn.tsv
            description: A TSV file with `tblastn` results for a single sample
  citations:
    - blast
    - csvtk
