From 4594200e6ac2782671644b8f8c3915110593262d Mon Sep 17 00:00:00 2001 From: Dustin Bleile Date: Fri, 16 Feb 2024 11:56:46 -0800 Subject: [PATCH] SDEV-4155 - PR - add get_pharmacogenomic_info GSC_PHARMACOGENOMIC_SOURCE_DISPLAYNAME_EXCLUDE_LIST. --- graphkb/genes.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/graphkb/genes.py b/graphkb/genes.py index 502577b..57387ed 100644 --- a/graphkb/genes.py +++ b/graphkb/genes.py @@ -309,7 +309,9 @@ def get_cancer_predisposition_info( def get_pharmacogenomic_info( - conn: GraphKBConnection, source: str = PREFERRED_GENE_SOURCE + conn: GraphKBConnection, + source: str = PREFERRED_GENE_SOURCE, + excluded_statement_sources: List[str]=GSC_PHARMACOGENOMIC_SOURCE_DISPLAYNAME_EXCLUDE_LIST ) -> Tuple[List[str], Dict[str, str]]: """ Return two lists from GraphKB, one of pharmacogenomic genes and one of associated variants. @@ -323,6 +325,11 @@ def get_pharmacogenomic_info( Example: https://graphkb.bcgsc.ca/view/Statement/154:9574 + Args: + conn (GraphKBConnection): GraphKB connection object + source (str): Gene name source id - for form of gene name symbols used + excluded_statement_sources (List): List of displayNames for statement sources to exclude + Returns: genes: list of pharmacogenomic genes variants: dictionary mapping pharmacogenomic variant IDs to variant display names @@ -355,7 +362,7 @@ def get_pharmacogenomic_info( ignore_cache=False, ): if record["source"]: # type: ignore - if record["source"]["displayName"] in GSC_PHARMACOGENOMIC_SOURCE_DISPLAYNAME_EXCLUDE_LIST: # type: ignore + if record["source"]["displayName"] in excluded_statement_sources: # type: ignore continue for condition in record["conditions"]: # type: ignore