### Convert KEGG IDs to NCBI GI Identifiers Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggConv Converts KEGG IDs to NCBI GI (GenInfo) identifiers. This example shows how to map specific KEGG entries to their corresponding NCBI GI numbers. ```r head(keggConv("ncbi-proteinid", c("hsa:10458", "ece:Z5100"))) ## conversion from KEGG ID ## to NCBI GI ``` -------------------------------- ### List KEGG Organisms and Genes Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/listDatabases Use `keggList()` with database names obtained from `listDatabases()` to list organisms, human genes, or genome identifiers. This function requires the KEGGREST package to be installed and loaded. ```r listDatabases() keggList("organism") ## list all organisms keggList("hsa") ## list all human genes keggList("genome") ## list all genome identifiers keggList("T01001") ## list all human genes ``` -------------------------------- ### Retrieve Pathway Image and KGML Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggGet Retrieves a pathway map as an image file and its corresponding KGML document. Requires the 'png' package for writing the image. ```r png <- keggGet("hsa05130", "image") ## retrieves the image file of a ## pathway map t <- tempfile() library(png) writePNG(png, t) ``` ```r keggGet("hsa05130", "kgml") ``` -------------------------------- ### List Entries by Identifier (Prefix Optional) Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggList Retrieves definitions for entries, demonstrating that prefixes are not necessary when providing KEGG identifiers. ```R keggList(c("C01290+G00092")) ``` -------------------------------- ### List Compound and Glycan Entries Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggList Retrieves definitions for a specified compound entry and a glycan entry using their KEGG identifiers. ```R keggList(c("cpd:C01290","gl:G00092")) ``` -------------------------------- ### color.pathway.by.objects Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/mark.pathway.by.objects Generates a URL for a KEGG pathway diagram with specified genes marked using custom foreground and background colors. The function takes a KEGG pathway ID, a list of KEGG gene IDs, and lists of foreground and background colors as input, returning a URL to the pathway diagram with the genes marked with the specified colors. ```APIDOC ## color.pathway.by.objects ### Description Generates a URL for a KEGG pathway diagram with specified genes marked using custom foreground and background colors. The function takes a KEGG pathway ID, a list of KEGG gene IDs, and lists of foreground and background colors as input, returning a URL to the pathway diagram with the genes marked with the specified colors. ### Usage ```R color.pathway.by.objects(pathway.id, object.id.list, fg.color.list, bg.color.list) ``` ### Arguments * **pathway.id** (string) - A character string for a KEGG pathway id (e.g., "path:eco00020"). * **object.id.list** (vector of strings) - A vector of character strings for KEGG gene ids (e.g., "hsa:111"). * **fg.color.list** (vector of strings) - A vector of two character strings for the text and border color (e.g., "#ff0000" or "yellow"). * **bg.color.list** (vector of strings) - A vector of character strings of the same length as `object.id.list` for the background color (e.g., "#ff0000" or "yellow"). ### Value Returns a character string representing the URL of the KEGG pathway diagram. ### Example ```R url <- color.pathway.by.objects("path:eco00260", c("eco:b0002", "eco:c00263"), c("#ff0000", "#00ff00"), c("#ffff00", "yellow")) ``` ``` -------------------------------- ### Display KEGG Database Statistics Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggInfo Use keggInfo with the database name 'kegg' to display the current statistics of the main KEGG database. ```r keggInfo("kegg") ## displays the current statistics of the KEGG database ``` -------------------------------- ### Retrieve Compound and Glycan Entries Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggGet Fetches a compound entry and a glycan entry from the KEGG database using their identifiers. Prefixes can be included or omitted. ```r keggGet(c("cpd:C01290", "gl:G00092")) ## retrieves a compound entry ## and a glycan entry ``` ```r keggGet(c("C01290", "G00092")) ## same as above, without prefixes ``` -------------------------------- ### List KEGG Organisms Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggList Retrieves a list of all KEGG organisms along with their taxonomic classifications. ```R keggList("organism") ``` -------------------------------- ### List Reference Pathways Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggList Retrieves a list of all reference pathways from the KEGG database. ```R keggList("pathway") ``` -------------------------------- ### List KEGG Databases Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/listDatabases Call the `listDatabases()` function to retrieve a character vector of available KEGG database names. ```r listDatabases() ``` -------------------------------- ### Find KEGG Genes by Keywords Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggFind Searches the KEGG 'genes' database for entries matching multiple keywords. Ensure the 'genes' database is accessible. ```R keggFind("genes", c("shiga", "toxin")) ## for keywords "shiga" and "toxin" ``` -------------------------------- ### Display Pathway Entry Statistics Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggInfo Use keggInfo with the database name 'pathway' to display the number of pathway entries, including both reference and organism-specific pathways. ```r keggInfo("pathway") ## displays the number pathway entries including both ## the reference and organism-specific pathways ``` -------------------------------- ### mark.pathway.by.objects Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/mark.pathway.by.objects Generates a URL for a KEGG pathway diagram with specified genes marked. The function takes a KEGG pathway ID and a list of KEGG gene IDs as input and returns a URL to the pathway diagram with the corresponding genes highlighted. ```APIDOC ## mark.pathway.by.objects ### Description Generates a URL for a KEGG pathway diagram with specified genes marked. The function takes a KEGG pathway ID and a list of KEGG gene IDs as input and returns a URL to the pathway diagram with the corresponding genes highlighted. ### Usage ```R mark.pathway.by.objects(pathway.id, object.id.list) ``` ### Arguments * **pathway.id** (string) - A character string for a KEGG pathway id (e.g., "path:eco00020"). * **object.id.list** (vector of strings) - A vector of character strings for KEGG gene ids (e.g., "hsa:111"). ### Value Returns a character string representing the URL of the KEGG pathway diagram. ### Example ```R url <- mark.pathway.by.objects("path:eco00260", c("eco:b0002", "eco:c00263")) if(interactive()){ browseURL(url) } ``` ``` -------------------------------- ### Find KEGG Compounds by Chemical Formula Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggFind Searches the KEGG 'compound' database using a specific chemical formula. The search is a partial match irrespective of atom order. ```R keggFind("compound", "C7H10O5", "formula") ## for chemical formula "C7H10O5" ``` -------------------------------- ### Find KEGG Compounds by Molecular Weight Range Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggFind Searches the KEGG 'compound' database for entries within a range of molecular weights. This is useful for finding compounds with approximate molecular weights. ```R keggFind("compound", 300:310, "mol_weight") ## for 300 =< ## molecular weight =< 310 ``` -------------------------------- ### keggGet Function Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggGet Retrieves specified database entries from KEGG. Users can request entries by KEGG identifiers and specify the output format, such as amino acid sequence, nucleotide sequence, molecular data, image, or KGML. ```APIDOC ## keggGet ### Description Retrieves given database entries from the KEGG database. ### Usage ```R keggGet(dbentries, option = c("aaseq", "ntseq", "mol", "kcf", "image", "kgml")) ``` ### Arguments * **dbentries**: One or more (up to a maximum of 10) KEGG identifiers. * **option**: Optional. Governs the format of the output. Supported options include `aaseq` (amino acid sequence), `ntseq` (nucleotide sequence), `mol` (molecular data), `kcf` (KEGG Chemical Function format), `image` (PNG file object), and `kgml` (KGML document). ### Value A list wrapping a KEGG flat file. The specific object type depends on the `option` argument: `AAStringSet` for `aaseq`, `DNAStringSet` for `ntseq`, a PNG-writable object for `image`, and a KGML document for `kgml`. ### Details This function retrieves entries from the KEGG database for a given set of KEGG identifiers. Note that the KEGG server limits requests to a maximum of 10 entries at once. If more than 10 identifiers are provided, a warning will be issued, and only the first 10 will be processed. ### References http://www.kegg.jp/kegg/docs/keggapi.html ### Examples ```R # Retrieve a compound entry and a glycan entry keggGet(c("cpd:C01290", "gl:G00092")) # Retrieve a human gene entry and an E.coli O157 gene entry keggGet(c("hsa:10458", "ece:Z5100")) # Retrieve amino acid sequences for specified gene entries keggGet(c("hsa:10458", "ece:Z5100"), "aaseq") # Retrieve the image file of a pathway map png_data <- keggGet("hsa05130", "image") # To save the image: # t <- tempfile() # library(png) # writePNG(png_data, t) # Retrieve the KGML document for a pathway map keggGet("hsa05130", "kgml") ``` ``` -------------------------------- ### Find KEGG Compounds by Exact Mass Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggFind Searches the KEGG 'compound' database for entries within a specified exact mass range. The mass is checked by rounding to the same decimal place as the query. ```R keggFind("compound", 174.05, "exact_mass") ## for 174.045 ## =< exact mass < 174.055 ``` -------------------------------- ### Color Genes in KEGG Pathway Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/mark.pathway.by.objects Generates a URL to a KEGG pathway diagram with specified genes marked and colored. Allows custom foreground and background colors for marked elements. Use `browseURL` to view the diagram. ```R url <- color.pathway.by.objects("path:eco00260", c("eco:b0002", "eco:c00263"), c("#ff0000", "#00ff00"), c("#ffff00", "yellow")) ``` -------------------------------- ### keggList Function Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggList Returns a list of entry identifiers and associated definition for a given database or a given set of database entries. It can be used to query pathways, organisms, genes, compounds, and glycans. ```APIDOC ## Function: keggList ### Description Returns a list of entry identifiers and associated definition for a given database or a given set of database entries. ### Arguments - **database**: (string or character vector) - Required. Either a KEGG database (list available via `listDatabases()`), a KEGG organism code, a T number, or a character vector of KEGG identifiers. - **organism**: (string) - Optional. A KEGG organism identifier (list available via `keggList()` with the `organism` argument). ### Value A named character vector containing entry identifiers and associated definition. ### Examples ```R keggList("pathway") ## returns the list of reference pathways keggList("pathway", "hsa") ## returns the list of human pathways keggList("organism") ## returns the list of KEGG organisms with taxonomic classification keggList("hsa") ## returns the entire list of human genes 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) ``` ``` -------------------------------- ### Convert External Identifiers to KEGG Identifiers Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggConv Converts NCBI GeneIDs to KEGG GeneIDs for E. coli. This demonstrates the reverse conversion, mapping external identifiers back to KEGG's internal system. ```r head(keggConv("ncbi-geneid", "eco")) ## opposite direction ``` -------------------------------- ### Find KEGG Genes by Phrase Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggFind Searches the KEGG 'genes' database for entries matching a phrase. This is an alternative to using multiple keywords. ```R keggFind("genes", "shiga toxin") ## for keywords "shiga toxin" ``` -------------------------------- ### Find KEGG Compounds by Partial Chemical Formula Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggFind Searches the KEGG 'compound' database for entries containing specific atomic components in their chemical formula. This is useful for partial formula matching. ```R keggFind("compound", "O5C7", "formula") ## for chemical formula containing ## "O5" and "C7" ``` -------------------------------- ### keggFind Function Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggFind Finds entries with matching query keywords or other query data in a given KEGG database. Supports searching by keywords, exact mass, molecular weight, or chemical formula depending on the database. ```APIDOC ## Function: keggFind ### Description Finds entries with matching query keywords or other query data in a given KEGG database. This function is useful for searching for specific genes, compounds, drugs, and more within the KEGG knowledge base. ### Arguments * **database** (string or character vector) - The name of a single KEGG database (e.g., 'genes', 'compound', 'drug'), a KEGG genome identifier (e.g., 'T01001'), or a KEGG organism code (e.g., 'hsa' for human). Available databases and organism codes can be listed using `listDatabases()` and `keggList('organism')` respectively. * **query** (string or numeric vector) - One or more keywords to search for, or a range of integers representing molecular weights. If the query includes identifiers not known to KEGG, the results will not contain information about those identifiers. * **option** (string, optional) - Specifies the search criteria when the `database` is 'compound' or 'drug'. Can be one of 'formula', 'exact_mass', or 'weight'. - 'formula': Performs a partial match of a chemical formula, irrespective of atom order. - 'exact_mass': Checks the exact mass, rounded to the same decimal place as the query data. - 'mol_weight': Checks the molecular weight. ### Value A named character vector containing the results of the search. ### Examples ```R # Find genes related to 'shiga' and 'toxin' keggFind("genes", c("shiga", "toxin")) # Find genes related to the phrase 'shiga toxin' keggFind("genes", "shiga toxin") # Find compounds with the chemical formula 'C7H10O5' keggFind("compound", "C7H10O5", "formula") # Find compounds with a chemical formula containing 'O5' and 'C7' keggFind("compound", "O5C7", "formula") # Find compounds with an exact mass between 174.045 and 174.055 keggFind("compound", 174.05, "exact_mass") # Find compounds with a molecular weight between 300 and 310 keggFind("compound", 300:310, "mol_weight") ``` ``` -------------------------------- ### Mark Genes in KEGG Pathway Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/mark.pathway.by.objects Generates a URL to a KEGG pathway diagram with specified genes marked. Use `browseURL` to view the diagram. This function is a client-side interface and does not directly interact with the KEGG REST API. ```R url <- mark.pathway.by.objects("path:eco00260", c("eco:b0002", "eco:c00263")) if(interactive()){ browseURL(url) } ``` -------------------------------- ### Find all KEGG resources related to a specific identifier Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggLink Use keggLink to perform a LinkDB search, showing all KEGG resources related to a given identifier, such as 'hsa:126'. ```R keggLink("hsa:126") ## LinkDB search shows all KEGG resources related to hsa:126 ``` -------------------------------- ### Retrieve Amino Acid Sequences Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggGet Fetches amino acid sequences for a human gene and an E. coli gene using the 'aaseq' option. ```r keggGet(c("hsa:10458", "ece:Z5100"), "aaseq") ## retrieves amino acid sequences ## of a human gene and an ## E.coli O157 gene ``` -------------------------------- ### List Human Pathways Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggList Retrieves a list of human-specific pathways from the KEGG database using the 'hsa' organism code. ```R keggList("pathway", "hsa") ``` -------------------------------- ### Find KEGG pathways linked from multiple genes Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggLink Use keggLink to find KEGG pathways linked from a human gene and an E. coli O157 gene. The source argument can accept a vector of KEGG identifiers. ```R keggLink("pathway", c("hsa:10458", "ece:Z5100")) ## KEGG pathways linked from a ## human gene and an E. coli ## O157 gene ``` -------------------------------- ### keggConv Function Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggConv Converts KEGG identifiers to/from outside identifiers. It takes a target and a source argument, where both can be KEGG organism codes, T numbers, or specific external database identifiers. The source can also be a list of KEGG identifiers. ```APIDOC ## keggConv Function ### Description Convert KEGG identifiers to/from outside identifiers. ### Usage ```R keggConv(target, source) ``` ### Arguments * **target**: A KEGG organism code (), T number, or one of the external databases `ncbi-gi`, `ncbi-geneid`, `ncbi-proteinid`, `uniprot`, or (for chemical substance identifiers) `drug`, `compound`, or `glycan`, `pubchem`, or `chebi`. * **source**: Same as `target`, but may also be a list of KEGG identifers representing internal or external names. ### Value A named character vector. ### References http://www.kegg.jp/kegg/docs/keggapi.html ### Examples ```R # conversion from NCBI GeneID to KEGG ID for E. coli genes head(keggConv("eco", "ncbi-geneid")) # opposite direction head(keggConv("ncbi-geneid", "eco")) # 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")) ``` ``` -------------------------------- ### Display Homo sapiens Gene Entry Statistics Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggInfo Use keggInfo with the organism code 'hsa' to display the number of gene entries for the KEGG organism Homo sapiens. ```r keggInfo("hsa") ## displays the number of gene entries for the KEGG organism ## Homo sapiens ``` -------------------------------- ### Convert External Identifiers to KEGG Gene IDs (Unknown Organism) Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggConv Converts NCBI GeneIDs to KEGG Gene IDs when the organism code is not explicitly provided. This is useful for general gene identifier lookups across KEGG. ```r ## conversion from NCBI GI to KEGG ID when the organism code is not known: head(keggConv("genes", "ncbi-geneid:3113320")) ``` -------------------------------- ### List Entries by T Number Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggList Retrieves entries associated with a specific T number, equivalent to querying by organism code. ```R keggList("T01001") ``` -------------------------------- ### Find KEGG pathways linked from human genes Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggLink Use keggLink to find KEGG pathways associated with human genes. This is equivalent to the 'get.genes.by.pathway' function in KEGGSOAP. ```R keggLink("pathway", "hsa") ## KEGG pathways linked from each of the human genes ## equivalent to 'get.genes.by.pathway' in KEGGSOAP ``` -------------------------------- ### List Specific Gene Entries Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggList Retrieves definitions for a specified human gene and an E. coli O157 gene using their KEGG identifiers. ```R keggList(c("hsa:10458", "ece:Z5100")) ``` -------------------------------- ### Retrieve Gene Entries Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggGet Retrieves gene entries from KEGG for a human gene and an E. coli gene. Identifiers can include species prefixes. ```r keggGet(c("hsa:10458", "ece:Z5100")) ## retrieves a human gene entry ## and an E.coli O157 gene entry ``` -------------------------------- ### List Human Genes Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggList Retrieves the entire list of human genes from the KEGG database using the 'hsa' identifier. ```R keggList("hsa") ``` -------------------------------- ### Convert KEGG Identifiers to External Identifiers Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggConv Converts KEGG GeneIDs to NCBI GeneIDs for E. coli. This is useful for mapping KEGG gene entries to their corresponding NCBI Gene identifiers. ```r head(keggConv("eco", "ncbi-geneid")) ## conversion from NCBI GeneID to ## KEGG ID for E. coli genes ``` -------------------------------- ### keggLink Function Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggLink Finds related KEGG entries by using database cross-references. This function replaces several older KEGGSOAP functions for linking entries between different KEGG databases. ```APIDOC ## Function: keggLink ### Description Finds related entries by using database cross-references. This function is a versatile tool for exploring connections between different KEGG databases and entries. ### Signature ``` keggLink(target, source) ``` ### Arguments - **target**: Specifies the target KEGG database, a "T number" genome identifier, or a KEGG organism code. Available databases can be listed using `listDatabases()`, and organism codes via `keggList("organism")`. - **source**: Similar to `target`, but can also accept one or more KEGG identifiers. ### Value A named character vector containing the linked entries. ### Details This function serves as a replacement for older KEGGSOAP functions like `get.pathways.by.genes` and `get.pathways.by.reactions`. ### Examples ```R # Find KEGG pathways linked from each of the human genes keggLink("pathway", "hsa") # Find human genes linked from each of the KEGG pathways keggLink("hsa", "pathway") # Find KEGG pathways linked from a human gene and an E. coli O157 gene keggLink("pathway", c("hsa:10458", "ece:Z5100")) # Show all KEGG resources related to a specific human gene keggLink("hsa:126") ``` ``` -------------------------------- ### Find human genes linked from KEGG pathways Source: https://www.rdocumentation.org/packages/KEGGREST/versions/1.12.2/topics/keggLink Use keggLink to find human genes associated with KEGG pathways. This is equivalent to the 'get.pathways.by.genes' function in KEGGSOAP. ```R keggLink("hsa", "pathway") ## human genes linked from each of the KEGG pathways ## equivalent to 'get.pathways.by.genes' in KEGGSOAP ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.