Skip to content

Commit

Permalink
Allow specifying chromosome name when retrieving mitochondrial genes. (
Browse files Browse the repository at this point in the history
…scverse#902)

Some organisms use a different chromosome name than "MT".
  • Loading branch information
ghuls authored and flying-sheep committed Nov 6, 2019
1 parent 19d7cd2 commit 0200814
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scanpy/queries/_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def mitochondrial_genes(
attrname: str = "external_gene_name",
host: str = "www.ensembl.org",
use_cache: bool = False,
chromosome: str = "MT",
) -> pd.DataFrame:
"""\
Mitochondrial gene symbols for specific organism through BioMart.
Expand All @@ -175,6 +176,8 @@ def mitochondrial_genes(
and "zfin_id_symbol".
{doc_host}
{doc_use_cache}
chromosome
Mitochrondrial chromosome name used in BioMart for organism.
Returns
-------
Expand All @@ -185,11 +188,12 @@ def mitochondrial_genes(
>>> import scanpy as sc
>>> mito_gene_names = sc.queries.mitochondrial_genes("hsapiens")
>>> mito_ensembl_ids = sc.queries.mitochondrial_genes("hsapiens", attrname="ensembl_gene_id")
>>> mito_gene_names_fly = sc.queries.mitochondrial_genes("dmelanogaster", chromosome="mitochondrion_genome")
"""
return simple_query(
org,
attrs=[attrname],
filters={"chromosome_name": ["MT"]},
filters={"chromosome_name": [chromosome]},
host=host,
use_cache=use_cache,
)
Expand Down

0 comments on commit 0200814

Please sign in to comment.