name: kraken
description: Taxonomic classifications of sequence reads
keywords:
  - classify
  - metagenomics
  - fastq
modules:
  - kraken2
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: directory
      description: Kraken2 database
output:
  - meta:
      type: map
      description: |
        Groovy Map containing sample information
        e.g. [ id:'test', single_end:false ]
  - classified:
      type: file
      description: |
        Reads classified to belong to any of the taxa
        on the Kraken2 database.
      pattern: "*{fastq.gz}"
  - unclassified:
      type: file
      description: |
        Reads not classified to belong to any of the taxa
        on the Kraken2 database.
      pattern: "*{fastq.gz}"
  - report:
      type: file
      description: |
        Kraken2 report containing stats about classified
        and not classifed reads.
      pattern: "*.{report.txt}"
  - versions:
      type: file
      description: File containing software versions
      pattern: "versions.yml"
docs:
  meta:
    title: kraken2
    description: >-
      A Bactopia Tool which uses Kraken2 to assign taxonomic classifications
      to your sequence reads.
  introduction: |
    The `kraken2` module uses [Kraken2](https://github.com/DerrickWood/kraken2) to assign taxonomic 
    classifications to your sequence reads.
  output:
    tree: |
      <BACTOPIA_DIR>
      ├── <SAMPLE_NAME>
      │   └── tools
      │       └── kraken2
      │           ├── <SAMPLE_NAME>.classified_{1|2}.fastq.gz
      │           ├── <SAMPLE_NAME>.kraken2.report.txt
      │           ├── <SAMPLE_NAME>.unclassified_{1,2}.fastq.gz
      │           └── logs
      │               ├── nf-kraken2.{begin,err,log,out,run,sh,trace}
      │               └── versions.yml
      └── bactopia-runs
          └── kraken2-<TIMESTAMP>
              └── nf-reports
                  ├── kraken2-dag.dot
                  ├── kraken2-report.html
                  ├── kraken2-timeline.html
                  └── kraken2-trace.txt
    add_note: false
    folders:
        - name: Kraken2
          description: |
            Below is a description of the _per-sample_ results from [Kraken2](https://github.com/DerrickWood/kraken2).
          table:
            - id: <SAMPLE_NAME>.classified_{1|2}.fastq.gz
              description: Reads classified to belong to any of the taxa on the Kraken2 database.
            - id: <SAMPLE_NAME>.kraken2.report.txt
              description: Kraken2 report containing stats about classified and not classified reads See [Kraken2 - Output Formats](https://github.com/DerrickWood/kraken2/wiki/Manual#output-formats) for more details
            - id: <SAMPLE_NAME>.unclassified_{1,2}.fastq.gz
              description: Reads not classified to belong to any of the taxa on the Kraken2 database.
  citations:
    - kraken2
