Skip to content

Commit 750baa2

Browse files
committed
fix: update gene listing query to fetch distinct HGNC from transcripts
In newer versions of UTA, the gene table has become overrun with mRNA, mitochondrial genes, etc. that polute the result list. Since the real purpose of this endpoint is to list the genes for which we can link transcripts, this query edits the query to select distinct HGNC names from the transcripts table.
1 parent 268b5e9 commit 750baa2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/mavedb/routers/hgvs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ def list_genes():
9393
"""
9494
# Even though it doesn't provide the most complete transcript pool, UTA does provide more direct
9595
# access to a complete list of genes which have transcript information available.
96-
return list(chain.from_iterable(hgvs.dataproviders.uta.connect()._fetchall("select hgnc from gene")))
96+
return list(
97+
chain.from_iterable(hgvs.dataproviders.uta.connect()._fetchall("SELECT DISTINCT hgnc FROM transcript;"))
98+
)
9799

98100

99101
@router.get("/genes/{gene}", status_code=200, response_model=dict[str, Any], summary="Show stored gene information")

0 commit comments

Comments
 (0)