Skip to content

Commit

Permalink
SDEV-4155 - PR - add get_pharmacogenomic_info GSC_PHARMACOGENOMIC_SOU…
Browse files Browse the repository at this point in the history
…RCE_DISPLAYNAME_EXCLUDE_LIST.
  • Loading branch information
dustinbleile committed Feb 16, 2024
1 parent 13ee76a commit 4594200
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions graphkb/genes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4594200

Please sign in to comment.