name: eggnog
description: Functional annotation of proteins using orthologous groups and phylogenies
icon: false
tags:
  - annotation
  - fasta
  - prokaryote
modules:
  - eggnog_download
  - eggnog_mapper
input:
  - meta:
      type: map
      description: |
        Groovy Map containing sample information
        e.g. [ id:'test', single_end:false ]
  - fasta:
      type: file
      description: FASTA assembly file
      pattern: "*.{fasta,fasta.gz,fa,fa.gz,fna,fna.gz}"
  - db:
      type: folder
      description: directory containing eggNOG databases
      pattern: "*"
output:
  - meta:
      type: map
      description: |
        Groovy Map containing sample information
        e.g. [ id:'test', single_end:false ]
  - hits:
      type: file
      description: Results from the search phase, from HMMER, Diamond or MMseqs2
      pattern: "*.emapper.hits"
  - seed_orthologs:
      type: file
      description: Results from parsing the hits
      pattern: "*.emapper.seed_orthologs"
  - annotations:
      type: file
      description: Results from the annotation phase
      pattern: "*.emapper.annotations"
  - xlsx:
      type: file
      description: Annotations in .xlsx format
      pattern: "*.emapper.annotations.xlsx"
  - orthologs:
      type: file
      description: List of orthologs found for each query
      pattern: "*.emapper.orthologs"
  - genepred:
      type: file
      description: Sequences of predicted CDS
      pattern: "*.emapper.genepred.fasta"
  - gff:
      type: file
      description: GFF of predicted CDS
      pattern: "*.emapper.gff"
  - no_anno:
      type: file
      description: Sequences without annotation
      pattern: "*.emapper.no_annotations.fasta"
  - pfam:
      type: file
      description: Positions of the PFAM domains identified
      pattern: "*.emapper.pfam"
  - versions:
      type: file
      description: File containing software versions
      pattern: "versions.yml"
docs:
  meta:
    title: eggnog
    description: >-
      A Bactopia Tool which uses eggNOG-mapper to assign functional
      annotation to protein sequences.
  introduction: |
    The `eggnog` module uses [eggNOG-mapper](https://github.com/eggnogdb/eggnog-mapper) to assign 
    functional annotation to protein sequences. eggNOG-mapper uses orthologous groups and phylogenies
    from the eggNOG database to more precisely functionally annotate than traditional homology methods.
  output:
    tree: |
      <BACTOPIA_DIR>
      ├── <SAMPLE_NAME>
      │   └── tools
      │       └── eggnog
      │           ├── <SAMPLE_NAME>.emapper.annotations
      │           ├── <SAMPLE_NAME>.emapper.hits
      │           ├── <SAMPLE_NAME>.emapper.seed_orthologs
      │           └── logs
      │               ├── nf-eggnog.{begin,err,log,out,run,sh,trace}
      │               └── versions.yml
      └── bactopia-runs
          └── eggnog-<TIMESTAMP>
              └── nf-reports
                  ├── eggnog-dag.dot
                  ├── eggnog-report.html
                  ├── eggnog-timeline.html
                  └── eggnog-trace.txt
    add_note: false
    folders:
      - name: eggNOG-mapper
        description: |
          Below is a description of the _per-sample_ results from [eggNOG-mapper](https://github.com/eggnogdb/eggnog-mapper).
          For full details about each of the eggNOG output files, see
          [eggNOG-mapper - Outputs](https://github.com/eggnogdb/eggnog-mapper/wiki/eggNOG-mapper-v2.1.5-to-v2.1.7#Output_format).
        table:
          - id: <SAMPLE_NAME>.emapper.annotations
            description: Results from the annotation phase
          - id: <SAMPLE_NAME>.emapper.hits
            description: Results from the search phase, from HMMER, Diamond or MMseqs2
          - id: <SAMPLE_NAME>.emapper.seed_orthologs
            description: Results from parsing the hits
          - id: <SAMPLE_NAME>.emapper.annotations.xlsx
            description: (Optional) Annotations in .xlsx format
          - id: <SAMPLE_NAME>.emapper.orthologs
            description: (Optional) List of orthologs found for each query
          - id: <SAMPLE_NAME>.emapper.genepred.fasta
            description: (Optional) Sequences of predicted CDS
          - id: <SAMPLE_NAME>.emapper.gff
            description: (Optional) GFF of predicted CDS
          - id: <SAMPLE_NAME>.emapper.no_annotations.fasta
            description: (Optional) Sequences without annotation
          - id: <SAMPLE_NAME>.emapper.pfam
            description: (Optional) Positions of the PFAM domains identified
  citations:
    - eggnog_mapper
    - eggnog_db
