scanpy.queries.gene_coordinates(org, gene_name, *, gene_attr='external_gene_name', chr_exclude=(), host='', use_cache=False)

Retrieve gene coordinates for specific organism through BioMart.

org : str

Organism to query. Must be an organism in ensembl biomart. “hsapiens”, “mmusculus”, “drerio”, etc.

gene_name : str

The gene symbol (e.g. “hgnc_symbol” for human) for which to retrieve coordinates.

gene_attr : str (default: 'external_gene_name')

The biomart attribute the gene symbol should show up for.

chr_exclude : Iterable[str] (default: ())

A list of chromosomes to exclude from query.

host : str (default: '')

A valid BioMart host URL. Alternative values include archive urls (like “”) or regional mirrors (like “”).

use_cache : bool (default: False)

Whether pybiomart should use a cache for requests. Will create a .pybiomart.sqlite file in current directory if used.

Return type



Dataframe containing gene coordinates for the specified gene symbol.


>>> import scanpy as sc
>>> sc.queries.gene_coordinates("hsapiens", "MT-TF")