You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
eggnog-mapper is a tool for functional annotation of novel sequences (proteins,
CDS, genomes, or metagenomes) using precomputed eggNOG orthology assignments.
It maps query sequences to eggNOG orthologous groups (OGs) via fast sequence
searches, then transfers functional annotations — GO terms, KEGG pathways, Pfam
domains, EC numbers, and more — from known orthologs.
Quick Start
1. Install databases
# Download the default eggNOG 5 databases (annotation DB + DIAMOND DB + taxonomy DB)
python download_eggnog_data.py -y
2. Annotate protein sequences
# Basic protein annotation using DIAMOND (default)
python emapper.py -i my_proteins.fasta -o my_output
# Use multiple CPUs
python emapper.py -i my_proteins.fasta -o my_output --cpu 8
3. Annotate a genome
# Gene prediction + annotation from a genome FASTA
python emapper.py -i genome.fna --itype genome -o my_output --cpu 8
# Using Prodigal for gene prediction instead of the default blastx-based method
python emapper.py -i genome.fna --itype genome --genepred prodigal -o my_output --cpu 8
4. Quick test run
# Run against the bundled test database (no downloads needed)
python emapper.py --db e5-test -i tests/fixtures/test_queries.fa -o test_run --output_dir /tmp
Output files
File
Contents
*.emapper.seed_orthologs
Best hits (seed orthologs) from the search phase
*.emapper.annotations
Full functional annotations (TSV)
*.emapper.orthologs
Orthologs per query (if --report_orthologs)
*.emapper.pfam
Pfam domain predictions (if --pfam_realign)
*.emapper.genepred.fasta
Predicted proteins (genome/metagenome input)
*.emapper.genepred.gff
Gene prediction GFF (genome/metagenome input)
*.emapper.decorated.gff
GFF with annotations (if --decorate_gff)
Detailed / Advanced Usage
Search Modes
eggnog-mapper supports several search engines, selected with -m:
# DIAMOND (default, fast and sensitive)
python emapper.py -m diamond -i seqs.fa -o out
# MMseqs2 (fast, good for very large datasets)
python emapper.py -m mmseqs -i seqs.fa -o out
# HMMER (profile-based, most accurate for specific taxonomic groups)
python emapper.py -m hmmer -i seqs.fa -d bact -o out
# Novel families (for uncharacterized protein families)
python emapper.py -m novel_fams -i seqs.fa -o out
# No search: re-annotate a previous seed_orthologs file
python emapper.py -m no_search --annotate_hits_table prev.emapper.seed_orthologs -o out
# Cache-based annotation
python emapper.py -m cache -i seqs.fa -c cache_file.txt -o out
Database Backend Selection
The --db option selects which database backend to use. This determines the
data directory where all database files are looked up:
# Default: use the full eggNOG 5 databases in data/
python emapper.py --db eggnog5 -i seqs.fa -o out
# Use the bundled test database (tiny, for CI/testing)
python emapper.py --db e5-test -i tests/fixtures/test_queries.fa -o out --output_dir /tmp
The precedence for database path resolution is:
--data_dir > EGGNOG_DATA_DIR env var > --db > default (eggnog5)
You can always override with --data_dir to point to a custom database
directory, regardless of --db:
python emapper.py --data_dir /path/to/my/custom/data -i seqs.fa -o out
Input Types
# Protein sequences (default)
python emapper.py -i proteins.fa --itype proteins -o out
# CDS (coding DNA sequences)
python emapper.py -i cds.fna --itype CDS -o out
# CDS translated to proteins before search
python emapper.py -i cds.fna --itype CDS --translate -o out
# Genome
python emapper.py -i genome.fna --itype genome -o out
# Metagenome
python emapper.py -i metagenome.fna --itype metagenome -o out
Gene Prediction (for genome/metagenome inputs)
When using --itype genome or --itype metagenome, genes must be predicted
before annotation:
# Blastx-based gene prediction (default): infers genes from DIAMOND/MMseqs2 hits
python emapper.py -i genome.fna --itype genome --genepred search -o out
# Prodigal-based gene prediction
python emapper.py -i genome.fna --itype genome --genepred prodigal -o out
# Prodigal with a training genome
python emapper.py -i genome.fna --itype genome --genepred prodigal \
--training_genome reference.fna -o out
# Control overlap handling in blastx-based prediction
python emapper.py -i genome.fna --itype metagenome --genepred search \
--allow_overlaps diff_frame --overlap_tol 0.5 -o out
Taxonomic Scope and Ortholog Filtering
Taxonomic scope controls which clades are used for functional transfer by
setting an ev_lca ceiling on speciation events:
# Auto-narrow: walk seed's lineage from leaf up, use narrowest matching clade
python emapper.py -i seqs.fa --tax_scope auto-narrow -o out
# Auto-broad: walk seed's lineage, prioritize broad clades
python emapper.py -i seqs.fa --tax_scope auto-broad -o out
# Fix ceiling to a specific clade for all seeds
python emapper.py -i seqs.fa --tax_scope Metazoa -o out
python emapper.py -i seqs.fa --tax_scope 33208 -o out
# Control donor pool strategy (default: closest; alternative: union)
python emapper.py -i seqs.fa --donor_pool union -o out
# Only use one-to-one orthologs for annotation
python emapper.py -i seqs.fa --target_orthologs one2one -o out
# Restrict annotation to specific target taxa
python emapper.py -i seqs.fa --target_taxa 9606,10090 -o out
# Exclude specific taxa from annotation
python emapper.py -i seqs.fa --excluded_taxa 9606 -o out
v7 Batch Annotation
When eggnog-mapper uses the v7 annotation engine (batch_annotate.py), it
delegates to eggnog_annotator.e7.AnnotationEngine for bulk ortholog lookup and
functional annotation transfer. This path is active when the database backend
is eggnog5 (the default) and --no_annot is not set.
--target-orthologs
Controls which orthology relationship types are used for annotation transfer.
Value
Description
all
Use all orthologs regardless of relationship type (default)
one2one
Only strict one-to-one orthologs
one2many
One-to-many orthologs (gene duplication on target side)
many2one
Many-to-one orthologs (gene duplication on query side)
many2many
Many-to-many orthologs
Orthology type is determined per speciation event from the unfiltered side
sizes stored in sp_events. All five keys are classified for every event;
--target-orthologs then filters the annot_orthologs output column to
retain only events of the selected type.
# Annotate using only strict one-to-one orthologs
python emapper.py -i seqs.fa --target_orthologs one2one -o out
# Default: use all ortholog types
python emapper.py -i seqs.fa --target_orthologs all -o out
DIAMOND Tuning
# Ultra-sensitive search
python emapper.py -i seqs.fa --sensmode ultra-sensitive -o out
# Iterative search (starts fast, increases sensitivity)
python emapper.py -i seqs.fa --dmnd_iterate yes --sensmode very-sensitive -o out
# Small query optimization
python emapper.py -i small_set.fa --dmnd_algo ctg -o out
# Use a custom DIAMOND database
python emapper.py -i seqs.fa --dmnd_db /path/to/custom.dmnd -o out
# Enable frameshift-aware alignment (for error-prone sequences)
python emapper.py -i seqs.fa --dmnd_frameshift 15 -o out
# Tune memory/performance
python emapper.py -i seqs.fa --block_size 4.0 --index_chunks 1 -o out --cpu 16
# Search against a specific taxonomic-level HMM database
python emapper.py -m hmmer -i seqs.fa -d bact -o out
# Load database into memory for faster searches
python emapper.py -m hmmer -i seqs.fa -d bact --usemem -o out
# Use a remote HMMER server
python emapper.py -m hmmer -i seqs.fa -d mydb:hostname:51700 -o out
# Multiple servers and workers
python emapper.py -m hmmer -i seqs.fa -d bact --usemem \
--num_servers 2 --num_workers 4 --cpu 8 -o out
Pfam Domain Annotation
# Realign queries to Pfam domains found via orthology transfer
python emapper.py -i seqs.fa --pfam_realign realign -o out
# De novo Pfam search against the entire Pfam database
python emapper.py -i seqs.fa --pfam_realign denovo -o out
Search Filtering
# Filter by identity and coverage
python emapper.py -i seqs.fa --pident 40 --query_cover 60 --subject_cover 60 -o out
# Stricter e-value and score thresholds
python emapper.py -i seqs.fa --evalue 1e-10 --score 100 -o out
# Adjust seed ortholog thresholds for annotation
python emapper.py -i seqs.fa --seed_ortholog_evalue 1e-5 --seed_ortholog_score 60 -o out
Output Options
# Also produce Excel output
python emapper.py -i seqs.fa -o out --excel
# Report orthologs used for annotation
python emapper.py -i seqs.fa -o out --report_orthologs
# Include MD5 hash of each query
python emapper.py -i seqs.fa -o out --md5
# No header/comment lines in output files
python emapper.py -i seqs.fa -o out --no_file_comments
# Use a scratch directory for faster I/O on network filesystems
python emapper.py -i seqs.fa -o out --scratch_dir /local/scratch --output_dir /nfs/results
# Decorate a GFF file with annotations
python emapper.py -i genome.fna --itype genome --decorate_gff yes -o out
Resuming and Overriding
# Resume a previous run (skip already-computed results)
python emapper.py -i seqs.fa -o out --resume
# Force overwrite of existing output files
python emapper.py -i seqs.fa -o out --override