Skip to contents

Map gene names to Ensembl identifiers

Usage

mapGeneNamesToEnsembl(
  genes,
  organism,
  ignoreCase = FALSE,
  hgnc = NULL,
  ncbi = NULL
)

Arguments

genes

Gene names (e.g. "TUT4").

organism

character(1). Full Latin organism name (e.g. "Homo sapiens").

ignoreCase

logical(1). Enable case-insensitive matching.

hgnc

Hgnc object. Supported for Homo sapiens genome only. Snapshot of HGNC annotations. Passes to mapGeneNamesToHgnc internally.

ncbi

NcbiGeneInfo object. Snapshot of NCBI annotations. Passes to mapGeneNamesToNcbi internally.

Details

Internally matches using mapGeneNamesToHgnc (Homo sapiens only) or mapGeneNamesToNcbi (all other organisms), so we can support gene synonym matching.

Note

Updated 2025-04-15.

Examples

## Homo sapiens.
x <- mapGeneNamesToEnsembl(
    genes = c("TUT4", "ZCCHC11", "TENT3A"),
    organism = "Homo sapiens"
)
#> → Importing HGNC complete set.
#> → Importing /private/var/folders/pt/1g5629f1699dfjwdfh32q50m0000gn/T/koopa-r-docs-build-l3dklp41/home/.cache/R/AcidGenomes/BiocFileCache/a36529a1d43e_hgnc_complete_set.txt using base::`read.table()`.
#> Error in stop(simpleError(message = msg, call = if (p) {    sys.call(p)})): Assert failure.
#> [1] areSetEqual(names(expected), names(object)) is not TRUE.
#> Cause: `character` and `character` have different numbers of elements (52
#> versus 51).
print(x)
#> Error: object 'x' not found

## Mus musculus
x <- mapGeneNamesToEnsembl(
    genes = c("Nfe2l2", "Nrf2"),
    organism = "Mus musculus"
)
#> → Downloading Mus musculus gene info from NCBI at <https://ftp.ncbi.nlm.nih.gov/gene/DATA/GENE_INFO/Mammalia/Mus_musculus.gene_info.gz>.
#> → Caching URL at <https://ftp.ncbi.nlm.nih.gov/gene/DATA/GENE_INFO/Mammalia/Mus_musculus.gene_info.gz> into /private/var/folders/pt/1g5629f1699dfjwdfh32q50m0000gn/T/koopa-r-docs-build-l3dklp41/home/.cache/R/AcidGenomes/BiocFileCache.
#> 
#> → Importing /private/var/folders/pt/1g5629f1699dfjwdfh32q50m0000gn/T/koopa-r-docs-build-l3dklp41/home/.cache/R/AcidGenomes/BiocFileCache/a36560c5e72_Mus_musculus.gene_info.gz using base::`read.table()`.
print(x)
#> [1] "ENSMUSG00000015839" "ENSMUSG00000015839"