View source: R/likely_symbol.R
| likely_symbol | R Documentation |
likely_symbol() downloads the latest version of the HGNC gene symbol database as a text
file and query it to obtain symbol aliases, previous symbols and all symbols currently in use. (Optionally)
assuming the input ID to be either an Alias or a Symbol or a Previous Symbol it performs multiple queries and
compares the results of all possible combinations to determine a likely current Symbol.
The downloaded HGNC table is cached for the duration of the R session to avoid repeated downloads.
likely_symbol(
syms,
alias_sym = TRUE,
prev_sym = TRUE,
orgnsm = "human",
hgnc = NULL,
hgnc_url = NULL,
output = c("likely", "symbols", "all"),
index_threshold = 10L,
refresh = FALSE,
verbose = TRUE
)
syms |
( |
alias_sym |
( |
prev_sym |
( |
orgnsm |
( |
hgnc |
( |
hgnc_url |
( |
output |
( |
index_threshold |
( |
refresh |
( |
verbose |
( |
The HGNC table is downloaded once per R session and cached in a package-level environment. Subsequent calls
reuse the cached table without any network access. If the cached table is more than 3 days old a warning message
is emitted recommending a refresh, since the HGNC database is updated monthly. To force a fresh download within
the same session use refresh = TRUE or start a new R session.
When the number of unique input symbols is at or above index_threshold, inverted indices (hash tables)
are pre-built from the HGNC table so that each per-symbol lookup is O(1) rather than O(nrow(hgnc)), giving
roughly a 50-100x speedup for batch inputs. For small inputs the original row-scan is retained to avoid the
index-building overhead.
A data.frame with the following columns depending on the output setting.
output="likely":
| 'likely_symbol' | |
| 'input_symbol' | |
output="symbols":
| 'current_symbols' | |
| 'likely_symbol' | |
| 'input_symbol' | |
| 'all_symbols' | |
output="all":
| 'orig_input' | |
| 'organism' | |
| 'current_symbols' | |
| 'likely_symbol' | |
| 'input_symbol' | |
| 'all_symbols' | |
Only fully implemented for Human for now.
## Not run:
# Single symbol lookup (uses row-scan, no index overhead)
likely_symbol("CCBL1")
# Second call reuses cached HGNC table — no download
likely_symbol("KAAT1")
# Force a fresh download within the same session
likely_symbol("CCBL1", refresh = TRUE)
# Batch lookup (builds index for speed)
likely_symbol(c("ABCC4", "ACPP", "KIAA1524"))
# Supply a pre-loaded table to bypass cache and download entirely
likely_symbol(c("ABCC4", "ACPP"), hgnc = my_hgnc_table)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.