Title: | Client-side REST access to the Kyoto Encyclopedia of Genes and Genomes (KEGG) |
---|---|
Description: | 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 KEGGREST is based on KEGGSOAP by J. Zhang, R. Gentleman, and Marc Carlson, and KEGG (python package) by Aurelien Mazurie. |
Authors: | Dan Tenenbaum [aut], Bioconductor Package Maintainer [aut, cre], Martin Morgan [ctb], Kozo Nishida [ctb], Marcel Ramos [ctb], Kristina Riemer [ctb], Lori Shepherd [ctb], Jeremy Volkening [ctb] |
Maintainer: | Bioconductor Package Maintainer <[email protected]> |
License: | Artistic-2.0 |
Version: | 1.47.0 |
Built: | 2024-11-29 07:56:42 UTC |
Source: | https://github.com/bioc/KEGGREST |
Get list of compounds IDs for pathway.
keggCompounds(pathwayID)
keggCompounds(pathwayID)
pathwayID |
A KEGG pathway identifier with the prefix |
A list of KEGG compound identifiers
Dan Tenenbaum, Kristina Riemer
https://www.genome.jp/kegg/pathway.html
keggCompounds("map00361")
keggCompounds("map00361")
Convert KEGG identifiers to/from outside identifiers.
keggConv(target, source, querySize = 100)
keggConv(target, source, querySize = 100)
target |
A KEGG organism code (), T number, or one of the external
databases |
source |
Same as |
querySize |
Empirically, KEGG limits queries to 100 source identifiers per query.
This argument enables larger queries by dividing |
A named character vector.
Dan Tenenbaum
https://www.kegg.jp/kegg/docs/keggapi.html
## conversion from NCBI GeneID to KEGG ID for E. coli genes head(keggConv("eco", "ncbi-geneid")) head(keggConv("ncbi-geneid", "eco")) ## opposite direction ## conversion from KEGG ID to NCBI GI head(keggConv("ncbi-proteinid", c("hsa:10458", "ece:Z5100"))) ## conversion from NCBI GI to KEGG ID when the organism code is not known: head(keggConv("genes", "ncbi-geneid:3113320"))
## conversion from NCBI GeneID to KEGG ID for E. coli genes head(keggConv("eco", "ncbi-geneid")) head(keggConv("ncbi-geneid", "eco")) ## opposite direction ## conversion from KEGG ID to NCBI GI head(keggConv("ncbi-proteinid", c("hsa:10458", "ece:Z5100"))) ## conversion from NCBI GI to KEGG ID when the organism code is not known: head(keggConv("genes", "ncbi-geneid:3113320"))
Finds entries with matching query keywords or other query data in a given database.
keggFind(database, query, option = c("formula", "exact_mass", "mol_weight"))
keggFind(database, query, option = c("formula", "exact_mass", "mol_weight"))
database |
Either the name of a single KEGG database (list available via
|
query |
One or more keywords, or a range of integers representing
molecular weights.
If |
option |
|
A named character vector.
Dan Tenenbaum
https://www.kegg.jp/kegg/docs/keggapi.html
res <- keggFind("genes", c("shiga", "toxin")) ## for keywords "shiga" and "toxin" length(res) head(res) res <- keggFind("genes", "shiga toxin") ## for keywords "shiga toxin" length(res) head(res) keggFind("compound", "C7H10O5", "formula") ## for chemical formula "C7H10O5" res <- keggFind("compound", "O5C7", "formula") ## for chemical formula ## containing "O5" and "C7" length(res) head(res) keggFind("compound", 174.05, "exact_mass") ## for 174.045 ## =< exact mass < 174.055 res <- keggFind("compound", 300:310, "mol_weight") ## for 300 =< ## molecular weight =< 310 length(res) head(res)
res <- keggFind("genes", c("shiga", "toxin")) ## for keywords "shiga" and "toxin" length(res) head(res) res <- keggFind("genes", "shiga toxin") ## for keywords "shiga toxin" length(res) head(res) keggFind("compound", "C7H10O5", "formula") ## for chemical formula "C7H10O5" res <- keggFind("compound", "O5C7", "formula") ## for chemical formula ## containing "O5" and "C7" length(res) head(res) keggFind("compound", 174.05, "exact_mass") ## for 174.045 ## =< exact mass < 174.055 res <- keggFind("compound", 300:310, "mol_weight") ## for 300 =< ## molecular weight =< 310 length(res) head(res)
Retrieves given database entries.
keggGet(dbentries, option = c("aaseq", "ntseq", "mol", "kcf", "image", "kgml"))
keggGet(dbentries, option = c("aaseq", "ntseq", "mol", "kcf", "image", "kgml"))
dbentries |
One or more (up to a maximum of 10) KEGG identifiers. |
option |
|
Retrieves all entries from the KEGG database for a set of KEGG identifers.
keggGet
() can only return 10 result sets at once (this limitation
is on the server side). If you supply more than 10 inputs to keggGet()
,
KEGGREST
will warn that only the first 10 results will be returned.
A list wrapping a KEGG flat file.
If option
is aaseq
, an AAStringSet
object.
If option
is ntseq
, a DNAStringSet
object.
If option
is image
, an object which can be written
to a PNG file.
If option
is kgml
, a KGML document.
Dan Tenenbaum
https://www.kegg.jp/kegg/docs/keggapi.html
res <- keggGet(c("cpd:C01290", "gl:G00092")) ## retrieves a compound entry ## and a glycan entry str(res) res <- keggGet(c("C01290", "G00092")) ## same as above, without prefixes str(res) res <- keggGet(c("hsa:10458", "ece:Z5100")) ## retrieves a human gene entry ## and an E.coli O157 gene entry str(res) res <- keggGet(c("hsa:10458", "ece:Z5100"), "aaseq") ## retrieves amino ## acid sequences of a human gene and an ## E.coli O157 gene png <- keggGet("hsa05130", "image") ## retrieves the image file of a ## pathway map t <- tempfile() library(png) writePNG(png, t) res <- keggGet("hsa05130", "kgml") str(res)
res <- keggGet(c("cpd:C01290", "gl:G00092")) ## retrieves a compound entry ## and a glycan entry str(res) res <- keggGet(c("C01290", "G00092")) ## same as above, without prefixes str(res) res <- keggGet(c("hsa:10458", "ece:Z5100")) ## retrieves a human gene entry ## and an E.coli O157 gene entry str(res) res <- keggGet(c("hsa:10458", "ece:Z5100"), "aaseq") ## retrieves amino ## acid sequences of a human gene and an ## E.coli O157 gene png <- keggGet("hsa05130", "image") ## retrieves the image file of a ## pathway map t <- tempfile() library(png) writePNG(png, t) res <- keggGet("hsa05130", "kgml") str(res)
Displays statistics of a given database, such as number of entries, version, release date, and source.
keggInfo(database)
keggInfo(database)
database |
Either a KEGG database (list available via |
A character vector containing statistics about database
.
Dan Tenenbaum
https://www.kegg.jp/kegg/docs/keggapi.html
res <- keggInfo("kegg") ## displays the current statistics of the KEGG database cat(res) res <- keggInfo("pathway") ## displays the number pathway entries including both ## the reference and organism-specific pathways cat(res) res <- keggInfo("hsa") ## displays the number of gene entries for the ## KEGG organism Homo sapiens cat(res)
res <- keggInfo("kegg") ## displays the current statistics of the KEGG database cat(res) res <- keggInfo("pathway") ## displays the number pathway entries including both ## the reference and organism-specific pathways cat(res) res <- keggInfo("hsa") ## displays the number of gene entries for the ## KEGG organism Homo sapiens cat(res)
Find related entries by using database cross-references.
keggLink(target, source)
keggLink(target, source)
target |
Either the name of a single KEGG database (list available via
|
source |
The same as |
Many of the old KEGGSOAP functions whose names
started with 'get', such as get.pathways.by.genes
and
get.pathways.by.reactions
,
are replaced by using keggLink
(see examples).
A named character vector.
Dan Tenenbaum
https://www.kegg.jp/kegg/docs/keggapi.html
res <- keggLink("pathway", "hsa") ## KEGG pathways linked from each of ## the human genes equivalent to 'get.genes.by.pathway' in KEGGSOAP length(res) head(res) res <- keggLink("hsa", "pathway") ## human genes linked from each of the ## KEGG pathways equivalent to 'get.pathways.by.genes' in KEGGSOAP keggLink("pathway", c("hsa:10458", "ece:Z5100")) ## KEGG pathways ## linked from a human gene and an E. coli O157 gene res <- keggLink("hsa:126") ## LinkDB search shows all KEGG ## resources related to hsa:126 head(res)
res <- keggLink("pathway", "hsa") ## KEGG pathways linked from each of ## the human genes equivalent to 'get.genes.by.pathway' in KEGGSOAP length(res) head(res) res <- keggLink("hsa", "pathway") ## human genes linked from each of the ## KEGG pathways equivalent to 'get.pathways.by.genes' in KEGGSOAP keggLink("pathway", c("hsa:10458", "ece:Z5100")) ## KEGG pathways ## linked from a human gene and an E. coli O157 gene res <- keggLink("hsa:126") ## LinkDB search shows all KEGG ## resources related to hsa:126 head(res)
Returns a list of entry identifiers and associated definition for a given database or a given set of database entries.
keggList(database, organism)
keggList(database, organism)
database |
Either a KEGG database (list available via |
organism |
|
A named character vector containing entry identifiers and associated definition.
Dan Tenenbaum
https://www.kegg.jp/kegg/docs/keggapi.html
res <- keggList("pathway") ## returns the list of reference pathways length(res) head(res) res <- keggList("pathway", "hsa") ## returns the list of human pathways length(res) head(res) res <- keggList("organism") ## returns the list of KEGG organisms with ## taxonomic classification nrow(res) head(res) res <- keggList("hsa") ## returns the entire list of human genes length(res) head(res) ## keggList("T01001") ## same as above keggList(c("hsa:10458", "ece:Z5100")) ## returns the list of a human gene ## and an E.coli O157 gene keggList(c("cpd:C01290","gl:G00092")) ## returns the list of a compound entry ## and a glycan entry keggList(c("C01290+G00092")) ## same as above (prefixes are not necessary)
res <- keggList("pathway") ## returns the list of reference pathways length(res) head(res) res <- keggList("pathway", "hsa") ## returns the list of human pathways length(res) head(res) res <- keggList("organism") ## returns the list of KEGG organisms with ## taxonomic classification nrow(res) head(res) res <- keggList("hsa") ## returns the entire list of human genes length(res) head(res) ## keggList("T01001") ## same as above keggList(c("hsa:10458", "ece:Z5100")) ## returns the list of a human gene ## and an E.coli O157 gene keggList(c("cpd:C01290","gl:G00092")) ## returns the list of a compound entry ## and a glycan entry keggList(c("C01290+G00092")) ## same as above (prefixes are not necessary)
Lists the KEGG databases which may be searched. In most cases, you can also use a KEGG organism name or T number (genome identifier) as a database name.
listDatabases()
listDatabases()
A character vector of database names.
Dan Tenenbaum
https://www.kegg.jp/kegg/docs/keggapi.html
listDatabases() res <- keggList("organism") ## list all organisms nrow(res) head(res) res <- keggList("hsa") ## list all human genes length(res) head(res) ## keggList("T01001") ## list all human genes res <- keggList("genome") ## list all genome identifiers length(res) head(res)
listDatabases() res <- keggList("organism") ## list all organisms nrow(res) head(res) res <- keggList("hsa") ## list all human genes length(res) head(res) ## keggList("T01001") ## list all human genes res <- keggList("genome") ## list all genome identifiers length(res) head(res)
Given a KEGG pathway id and a set of KEGG gene ids, the functions return the URL of a KEGG pathway diagram with the elements corresponding to the genes marked by red or specified color
mark.pathway.by.objects(pathway.id, object.id.list) color.pathway.by.objects(pathway.id, object.id.list, fg.color.list, bg.color.list)
mark.pathway.by.objects(pathway.id, object.id.list) color.pathway.by.objects(pathway.id, object.id.list, fg.color.list, bg.color.list)
pathway.id |
|
object.id.list |
|
fg.color.list |
|
bg.color.list |
|
This function only returns the URL of the KEGG pathway diagram. Use
the function browseURL
to view the diagram.
These functions are not part of the KEGG REST API; they are provided
because they existed in KEGGSOAP
and an alternative implementation
was possible.
This function returns a character string for the url
Jianhua Zhang
https://www.kegg.jp/kegg/docs/keggapi.html
url <- mark.pathway.by.objects( "path:eco00260", c("eco:b0002", "eco:c00263") ) if(interactive()){ browseURL(url) } url <- color.pathway.by.objects( "path:eco00260", c("eco:b0002", "eco:c00263"), c("#ff0000", "#00ff00"), c("#ffff00", "yellow") )
url <- mark.pathway.by.objects( "path:eco00260", c("eco:b0002", "eco:c00263") ) if(interactive()){ browseURL(url) } url <- color.pathway.by.objects( "path:eco00260", c("eco:b0002", "eco:c00263"), c("#ff0000", "#00ff00"), c("#ffff00", "yellow") )