Skip to content

Alias sources

See alias lookup for snapshot selection, ambiguity, case sensitivity and species restrictions. The optional aliases= argument is documented with Genome queries.

GeneNameAliases

GeneNameAliases(aliases, *, species=None, source=None)

Read-only name-to-ID mapping with optional species/source metadata.

Ordinary mappings also work with Genome.genes_by_name(aliases=...). Values may name several genes: aliases are not necessarily unique.

species instance-attribute

species = species

source instance-attribute

source = source

download_hgnc classmethod

download_hgnc(*, cache_directory_path=None, source_url=HGNC_COMPLETE_SET_URL, overwrite=False)

Download and load human HGNC aliases, reusing a cached snapshot.

Parameters:

Name Type Description Default
cache_directory_path str or Path

Storage base directory. Defaults to aliases/homo_sapiens/hgnc under PyEnsembl's configured cache root. Each source URL has a separate subdirectory.

None
source_url str

Complete-set TSV or gzip TSV URL. Defaults to HGNC's current complete set; an archived snapshot or mirror can be selected.

HGNC_COMPLETE_SET_URL
overwrite bool

Download again even when this source is already cached.

False

Returns:

Type Description
GeneNameAliases

Human alias mapping whose source is the cached file path.

Notes

Existing cached files are read without network access. Refresh is explicit; HGNC nomenclature is independent of the Ensembl release. Use from_hgnc(path) to load an already selected local snapshot.

from_hgnc classmethod

from_hgnc(path)

Load an HGNC complete-set TSV snapshot (plain or gzip).

Include symbols, aliases and previous symbols of approved human records with an Ensembl gene ID. Do not download or modify the file. HGNC nomenclature may be newer than the selected Ensembl annotation.