This guide covers the use of the eggNOG-mapper (Huerta-Cepas et al. 2019; Cantalapiedra et al. 2021) in R studio (Posit team 2025) for the functional annotation of protein sequences. This guide will cover the basic use of eggNOG-mapper, but for more customisation you can visit the eggNOG github page: https://github.com/eggnogdb/eggnog-mapper/wiki/eggNOG-mapper-v2.1.5-to-v2.1.13

A Linux based system with Miniconda will be required for this guide and some high computing power is suggested, such a system might exist for your institution or can be purchased through an online cloud computing provide. Follow my guide on cloud based VM setup here: https://scottc-bio.github.io/guides/Virtual-machines-for-bioinformatics.html

A basic understanding of LINUX such as creating and moving directories etc. is assumed for this guide.

1 Installing eggNOG-mapper

eggNOG-mapper can be installed easily through conda.

conda create -n eggnog_env -c bioconda eggnog-mapper
conda activate eggnog_env

2 Downloading the databases

eggNOG-mapper comes with a script for downloading and extracting their databases, but unfrotunately the addresses for the databases are outdated. So we can perform the downloads manually instead.

Make a directory to store the eggNOG databases. I like to use the ‘~’ to make this in the root directory. As here it is easily accessible to use for many projects. Move into it after creation.

mkdir -p ~/eggnog_data
cd ~/eggnog_data

I will use the links that were the most recent when I did this. But if you check: http://eggnog5.embl.de/download/, then you can go into the most recent version and then copy the links to each .gz file.

The downloads don’t take too long but the extraction of the compressed archives can take some time. Therefore I like to perform things like this in a background session using ‘tmux’.

Create a new tmux session.

tmux new -s eggnog_download

Reactivate the eggnog environment in this new terminal.

conda activate eggnog_env

To download the main annotation database and extract it. Replace the link with the most recent version.

wget http://eggnog5.embl.de/download/emapperdb-5.0.2/eggnog.db.gz
gunzip eggnog.db.gz

The taxonomy database.

wget http://eggnog5.embl.de/download/emapperdb-5.0.2/eggnog.taxa.tar.gz
tar -xzf eggnog.taxa.tar.gz

The DIAMOND database (Buchfink, Reuter, and Drost 2021).

wget http://eggnog5.embl.de/download/emapperdb-5.0.2/eggnog_proteins.dmnd.gz
gunzip eggnog_proteins.dmnd.gz

While waiting for the extractions, the tmux session can be detached from using ‘Ctrl + b’ followed by ‘d’.

Can re-attach to the session at any time to check progress.

tmux attach -t eggnog_download

When finished can disconnect with ‘exit’.

3 Running eggNOG-mapper

Now just direct emapper to the input protein sequences and the location of the databases to run.

emapper.py -i protein.faa -o annotation_output --data_dir ~/eggnog_data/ --cpu 8

Can change the cpu threads to whatever you want. This takes a little bit of time but not too much, can be run in tmux if you have a very large number of sequences.

The -o argument dictates the prefix for the output files, but you can also direct these to a directory.

4 Understanding the outputs

You will have three output files:

annotation_output.emapper.annotations - This is the main results file with the annotations of each protein sequence. For each sequences there will be the following columns:

  • query ID - input protein ID
  • seed_ortholog - the best matching protein sequence in the databases
  • evalue - score of alignment significance (smaller = stronger)
  • score - alignment bit score (higher = stronger)
  • eggNOG_OGs - orthologous groups
  • max_annot_lvl - Taxonomic depth used for annotation
  • COG category - broad functional category in single letter codes (useful for broad descriptions)
  • Description - Human-readable description of protein function
  • Preferred_name - gene name of annotated protein
  • GOs - Gene Ontology terms (used for GO enrichment analysis)
  • EC - Enzyme Commission number (defines the catalytic activity)
  • KEGG_ko - KEGG Orthology identifier (useful for pathway analysis)
  • KEGG_Pathway - Mapped pathway of annotated protein
  • KEGG_Module - Smaller functional module
  • KEGG_Reaction - Specific biochemical reactions
  • KEGG_rclass - KEGG reaction class for more specialised metabolic grouping
  • BRITE - KEGG hierarchical classification
  • KEGG_TC - Transporter classification, relevant for membrane proteins
  • CAZy - Carbohydrate-active enzymes
  • BiGG_Reaction - Metabolic model reaction ID, for metabolic modelling
  • PFAMs - Protein domains, these are very useful as the concisely explain protein function

annotation_output.seed_orthologs - This file describes the orthology alignment of your proteins to the database matches in more detail:

  • qseqid - Query sequence, your protein ID
  • sseqid - Subject sequence, the protein ID of the database match
  • evalue - alignment significance (smaller = stronger)
  • bitscore - alignment strength (higher = stronger)
  • qstart - start position in the query sequence (i.e., your protein sequence)
  • qend - end position in the query sequences
  • sstart - start position in the database matched ortholog sequence
  • send - end position in the database matched ortholog sequence
  • pident - percentage amino acid identity between input sequences and sequence of matched ortholog
  • qcov - query coverage i.e., how much of the input sequence aligned to the orthologous match
  • scov - subject coverage i.e, how much of the orthologous match aligned to the input sequences

annotation_output.hits - This is the raw DIAMOND alignment hits. It does not have columns names and is mainly used for debugging.

So essentially, you want to use mainly the .annotations file and if you want to explore a specific protein in more depth, then you can use the other files.

You have now functionally annotated your protein sequences!

References

Buchfink, Benjamin, Klaus Reuter, and Hajk-Georg Drost. 2021. “Sensitive Protein Alignments at Tree-of-Life Scale Using DIAMOND.” Nature Methods 18 (4). Nature Publishing Group: 366–68. doi:10.1038/s41592-021-01101-x.
Cantalapiedra, Carlos P, Ana Hernández-Plaza, Ivica Letunic, Peer Bork, and Jaime Huerta-Cepas. 2021. eggNOG-mapper V2: Functional Annotation, Orthology Assignments, and Domain Prediction at the Metagenomic Scale.” Molecular Biology and Evolution 38 (12): 5825–29. doi:10.1093/molbev/msab293.
Huerta-Cepas, Jaime, Damian Szklarczyk, Davide Heller, Ana Hernández-Plaza, Sofia K Forslund, Helen Cook, Daniel R Mende, et al. 2019. eggNOG 5.0: A Hierarchical, Functionally and Phylogenetically Annotated Orthology Resource Based on 5090 Organisms and 2502 Viruses.” Nucleic Acids Research 47 (D1): D309–14. doi:10.1093/nar/gky1085.
Posit team. 2025. RStudio: Integrated Development Environment for R.” Boston, MA: Posit Software, PBC. http://www.posit.co/.