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() and keggList().
- Retrieving specific KEGG entries, including amino acid (
aaseq) or nucleotide (ntseq) sequences as AAStringSet or DNAStringSet objects using keggGet().
- 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
ReactomePA instead 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.db instead to avoid server-side limitations.
- For complex pathway network topology analyses, use
KEGGgraph or ROntoTools instead.
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") or keggFind() (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) using keggList("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
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.
▶ Open keggrest on BioMate →
1---2name: bioconductor-keggrest3description: A package that provides a client interface to the Kyoto Encyclopedia of Genes and Genomes (KEGG) REST API. Only for academic use by academic users belonging to academic institutions (see <https://www.kegg.jp/kegg/rest/>). Note that KEGGREST4---56# KEGGREST78## Dependencies & Environment910> Package-intrinsic requirements from the Bioconductor landing page — reproduce in any R environment.1112- **Version:** 1.52.0 · **Bioconductor:** 3.23 · **R:** ≥ 4.613- **Imports:** httr, png, Biostrings14- **Install:** `BiocManager::install("KEGGREST")`1516## When to Use17- Exploring available KEGG databases and organisms using `listDatabases()` and `keggList()`.18- Retrieving specific KEGG entries, including amino acid (`aaseq`) or nucleotide (`ntseq`) sequences as `AAStringSet` or `DNAStringSet` objects using `keggGet()`.19- Downloading KEGG pathway maps as PNG images using `keggGet()` with the `"image"` option.20- Searching for genes or compounds by keywords, chemical formulas, or exact mass using `keggFind()`.21- Converting between KEGG identifiers and external database IDs (e.g., NCBI Gene ID) using `keggConv()`.2223## When NOT to Use24- For commercial applications, use `ReactomePA` instead because the KEGG API is strictly restricted to academic use by academic institutions.25- For offline or high-throughput batch queries of thousands of genes, use local annotation packages like `org.Hs.eg.db` instead to avoid server-side limitations.26- For complex pathway network topology analyses, use `KEGGgraph` or `ROntoTools` instead.2728## Data Requirements29- **Valid Identifiers**: Input queries must be valid KEGG identifiers (e.g., `"hsa:10458"`, `"path:hsa00010"`, `"cpd:C00493"`) or supported external identifiers.30- **Internet Connection**: An active internet connection is required to query the live KEGG REST API.3132## Key Parameters33- **database**: The target KEGG database to query (e.g., `"pathway"`, `"organism"`, `"compound"`, `"genes"`).34- **query**: The search term, identifier, or vector of identifiers to retrieve (e.g., `"hsa:10458"`).35- **option**: Specific query options for `keggGet()` (e.g., `"aaseq"`, `"ntseq"`, `"image"`) or `keggFind()` (e.g., `"formula"`, `"exact_mass"`, `"mol_weight"`).3637## Best Practices38- Verify the target organism's official KEGG code (e.g., `"hsa"` for human, `"eco"` for E. coli) using `keggList("organism")` before running queries.39- Limit `keggGet()` queries to a maximum of 10 identifiers at once, as the server restricts larger batches.40- Use `keggLink()` to find relationships across databases, such as retrieving all pathways associated with specific genes.4142## Common Pitfalls43- **Truncated results from keggGet()**: Occurs when supplying more than 10 inputs to `keggGet()`; fix this by batching requests into chunks of 10 or fewer.44- **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")`.45- **Commercial use violation**: Occurs when using the package for non-academic purposes; fix this by switching to open-source databases like Reactome.4647## Alternatives48- `ReactomePA`: For pathway analysis using the open-source, commercially unrestricted Reactome database.49- `clusterProfiler`: For comprehensive enrichment analysis integrating KEGG and GO annotations locally.50- `AnnotationDbi`: For local, offline mapping of gene IDs without relying on web APIs.5152## Citations53- Tenenbaum D (2024). KEGGREST: Client-side REST access to the Kyoto Encyclopedia of Genes and Genomes (KEGG). R package version 1.46.0.54- Kanehisa M, Goto S (2000). KEGG: kyoto encyclopedia of genes and genomes. Nucleic Acids Research, 28(1), 27-30.5556## References57- Homepage: https://bioconductor.org/packages/KEGGREST58- Vignette: https://bioconductor.org/packages/release/bioc/vignettes/KEGGREST/inst/doc/KEGGREST-vignette.html5960<!-- biomate-cta -->61---6263## Run this on BioMate6465This 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](https://www.biomate.ai?ref=kb&pkg=keggrest)** — free to start.6667▶ **[Open `keggrest` on BioMate →](https://www.biomate.ai?ref=kb&pkg=keggrest)**