From 42bec7a9f21cf649681469fce202e545c92f07f0 Mon Sep 17 00:00:00 2001 From: Ben Gyori Date: Fri, 7 Feb 2025 20:24:09 -0500 Subject: [PATCH] Handle list of current HGNC IDs --- src/indra_cogex/analysis/gene_analysis.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/indra_cogex/analysis/gene_analysis.py b/src/indra_cogex/analysis/gene_analysis.py index 0f2a8aa89..821294e7e 100644 --- a/src/indra_cogex/analysis/gene_analysis.py +++ b/src/indra_cogex/analysis/gene_analysis.py @@ -298,7 +298,11 @@ def parse_gene_list(gene_list: Iterable[str]) -> Tuple[Dict[str, str], List[str] hgnc_ids.append(entry) else: # probably a symbol hgnc_id = hgnc_client.get_current_hgnc_id(entry) - if hgnc_id: + # Handle special case where an outdated symbol + # corresponds to multiple current HGNC IDs + if isinstance(hgnc_id, list): + hgnc_ids.append(hgnc_id[0]) + elif hgnc_id: hgnc_ids.append(hgnc_id) else: errors.append(entry)