KEGGREST
Dependencies & Environment
Package-intrinsic requirements from the Bioconductor landing page — reproduce in any R environment.
- Version: 1.52.0 · Bioconductor: 3.23 · R: ≥ 4.6
- Imports: httr, png, Biostrings
- Install:
BiocManager::install("KEGGREST")
When to Use
- Exploring available KEGG databases and organisms using
listDatabases()andkeggList(). - Retrieving specific KEGG entries, including amino acid (
aaseq) or nucleotide (ntseq) sequences asAAStringSetorDNAStringSetobjects usingkeggGet(). - Downloading KEGG pathway maps as PNG images using
keggGet()with the"image"option. - Searching for genes or compounds by keywords, chemical formulas, or exact mass using
keggFind(). - Converting between KEGG identifiers and external database IDs (e.g., NCBI Gene ID) using
keggConv().
When NOT to Use
- For commercial applications, use
ReactomePAinstead because the KEGG API is strictly restricted to academic use by academic institutions. - For offline or high-throughput batch queries of thousands of genes, use local annotation packages like
org.Hs.eg.dbinstead to avoid server-side limitations. - For complex pathway network topology analyses, use
KEGGgraphorROntoToolsinstead.
Data Requirements
- Valid Identifiers: Input queries must be valid KEGG identifiers (e.g.,
"hsa:10458","path:hsa00010","cpd:C00493") or supported external identifiers. - Internet Connection: An active internet connection is required to query the live KEGG REST API.
Key Parameters
- database: The target KEGG database to query (e.g.,
"pathway","organism","compound","genes"). - query: The search term, identifier, or vector of identifiers to retrieve (e.g.,
"hsa:10458"). - option: Specific query options for
keggGet()(e.g.,"aaseq","ntseq","image") orkeggFind()(e.g.,"formula","exact_mass","mol_weight").
Best Practices
- Verify the target organism's official KEGG code (e.g.,
"hsa"for human,"eco"for E. coli) usingkeggList("organism")before running queries. - Limit
keggGet()queries to a maximum of 10 identifiers at once, as the server restricts larger batches. - Use
keggLink()to find relationships across databases, such as retrieving all pathways associated with specific genes.
Common Pitfalls
- Truncated results from keggGet(): Occurs when supplying more than 10 inputs to
keggGet(); fix this by batching requests into chunks of 10 or fewer. - Invalid organism code: Using common names instead of the official 3-4 letter KEGG code returns empty results; fix this by looking up the code with
keggList("organism"). - Commercial use violation: Occurs when using the package for non-academic purposes; fix this by switching to open-source databases like Reactome.
Alternatives
ReactomePA: For pathway analysis using the open-source, commercially unrestricted Reactome database.clusterProfiler: For comprehensive enrichment analysis integrating KEGG and GO annotations locally.AnnotationDbi: For local, offline mapping of gene IDs without relying on web APIs.
Citations
- Tenenbaum D (2024). KEGGREST: Client-side REST access to the Kyoto Encyclopedia of Genes and Genomes (KEGG). R package version 1.46.0.
- Kanehisa M, Goto S (2000). KEGG: kyoto encyclopedia of genes and genomes. Nucleic Acids Research, 28(1), 27-30.
References
- Homepage: https://bioconductor.org/packages/KEGGREST
- Vignette: https://bioconductor.org/packages/release/bioc/vignettes/KEGGREST/inst/doc/KEGGREST-vignette.html
Run this on BioMate
This skill is the knowledge layer — when, why, and how to use keggrest. To run this analysis on your own data with managed compute, automated QC, and reproducible outputs, use BioMate — free to start.


