Maps gene symbols through known aliases (synonyms) to their current official symbols and Ensembl gene IDs. This helps when working with outdated or alternative gene names (e.g., "MLL" -> "KMT2A").
Arguments
- symbols
a character vector of gene symbols to resolve.
- annotable
a
data.framefrombuild_annotables()withinclude_synonyms = TRUE. Must containsymbolandsynonymcolumns.- multiple
if
TRUE, return adata.framewith all matches (including cases where one alias maps to multiple genes).
Value
a data.frame (tibble) with columns:
- query
the input gene symbols
- symbol
resolved official gene symbol (
NAif unmatched)- ensgene
resolved Ensembl gene ID (
NAif unmatched)
When multiple = TRUE, each row is a single query->match pair,
so one query may appear in multiple rows.
Examples
# \donttest{
# Build annotables with synonym support
ann <- build_annotables("grch38", include_synonyms = TRUE, tx2gene = FALSE)
#> --- Building: grch38 ---
#> Trying mirror: https://www.ensembl.org
#> OK: 133458 rows
#> Cached to: /tmp/Rtmpu9e9wx/grch38_syn.rda
#>
#> Successfully built 1 table(s). Use names() to see available tables.
# Resolve aliases
resolve_gene_aliases(c("TP53", "MLL", "NOTAGENE"), ann[[1]])
#> # A tibble: 3 × 3
#> query symbol ensgene
#> <chr> <chr> <chr>
#> 1 TP53 TP53 ENSG00000141510
#> 2 MLL KMT2A ENSG00000118058
#> 3 NOTAGENE NA NA
# Multiple match mode
resolve_gene_aliases(c("TP53", "MLL"), ann[[1]], multiple = TRUE)
#> # A tibble: 2 × 3
#> query symbol ensgene
#> <chr> <chr> <chr>
#> 1 TP53 TP53 ENSG00000141510
#> 2 MLL KMT2A ENSG00000118058
# }