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.
eggNOG-mapper can be installed easily through conda.
conda create -n eggnog_env -c bioconda eggnog-mapper
conda activate eggnog_env
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’.
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.
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:
annotation_output.seed_orthologs - This file describes the orthology alignment of your proteins to the database matches in more detail:
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!