### Environment-like Access for Bimap Objects Source: https://context7.com/bioconductor/annotationdbi/llms.txt Bimap objects support environment-like access methods including ls(), exists(), get(), and mget() for listing keys, checking existence, and retrieving values. Double-bracket and dollar sign access are also supported. ```r library(org.Hs.eg.db) # List keys (like ls on environment) all_keys <- ls(org.Hs.egSYMBOL) head(all_keys) # Pattern matching brca_keys <- ls(org.Hs.egSYMBOL, pattern = "^67") # Check if key exists exists("1", org.Hs.egSYMBOL) # TRUE exists("invalid", org.Hs.egSYMBOL) # FALSE # Get single value symbol <- get("1", org.Hs.egSYMBOL) # "A1BG" # Get multiple values symbols <- mget(c("1", "2", "10"), org.Hs.egSYMBOL) # Returns list: list("1" = "A1BG", "2" = "A2M", "10" = "NAT2") # Handle missing keys symbols <- mget(c("1", "invalid"), org.Hs.egSYMBOL, ifnotfound = NA) # Double-bracket access org.Hs.egSYMBOL[["1"]] # "A1BG" # Dollar sign access org.Hs.egSYMBOL$`1` # "A1BG" ``` -------------------------------- ### select() for ChipDb: Probe ID to Gene Info Source: https://context7.com/bioconductor/annotationdbi/llms.txt Example using `select()` with a chip database (`hgu95av2.db`) to map probe IDs to gene information such as symbol, Entrez ID, and gene name. Requires loading the specific chip package. ```r library(hgu95av2.db) probes <- head(keys(hgu95av2.db, keytype = "PROBEID")) probe_info <- select(hgu95av2.db, keys = probes, columns = c("SYMBOL", "ENTREZID", "GENENAME"), keytype = "PROBEID") ``` -------------------------------- ### mapIds() with Custom Function for Multi-Value Selection Source: https://context7.com/bioconductor/annotationdbi/llms.txt Apply a custom function to handle multiple values returned by `mapIds()`. This example defines a function `last_match` to select the last value from a list of matches. ```r library(org.Hs.eg.db) # Custom function to select last match last_match <- function(x) x[[length(x)]] result <- mapIds(org.Hs.eg.db, keys = genes, column = "ALIAS", keytype = "ENTREZID", multiVals = last_match) ``` -------------------------------- ### Convert Bimap to Data Frame with toTable() Source: https://context7.com/bioconductor/annotationdbi/llms.txt The toTable() method converts a Bimap object to a data frame, displaying all links between keys and values. You can also get dimensions and column names, or a subset table. ```r library(org.Hs.eg.db) # Convert bimap to table go_table <- toTable(org.Hs.egGO) head(go_table) # gene_id go_id Evidence Ontology # 1 1 GO:0002576 TAS BP # 2 1 GO:0003674 ND MF # 3 1 GO:0005576 IDA CC # Get dimensions nrow(org.Hs.egGO) # Number of mappings col(org.Hs.egGO) # Number of columns # Get column names colnames(org.Hs.egGO) # "gene_id" "go_id" "Evidence" "Ontology" # Get subset table subset_table <- toTable(org.Hs.egGO["1"]) ``` -------------------------------- ### List Columns for GO Database Source: https://context7.com/bioconductor/annotationdbi/llms.txt Demonstrates using `columns()` with the `GO.db` package to list the available data fields specific to Gene Ontology annotations. ```r library(GO.db) # List columns for GO database columns(GO.db) # Returns: "DEFINITION" "GOID" "ONTOLOGY" "TERM" ``` -------------------------------- ### List Columns for Chip Database Source: https://context7.com/bioconductor/annotationdbi/llms.txt Shows how to use `columns()` with a chip database (e.g., `hgu95av2.db`) to list all available annotation columns, including chip-specific ones like 'PROBEID'. ```r library(hgu95av2.db) columns(hgu95av2.db) # Returns all above plus "PROBEID" ``` -------------------------------- ### Apply functions to Bimap entries Source: https://context7.com/bioconductor/annotationdbi/llms.txt Demonstrates applying functions to all entries and sampling from a Bimap. ```r # Apply function to all entries lengths <- eapply(org.Hs.egGO, length) # Random sample sample_mappings <- sample(org.Hs.egSYMBOL, 5) ``` -------------------------------- ### Access Database Metadata with metadata() Source: https://context7.com/bioconductor/annotationdbi/llms.txt The metadata() method returns information about the annotation database, such as version, organism, and creation date. Use species() and taxonomyId() for specific details. ```r library(org.Hs.eg.db) # Get metadata as data frame meta <- metadata(org.Hs.eg.db) head(meta) # name value # 1 DBSCHEMAVERSION 2.1 # 2 ORGANISM Homo sapiens # 3 SPECIES Human # 4 DBSCHEMA HUMAN_DB # 5 CENTRALID EG # ... # Get species information species(org.Hs.eg.db) # "Homo sapiens" # Get taxonomy ID taxonomyId(org.Hs.eg.db) # 9606 ``` -------------------------------- ### loadDb() - Load Annotation Database Source: https://context7.com/bioconductor/annotationdbi/llms.txt Loads a SQLite annotation database from a file path and returns an appropriate AnnotationDb object. ```APIDOC ## loadDb(file) ### Description Loads a standalone SQLite database file and returns an AnnotationDb object (OrgDb, ChipDb, TxDb, or GODb). ### Parameters - **file** (character) - Required - The path to the SQLite database file. ### Request Example db <- loadDb("/path/to/annotation.sqlite") ``` -------------------------------- ### Create custom Bimaps Source: https://context7.com/bioconductor/annotationdbi/llms.txt Template for creating a simple bidirectional map from a database table. ```r library(AnnotationDbi) # Create a simple bimap from a database table # (Requires an existing database connection) # simple_map <- createSimpleBimap( # tablename = "gene2symbol", # Lcolname = "gene_id", # Rcolname = "symbol", # datacache = datacache_object, # objName = "SYMBOL", # objTarget = "org.Hs.eg.db" # ) ``` -------------------------------- ### GO Ontology (full label) Source: https://github.com/bioconductor/annotationdbi/blob/devel/inst/DBschemas/schemas_2.1/DataTypes.txt Describes the full label for GO ontology terms. ```APIDOC ## GO Ontology (full label) ### Description Provides the full textual label for Gene Ontology (GO) terms. ### SQL Type VARCHAR(18) ### Possible Values - 'universal' - 'biological_process' - 'cellular_component' - 'molecular_function' ``` -------------------------------- ### Analyze mapping structure and coverage Source: https://context7.com/bioconductor/annotationdbi/llms.txt Use links() and nhit() to inspect mapping edges and hit counts. ```r library(org.Hs.eg.db) # Get links (mapping edges) without attributes link_table <- links(org.Hs.egGO) head(link_table) # gene_id go_id # 1 1 GO:0002576 # 2 1 GO:0003674 # Count total links count.links(org.Hs.egGO) # Get hit counts per key hits <- nhit(org.Hs.egGO) head(hits) # 1 2 10 100 # 42 37 12 28 # Find keys with most hits names(hits)[hits == max(hits)] # Analyze coverage sum(hits == 0) # Keys with no mappings table(hits) # Distribution of hit counts ``` -------------------------------- ### Create custom GO and KEGG annotation frames Source: https://context7.com/bioconductor/annotationdbi/llms.txt Construct GOFrame and KEGGFrame objects for gene set analysis. ```r library(AnnotationDbi) library(GO.db) # Create GOFrame from custom data go_data <- data.frame( go_id = c("GO:0008150", "GO:0008150", "GO:0003674"), evidence = c("IEA", "TAS", "IDA"), gene_id = c("1", "2", "1"), stringsAsFactors = FALSE ) go_frame <- GOFrame(go_data, organism = "Homo sapiens") # Access frame data getGOFrameData(go_frame) # Create GOAllFrame (includes ancestor terms) go_all_frame <- GOAllFrame(go_frame) getGOFrameData(go_all_frame) # Create KEGGFrame kegg_data <- data.frame( path_id = c("hsa04110", "hsa04110", "hsa04115"), gene_id = c("1", "2", "1"), stringsAsFactors = FALSE ) kegg_frame <- KEGGFrame(kegg_data, organism = "Homo sapiens") getKEGGFrameData(kegg_frame) # Get available KEGG organisms organisms <- organismKEGGFrame() head(organisms) ``` -------------------------------- ### Work with GOTerms objects Source: https://context7.com/bioconductor/annotationdbi/llms.txt Create and access Gene Ontology term objects and query GO.db directly. ```r library(GO.db) # Create a GOTerms object go_term <- new("GOTerms", GOID = "GO:0008150", Term = "biological_process", Ontology = "BP", Definition = "A biological process is...") # Access slots GOID(go_term) # "GO:0008150" Term(go_term) # "biological_process" Ontology(go_term) # "BP" Definition(go_term) # The definition text # Work with GO.db directly go_ids <- c("GO:0008150", "GO:0003674", "GO:0005575") # Get terms for GO IDs Term(go_ids) # GO:0008150 GO:0003674 GO:0005575 # "biological_process" "molecular_function" "cellular_component" # Get ontology categories Ontology(go_ids) # "BP" "MF" "CC" # Get definitions Definition(go_ids) # Access GO term bimap goterms <- as.list(GOTERM[go_ids]) ``` -------------------------------- ### select() with Different Keytype (SYMBOL) Source: https://context7.com/bioconductor/annotationdbi/llms.txt Demonstrates using `select()` with `org.Hs.eg.db` to query annotation data using gene symbols as keys. Note that the 'GO' column can result in a one-to-many mapping, expanding the output rows. ```r library(org.Hs.eg.db) # Select with different keytype: lookup by gene symbol symbols <- c("BRCA1", "BRCA2", "TP53") result <- select(org.Hs.eg.db, keys = symbols, columns = c("ENTREZID", "GENENAME", "GO", "ENSEMBL"), keytype = "SYMBOL") # Note: GO column creates 1:many mapping, expanding rows ``` -------------------------------- ### List Valid Key Types for Annotation Query Source: https://context7.com/bioconductor/annotationdbi/llms.txt Use the `keytypes()` function with an organism database (e.g., `org.Hs.eg.db`) to identify all valid identifier types that can be used as keys in `select()` and `keys()` queries. ```r library(org.Hs.eg.db) # List valid keytypes keytypes(org.Hs.eg.db) # Returns: "ACCNUM" "ALIAS" "ENSEMBL" "ENSEMBLPROT" "ENSEMBLTRANS" # "ENTREZID" "ENZYME" "EVIDENCE" "EVIDENCEALL" "GENENAME" ``` -------------------------------- ### List Columns for Organism Database Source: https://context7.com/bioconductor/annotationdbi/llms.txt Use the `columns()` function with an organism database (e.g., `org.Hs.eg.db`) to retrieve a list of all available data columns that can be queried. ```r library(org.Hs.eg.db) # List columns for organism database columns(org.Hs.eg.db) # Returns: "ACCNUM" "ALIAS" "ENSEMBL" "ENSEMBLPROT" "ENSEMBLTRANS" # "ENTREZID" "ENZYME" "EVIDENCE" "EVIDENCEALL" "GENENAME" # "GENETYPE" "GO" "GOALL" "MAP" "OMIM" "ONTOLOGY" "ONTOLOGYALL" # "PATH" "PFAM" "PMID" "PROSITE" "REFSEQ" "SYMBOL" "UCSCKG" "UNIPROT" ``` -------------------------------- ### Load Annotation Database with loadDb() Source: https://context7.com/bioconductor/annotationdbi/llms.txt The loadDb() function loads a SQLite annotation database from a file path. The returned object type depends on the database metadata (OrgDb, ChipDb, TxDb, GODb). ```r library(AnnotationDbi) # Load a standalone SQLite database db <- loadDb("/path/to/annotation.sqlite") # Access connection and file info dbconn(db) # Get the database connection dbfile(db) # Get the path to the SQLite file ``` -------------------------------- ### Metadata Discovery Methods Source: https://context7.com/bioconductor/annotationdbi/llms.txt Methods to list available data columns and valid key types for a given annotation database. ```APIDOC ## columns(x) ### Description Returns all available data types that can be retrieved from an annotation database. ## keytypes(x) ### Description Returns the types of identifiers that can be used as keys in select() and keys() queries. ### Parameters - **x** (Object) - Required - The annotation database object. ``` -------------------------------- ### keys() - Retrieve Available Keys Source: https://context7.com/bioconductor/annotationdbi/llms.txt Retrieves all valid keys of a specified keytype from an annotation database, with support for pattern filtering and column-based constraints. ```APIDOC ## keys(x, keytype, pattern, column, fuzzy) ### Description Returns all valid keys of a specified keytype, with optional filtering by pattern or column. ### Parameters - **x** (AnnotationDb) - Required - The annotation database object. - **keytype** (character) - Optional - The type of key to retrieve (e.g., "SYMBOL", "ENTREZID"). - **pattern** (character) - Optional - A regular expression pattern to filter keys. - **column** (character) - Optional - A column to filter by existence of values. - **fuzzy** (logical) - Optional - Whether to use fuzzy matching for the pattern. ### Request Example keys(org.Hs.eg.db, keytype = "SYMBOL", pattern = "BRCA") ``` -------------------------------- ### GO Term Textual Label Source: https://github.com/bioconductor/annotationdbi/blob/devel/inst/DBschemas/schemas_2.1/DataTypes.txt Information about the textual representation of GO terms. ```APIDOC ## Textual label for the GO term ### Description Provides the human-readable textual label for a Gene Ontology (GO) term. ### SQL Type VARCHAR(255) ### Examples - 'larval fat body development' - 'age-dependent response to reactive oxygen species during chronological cell aging' ### Note The maximum observed length for this field is 193 characters. ``` -------------------------------- ### Manage Bimap keys and mapping direction Source: https://context7.com/bioconductor/annotationdbi/llms.txt Methods for accessing source/target keys, filtering mapped entries, and reversing mapping direction. ```r library(org.Hs.eg.db) # Get left keys (source identifiers) lkeys <- Lkeys(org.Hs.egSYMBOL) head(lkeys) # Entrez Gene IDs # Get right keys (target identifiers) rkeys <- Rkeys(org.Hs.egSYMBOL) head(rkeys) # Gene Symbols # Get mapped keys only mapped <- mappedkeys(org.Hs.egGO) # Count mapped keys count.mappedkeys(org.Hs.egGO) # Get mapping direction direction(org.Hs.egSYMBOL) # 1 (L --> R) # Reverse the mapping rev_map <- revmap(org.Hs.egSYMBOL) direction(rev_map) # -1 (L <-- R) # Now left keys are symbols Lkeys(rev_map)[1:5] # Gene symbols # Subset bimap subset_map <- org.Hs.egSYMBOL[c("1", "2", "10")] ``` -------------------------------- ### GO Term Textual Definition Source: https://github.com/bioconductor/annotationdbi/blob/devel/inst/DBschemas/schemas_2.1/DataTypes.txt Details on the textual definition of GO terms. ```APIDOC ## Textual definition for the GO term ### Description Provides the detailed textual definition for a Gene Ontology (GO) term. ### SQL Type TEXT ### Note This field can contain text of any length. ``` -------------------------------- ### Retrieve Available Keys with keys() Source: https://context7.com/bioconductor/annotationdbi/llms.txt Use the keys() method to retrieve valid keys from an AnnotationDb object. You can specify the keytype and filter by pattern or column values. Fuzzy matching is also supported. ```r library(org.Hs.eg.db) # Get all Entrez Gene IDs (default keytype) all_genes <- keys(org.Hs.eg.db) length(all_genes) # Thousands of gene IDs # Get keys of a specific type symbols <- keys(org.Hs.eg.db, keytype = "SYMBOL") head(symbols) # Gene symbols # Filter keys by pattern brca_genes <- keys(org.Hs.eg.db, keytype = "SYMBOL", pattern = "BRCA") # Returns: "BRCA1" "BRCA2" "BRCA1P1" etc. # Filter by pattern with fuzzy matching fuzzy_match <- keys(org.Hs.eg.db, keytype = "SYMBOL", pattern = "BRCA", fuzzy = TRUE) # Get keys where a specific column has values genes_with_pathway <- keys(org.Hs.eg.db, keytype = "ENTREZID", column = "PATH") # Combine pattern and column filtering tp53_genes <- keys(org.Hs.eg.db, keytype = "ENTREZID", pattern = "TP53", column = "SYMBOL") ``` -------------------------------- ### Basic select() for Gene Symbols and Names Source: https://context7.com/bioconductor/annotationdbi/llms.txt Use `select()` with `org.Hs.eg.db` to retrieve gene symbols and full names for a list of Entrez IDs. This demonstrates a basic query returning a data frame. ```r library(org.Hs.eg.db) # Basic select: get gene symbols and names for Entrez IDs keys <- c("1", "2", "3", "10") result <- select(org.Hs.eg.db, keys = keys, columns = c("SYMBOL", "GENENAME"), keytype = "ENTREZID") # Returns: # ENTREZID SYMBOL GENENAME # 1 1 A1BG alpha-1-B glycoprotein # 2 2 A2M alpha-2-macroglobulin # 3 3 A2MP1 alpha-2-macroglobulin pseudogene 1 # 4 10 NAT2 N-acetyltransferase 2 ``` -------------------------------- ### mapIds() Handling Multiple Values as List Source: https://context7.com/bioconductor/annotationdbi/llms.txt Demonstrates using `mapIds()` with `multiVals = "list"` to retrieve all matches for a given key when multiple values exist in the specified column. ```r library(org.Hs.eg.db) # Handle multiple values: return as list alias <- mapIds(org.Hs.eg.db, keys = genes, column = "ALIAS", keytype = "ENTREZID", multiVals = "list") ``` -------------------------------- ### GO Child-Parent Relationship Type Source: https://github.com/bioconductor/annotationdbi/blob/devel/inst/DBschemas/schemas_2.1/DataTypes.txt Describes the types of relationships between GO terms. ```APIDOC ## Type of GO child-parent relationship ### Description Specifies the type of relationship between a child GO term and its parent GO term. ### SQL Type VARCHAR(7) ### Possible Values - 'isa' - 'part_of' ``` -------------------------------- ### select() - Extract Annotation Data Source: https://context7.com/bioconductor/annotationdbi/llms.txt Retrieves annotation data as a data frame based on specified keys, columns, and keytype. ```APIDOC ## select(x, keys, columns, keytype) ### Description Retrieves annotation data based on specified keys, columns, and keytype. Returns a data frame with one row per match, expanding rows for one-to-many relationships. ### Parameters - **x** (Object) - Required - The annotation database object (e.g., OrgDb, ChipDb). - **keys** (Character vector) - Required - The identifiers to query. - **columns** (Character vector) - Required - The columns to return. - **keytype** (String) - Required - The type of identifier provided in keys. ### Response - **data.frame** - A data frame containing the requested columns for the provided keys. ``` -------------------------------- ### toTable() - Convert Bimap to Data Frame Source: https://context7.com/bioconductor/annotationdbi/llms.txt Converts a legacy Bimap object to a data frame representation showing all links between keys and values. ```APIDOC ## toTable(x) ### Description Converts a Bimap object to a data frame showing all mappings. ### Parameters - **x** (Bimap) - Required - The Bimap object to convert. ### Request Example go_table <- toTable(org.Hs.egGO) ``` -------------------------------- ### metadata() - Access Database Metadata Source: https://context7.com/bioconductor/annotationdbi/llms.txt Retrieves metadata information about the annotation database, such as version, organism, and creation date. ```APIDOC ## metadata(x) ### Description Returns a data frame containing database metadata including version, source, and creation date. ### Parameters - **x** (AnnotationDb) - Required - The annotation database object. ### Request Example meta <- metadata(org.Hs.eg.db) ``` -------------------------------- ### GO Evidence Code Source: https://github.com/bioconductor/annotationdbi/blob/devel/inst/DBschemas/schemas_2.1/DataTypes.txt Reference for GO evidence codes used to indicate the basis for a GO annotation. ```APIDOC ## GO evidence code ### Description Indicates the type of evidence supporting a Gene Ontology (GO) annotation. ### SQL Type CHAR(3) ### Possible Values - 'IC' - 'IDA' - 'IEA' - 'IEP' - 'IGC' - 'IGI' - 'IMP' - 'IPI' - 'ISS' - 'NAS' - 'ND' - 'RCA' - 'TAS' - 'NR' ### Note Refer to http://www.geneontology.org/GO.evidence.shtml for the meaning of each code. ``` -------------------------------- ### Genomic Location and Ontology Fields Source: https://github.com/bioconductor/annotationdbi/blob/devel/inst/DBschemas/schemas_2.1/DataTypes.txt Details for cytoband locations and Gene Ontology (GO) terms. ```APIDOC ## Genomic Location and Ontology Fields ### Cytoband location - **SQL type**: VARCHAR(20) - **Examples**: '1p34.2', 'Yp11.32', '19q13.11-q13.12' - **Note**: the maximum length observed so far is 15 but using VARCHAR(20) is a safety precaution for longer cytoband locations that could appear in the future ### GO ontology (short label) - **SQL type**: VARCHAR(9) - **Possible values**: 'universal', 'BP', 'CC', 'MF' ``` -------------------------------- ### Convert Bimap to Named List with as.list() Source: https://context7.com/bioconductor/annotationdbi/llms.txt Convert a Bimap object to a named list for easy programmatic access to mappings. You can convert all mappings or a subset, and use revmap for reverse lookups. ```r library(org.Hs.eg.db) # Convert to list (all mappings) symbol_list <- as.list(org.Hs.egSYMBOL) symbol_list[["1"]] # "A1BG" symbol_list[["10"]] # "NAT2" # Convert subset to list subset_list <- as.list(org.Hs.egSYMBOL[c("1", "2", "10")]) # Use revmap for reverse lookup symbol2eg <- revmap(org.Hs.egSYMBOL) eg_list <- as.list(symbol2eg) eg_list[["BRCA1"]] # "672" ``` -------------------------------- ### KEGG Pathway Short ID Source: https://github.com/bioconductor/annotationdbi/blob/devel/inst/DBschemas/schemas_2.1/DataTypes.txt Information on the short identifier for KEGG pathways. ```APIDOC ## KEGG pathway short ID ### Description Provides the short identifier for a KEGG pathway. ### SQL Type CHAR(5) ### Examples - '00100' - '05223' - '07218' ### Note The highest observed value for this ID is 07218. ``` -------------------------------- ### Enzyme and Pathway Fields Source: https://github.com/bioconductor/annotationdbi/blob/devel/inst/DBschemas/schemas_2.1/DataTypes.txt Details for enzyme commission (EC) numbers and pathway names. ```APIDOC ## Enzyme and Pathway Fields ### EC number (no "EC:" prefix) - **SQL type**: VARCHAR(13) - **Examples**: '1.1.4.1', '3.2.1.14', '1.14.99.36' - **Note**: the maximum length observed so far is 10 but using VARCHAR(13) is a safety precaution for longer EC numbers that could appear in the future ### EC number (with "EC:" prefix) - **SQL type**: VARCHAR(16) - **Examples**: 'EC:1.1.4.1', 'EC:3.2.1.14', 'EC:1.14.99.36' ### EC name - **SQL type**: VARCHAR(255) - **Examples**: 'lipase', 'photosystem I', '6-phosphofructokinase' - **Note**: the maximum length observed so far is 99 ### AraCyc pathway name - **SQL type**: VARCHAR(255) - **Examples**: 'SAM cycle', 'trans,trans-farnesyl diphosphate biosynthesis' - **Note**: the maximum length observed so far is 77 but using VARCHAR(255) is a safety precaution for longer AraCyc pathways that could appear in the future ``` -------------------------------- ### KEGG Pathway Name Source: https://github.com/bioconductor/annotationdbi/blob/devel/inst/DBschemas/schemas_2.1/DataTypes.txt Information about the common name for KEGG pathways. ```APIDOC ## KEGG pathway name ### Description Provides the common name for a KEGG pathway. ### SQL Type VARCHAR(80) ### Examples - 'Butanoate metabolism' - '3-Chloroacrylic acid degradation' ### Note The maximum observed length for this field is 63 characters. ``` -------------------------------- ### Save Annotation Database with saveDb() Source: https://context7.com/bioconductor/annotationdbi/llms.txt The saveDb() method saves an AnnotationDb object to a new SQLite file. This is useful for creating portable annotation snapshots. ```r library(org.Hs.eg.db) # Save database to a new file saveDb(org.Hs.eg.db, file = "my_annotation_copy.sqlite") ``` -------------------------------- ### Supported Biological Identifiers Source: https://github.com/bioconductor/annotationdbi/blob/devel/inst/DBschemas/schemas_2.1/DataTypes.txt A list of biological identifiers and their associated database information. ```APIDOC ## Supported Biological Identifiers This section details the various biological identifiers supported, including their SQL data types, example values, and any relevant notes. ### AC ID * **SQL type**: VARCHAR(12) * **Examples**: 'PF00389.21', 'PF02826.10', 'P63103.1' * **Note**: Central ID for PFAM. ### CAZY ID * **SQL type**: VARCHAR(6) * **Examples**: 'GT_57', 'GH_29', 'CBM_19' ### HOMSTRAD ID * **SQL type**: VARCHAR(20) * **Examples**: 'Dala_Dala_ligas_N', 'A2M_B', 'Haloperoxidase' ### INTERPRO ID * **SQL type**: VARCHAR(9) * **Examples**: 'IPR003391', 'IPR002612', 'IPR005830' ### LOAD ID * **SQL type**: VARCHAR(15) * **Examples**: 'Adrenomedullin', 'Adeno_PIX', 'BCMA-Tall_bind' ### MEROPS ID * **SQL type**: VARCHAR(3) * **Examples**: 'S10', 'M55', 'T1' ### MIM ID * **SQL type**: VARCHAR(6) * **Examples**: '104311', '128230', '222600' ### PDB ID * **SQL type**: VARCHAR(6) * **Examples**: '1u69 B', '1odn A', '2kfn A' ### start of alignment * **SQL type**: INTEGER * **Examples**: '3', '180', '256' ### end of alignment * **SQL type**: INTEGER * **Examples**: '288', '224', '334' ### PFAMB ID * **SQL type**: VARCHAR(8) * **Examples**: 'PB012689', 'PB177858', 'PB176422' * **Note**: Machine called PFAM IDs. ### PRINTS ID * **SQL type**: VARCHAR(7) * **Examples**: 'PR00178', 'PR01233', 'PR00543' ### PROSITE ID * **SQL type**: VARCHAR(9) * **Examples**: 'PDOC00403', 'PDOC00174', 'PDOC00578' ### PROSITE_PROFILE ID * **SQL type**: VARCHAR(7) * **Examples**: 'PS50032', 'PS50203', 'PS50119' ### RM ID * **SQL type**: VARCHAR(8) * **Examples**: '11011151', '2254264', '15531590' ### SCOP ID * **SQL type**: VARCHAR(4) * **Examples**: '1rla', '1by6', '3gcc' ### SCOP placement * **SQL type**: VARCHAR(2) * **Examples**: 'fa', 'fa', 'sf' * **Note**: Only 'fa' and 'sf' are observed. ### SMART ID * **SQL type**: VARCHAR(9) * **Examples**: 'ZnF_UBR1', 'RasGEFN', 'PLDc' ### TC ID * **SQL type**: VARCHAR(6) * **Examples**: '3.A.15', '9.B.33', '2.A.27' ### PFAM ID ID * **SQL type**: VARCHAR(15) * **Examples**: 'ADP_ribosyl_GH', 'Adeno_E1B_55K_N', 'AfaD' ### DE ID * **SQL type**: VARCHAR(80) * **Examples**: 'Adenovirus GP19K', 'ADP-specific Phosphofructokinase/Glucokinase conserved region' * **Note**: Description field, can be large. ### TP ID * **SQL type**: VARCHAR(6) * **Examples**: 'Repeat', 'Family', 'Domain', 'Motif' * **Note**: Limited to these four values. ### URL ID * **SQL type**: VARCHAR(80) * **Examples**: 'http://bioinformatics.weizmann.ac.il/hotmolecbase/entries/ps1.htm' ### Inparanoid ID * **SQL type**: VARCHAR(30) * **Examples**: 'ENSP00000351750', 'FBpp0073215', 'MGI:1274784' * **Note**: Corresponds to a gene or protein ID. ### Inparanoid Cluster ID * **SQL type**: INTEGER * **Examples**: '1', '2', '34' * **Note**: Groupings assigned by Inparanoid algorithm. ### Inparanoid Species ID * **SQL type**: VARCHAR(15) * **Examples**: 'ensHOMSA.fa', 'modMUSMU.fa', 'modDROME.fa' * **Note**: Indicates species, ID type, and table source. ### Inparanoid Score * **SQL type**: VARCHAR(20) * **Examples**: '1.0', '0.1513', '0.3578' * **Note**: Degree of belonging to the Inparanoid grouping. ### Inparanoid Seed Status * **SQL type**: VARCHAR(4) * **Examples**: '100%', '', '99%' * **Note**: 0-100%, '100%' indicates a seed paralog. ### Entrez Gene ID * **SQL type**: VARCHAR(10) * **Examples**: '10251', '283297', '100113407' ### Ensembl Gene ID * **SQL type**: VARCHAR(20) * **Examples**: 'ENSRNOG00000016924', 'ENSMUSG00000028125', 'ENSG00000127837' ### Ensembl Protein ID * **SQL type**: VARCHAR(20) * **Examples**: 'ENSP00000370606', 'ENSRNOP00000027' * **Note**: One peptide per ID. ### manufacturer ID * **SQL type**: VARCHAR(80) * **Examples**: '1000_at', '1002_f_at', 'AFFX-HUMISGF3A/M97935_MA_at' ### GenBank accession number * **SQL type**: VARCHAR(20) ``` -------------------------------- ### Gene and Sequence Information Fields Source: https://github.com/bioconductor/annotationdbi/blob/devel/inst/DBschemas/schemas_2.1/DataTypes.txt Details for fields related to gene symbols, aliases, sequence names, and chromosome information. ```APIDOC ## Gene and Sequence Information Fields ### Gene symbol or alias - **SQL type**: VARCHAR(80) - **Examples**: 'NPEPPS', 'myr4', 'DKFZp434G0625PRO34003' - **Note**: the maximum length observed so far is 21 but using VARCHAR(80) is a safety precaution for longer aliases that could appear in the future ### Sequence name - **SQL type**: VARCHAR(20) - **Examples**: '1', '22', 'X', 'Y', '6_cox_hap1', '22_random' ### Chromosome name - **SQL type**: VARCHAR(2) - **Examples**: '1', '22', 'X', 'Y', 'M', 'MT', 'Un' - **Note**: a chromosome name is a particular sequence name ### Gene name - **SQL type**: VARCHAR(255) - **Examples**: 'deoxyribonuclease I-like 1', 'vitrin' - **Note**: the maximum length observed so far is 251 ### Yeast gene name - **SQL type**: VARCHAR(14) - **Examples**: 'ADK2', 'TMA23', '21S_RRNA_4', 'MF(ALPHA)1' - **Note**: the maximum length observed so far is 10 but using VARCHAR(14) is a safety precaution for longer Yeast gene names that could appear in the future ### Yeast gene alias - **SQL type**: VARCHAR(13) - **Examples**: 'CDH1', 'DNA33', 'EF-1 alpha', 'ATPEPSILON' - **Note**: the maximum length observed so far is 10 but using VARCHAR(13) is a safety precaution for longer Yeast gene aliases that could appear in the future ### Arabidopsis chromosome - **SQL type**: CHAR(1) - **Possible values**: '1', '2', '3', '4', '5', 'C', 'M' ``` -------------------------------- ### mapIds() Handling Multiple Values as CharacterList Source: https://context7.com/bioconductor/annotationdbi/llms.txt Use `mapIds()` with `multiVals = "CharacterList"` to retrieve all matches for a given key, returning the results as a `CharacterList` object. ```r library(org.Hs.eg.db) # Handle multiple values: return CharacterList go_terms <- mapIds(org.Hs.eg.db, keys = genes, column = "GO", keytype = "ENTREZID", multiVals = "CharacterList") ``` -------------------------------- ### Basic mapIds() for Gene Symbols Source: https://context7.com/bioconductor/annotationdbi/llms.txt Use `mapIds()` with `org.Hs.eg.db` to retrieve a single column of annotation data (e.g., 'SYMBOL') as a named character vector. By default, it returns the first match if multiple exist. ```r library(org.Hs.eg.db) # Basic mapIds: get first match (default) genes <- c("1", "2", "10", "100") symbols <- mapIds(org.Hs.eg.db, keys = genes, column = "SYMBOL", keytype = "ENTREZID") # Returns named character vector: # c("1" = "A1BG", "2" = "A2M", "10" = "NAT2", "100" = "ADA") ``` -------------------------------- ### mapIds() Handling Multiple Values as NA Source: https://context7.com/bioconductor/annotationdbi/llms.txt Configure `mapIds()` with `multiVals = "asNA"` to return `NA` for any key that has multiple matches in the specified column. This is useful for strict, single-value lookups. ```r library(org.Hs.eg.db) # Handle multiple values: return NA for multi-match keys symbols_strict <- mapIds(org.Hs.eg.db, keys = genes, column = "ALIAS", keytype = "ENTREZID", multiVals = "asNA") ``` -------------------------------- ### GO ID Source: https://github.com/bioconductor/annotationdbi/blob/devel/inst/DBschemas/schemas_2.1/DataTypes.txt Details on the format and possible values for Gene Ontology (GO) identifiers. ```APIDOC ## GO ID ### Description Represents the Gene Ontology (GO) identifier. ### SQL Type CHAR(10) ### Examples - 'all' - 'GO:0000001' - 'GO:0016491' ### Note Except for 'all', identifiers are typically in the format 'GO:1234567'. ``` -------------------------------- ### KEGG Pathway Long ID Source: https://github.com/bioconductor/annotationdbi/blob/devel/inst/DBschemas/schemas_2.1/DataTypes.txt Details on the long identifier for KEGG pathways. ```APIDOC ## KEGG pathway long ID ### Description Provides the longer, more descriptive identifier for a KEGG pathway. ### SQL Type CHAR(8) ### Examples - 'hsa00680' - 'rno05220' - 'ath00120' - 'dme00910' ``` -------------------------------- ### Accession Number Fields Source: https://github.com/bioconductor/annotationdbi/blob/devel/inst/DBschemas/schemas_2.1/DataTypes.txt Details for various accession number formats used in biological databases. ```APIDOC ## Accession Number Fields ### RefSeq accession number - **SQL type**: VARCHAR(20) - **Examples**: 'NM_018009', 'NP_001035700' - **Note**: RefSeq accession numbers seem to be valid GenBank accession numbers ### IPI accession number - **SQL type**: CHAR(11) - **Examples**: 'IPI00328276', 'IPI00789644' ### Pfam ID - **SQL type**: CHAR(7) - **Examples**: 'PF00069', 'PF08266' ### PROSITE ID - **SQL type**: CHAR(7) - **Examples**: 'PS00107', 'PS00657' ### PubMed ID - **SQL type**: VARCHAR(10) - **Examples**: '2437', '2583089', '17652175' - **Note**: highest value observed so far is 17652175 ### UniGene ID - **SQL type**: VARCHAR(10) - **Examples**: 'Hs.2', 'Hs.511848', 'Hs.695912' - **Note**: highest value observed so far for Human is Hs.695912 ### FlyBase ID - **SQL type**: CHAR(11) - **Examples**: 'FBgn0001942', 'FBgn0030936', 'FBgn0051992' ### FlyBase CG ID - **SQL type**: CHAR(10) - **Examples**: 'CG3038', 'CG13377', 'CG2945' ### Flybase Protein ID - **SQL type**: VARCHAR(20) - **Examples**: 'FBpp0073215', 'FBpp0110310', 'FBpp0071474' - **Note**: Flybase protein IDs, one peptide per ID. ### Yeast ORF ID - **SQL type**: VARCHAR(14) - **Examples**: 'YPL141C', 'YGRWsigma7', 'YPRWdelta14' - **Note**: the maximum length observed so far is 11 but using VARCHAR(14) is a safety precaution for longer Yeast ORF IDs that could appear in the future ### SGD ID - **SQL type**: CHAR(10) - **Examples**: 'S000004794', 'S000037040', 'S000123281' - **Note**: highest value observed so far is S000123281 ### InterPro ID - **SQL type**: CHAR(9) - **Examples**: 'IPR001440', 'IPR008688', 'IPR015809' - **Note**: highest value observed so far is IPR015809 ### SMART ID - **SQL type**: CHAR(7) - **Examples**: 'SM00055', 'SM00220', 'SM00717' ### AGI locus ID - **SQL type**: CHAR(9) - **Examples**: 'AT1G01010', 'ATCG00830', 'ATMG01410' ``` -------------------------------- ### Other Identifier Fields Source: https://github.com/bioconductor/annotationdbi/blob/devel/inst/DBschemas/schemas_2.1/DataTypes.txt Details for other specific biological identifiers. ```APIDOC ## Other Identifier Fields ### OMIM ID - **SQL type**: CHAR(6) - **Examples**: '231550', '601421', '611258' - **Note**: highest value observed so far is 611258 ### Yeast feature description - **SQL type**: TEXT - **Note**: this can be a text of any length ``` -------------------------------- ### mapIds() - Extract Single Column Source: https://context7.com/bioconductor/annotationdbi/llms.txt Extracts a single column of data as a named character vector, with configurable handling for multiple matches. ```APIDOC ## mapIds(x, keys, column, keytype, multiVals) ### Description Extracts a single column of data as a named character vector. Provides options for handling multiple matches per key via the multiVals argument. ### Parameters - **x** (Object) - Required - The annotation database object. - **keys** (Character vector) - Required - The identifiers to query. - **column** (String) - Required - The column to extract. - **keytype** (String) - Required - The type of identifier provided in keys. - **multiVals** (String/Function) - Optional - Strategy for handling multiple matches: 'first' (default), 'list', 'CharacterList', 'asNA', or a custom function. ### Response - **vector/list** - A named vector or list containing the mapped values. ``` -------------------------------- ### Entrez Gene or ORF ID Source: https://github.com/bioconductor/annotationdbi/blob/devel/inst/DBschemas/schemas_2.1/DataTypes.txt Details on identifiers for Entrez Genes or Open Reading Frames (ORFs). ```APIDOC ## Entrez Gene or ORF ID ### Description Represents an identifier for an Entrez Gene or an Open Reading Frame (ORF). ### SQL Type VARCHAR(20) ### Examples - 'YDR156W' - 'AT4G15280' - 'Dmel_CG10045' - [Entrez Gene ID] ### Note The maximum observed length for this identifier is 12 characters. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.