name: busco
description: Assembly completeness based on evolutionarily informed expectations
icon: false
keywords:
  - qc
  - assembly
modules:
  - busco
input:
  - meta:
    type: map
    description: |
      Groovy Map containing sample information
      e.g. [ id:'test', single_end:false ]
  - fasta:
      type: file
      description: FASTA file to be checked for completeness
  - lineage:
      type: file
      description: The BUSCO lineage to check for completeness
output:
  - meta:
      type: map
      description: |
        Groovy Map containing sample information
        e.g. [ id:'test', single_end:false ]
  - results:
      type: file
      description: Per-lineage results from BUSCO analysis
      pattern: "*"
  - tsv:
      type: file
      description: Per-lineage summary of the BUSCO analysis
      pattern: "*-summary.txt"
  - merged_tsv:
      type: file
      description: A merged summary from each lineage in the the BUSCO analysis
      pattern: "busco.tsv"
  - versions:
      type: file
      description: File containing software versions
      pattern: "versions.yml"
docs:
  meta:
    title: busco
    description: >-
      A Bactopia Tool which uses BUSCO, or Benchmarking Universal Single-Copy Orthologs,
      to assess the completeness of your assembly.
  introduction: |
      The `busco` module uses [BUSCO](https://gitlab.com/ezlab/busco) (_or Benchmarking Universal Single-Copy Orthologs_) 
      to assess the completeness of your assembly.
  output:
    tree: |
      <BACTOPIA_DIR>
      ├── <SAMPLE_NAME>
      │   └── tools
      │       └── busco
      │           └── <BUSCO_LINEAGE>
      │               ├── <SAMPLE_NAME>-summary.txt
      │               ├── logs
      │               │   ├── bbtools_{err|out}.log
      │               │   ├── busco.log
      │               │   ├── hmmsearch_{err|out}.log
      │               │   ├── nf-busco.{begin,err,log,out,run,sh,trace}
      │               │   ├── prodigal_{err|out}.log
      │               │   ├── prodigal_mode_single_code_#_{err,out}.log
      │               │   └── versions.yml
      │               ├── prodigal_output
      │               │   └── predicted_genes
      │               │       ├── predicted.{faa,fna}
      │               │       └── tmp
      │               │           └── prodigal_mode_single_code_#.{faa,fna}
      │               ├── run_<BUSCO_LINEAGE>
      │               │   ├── busco_sequences
      │               │   │   ├── fragmented_busco_sequences
      │               │   │   │   └── <ID>.{faa,fna
      │               │   │   ├── multi_copy_busco_sequences
      │               │   │   └── single_copy_busco_sequences
      │               │   │       └── <ID>.{faa,fna}
      │               │   ├── full_table.tsv
      │               │   ├── hmmer_output
      │               │   │   └── <ID>.out
      │               │   ├── missing_busco_list.tsv
      │               │   └── short_summary.{json|txt}
      │               └── short_summary.specific.bacteria_odb10.GCF_000292685.fna.{json|txt}
      └── bactopia-runs
          └── busco-<TIMESTAMP>
              ├── merged-results
              │   ├── busco.tsv
              │   └── logs
              │       └── busco-concat
              │           ├── nf-merged-results.{begin,err,log,out,run,sh,trace}
              │           └── versions.yml
              └── nf-reports
                  ├── busco-dag.dot
                  ├── busco-report.html
                  ├── busco-timeline.html
                  └── busco-trace.txt
    add_note: false
    folders:
      - name: Merged Results
        description: |
          Below are results that are concatenated into a single file.
        table: |
          | Filename    | Description                                |
          |-------------|--------------------------------------------|
          | busco.tsv   | A merged TSV of all lineages used by BUSCO |
      - name: busco
        description: |
          Below is a description of the _per-lineage_ results from [BUSCO](https://gitlab.com/ezlab/busco).
        table:
          - id: <SAMPLE_NAME>-summary.txt
            description: A summary of the BUSCO results
          - id: prodigal_output
            description: Below are the outputs from the Prodigal gene-prediction step.
          - id: run_<BUSCO_LINEAGE>/busco_sequences
            description: FASTA format file for each BUSCO gene identified
          - id: run_<BUSCO_LINEAGE>/full_table.tsv
            description: Complete results in a tab-delimited format with scores and lengths of BUSCO matches
          - id: run_<BUSCO_LINEAGE>/hmmer_output
            description: Tab-delimited output from HMMER
          - id: run_<BUSCO_LINEAGE>/missing_busco_list.tsv
            description: Tab-delimited list of missing BUSCOs
          - id: run_<BUSCO_LINEAGE>/short_summary.json
            description: A summary of BUSCO matches in JSON format
          - id: run_<BUSCO_LINEAGE>/short_summary.txt
            description: A summary of BUSCO matches
          - id: short_summary.specific.<BUSCO_LINEAGE>.<SAMPLE_NAME>.json
            description: A summary of BUSCO matches in JSON format per-sample
          - id: short_summary.specific.<BUSCO_LINEAGE>.<SAMPLE_NAME>.txt
            description: A summary of BUSCO matches per-sample
  citations:
    - busco
    - csvtk
