Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDEV-4155 - switch to source.displayName for Pharmacogenomic filterin… #116

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion graphkb/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
CANCER_GENE = "cancer gene"
FUSION_NAMES = ["structural variant", "fusion"]

PHARMACOGENOMIC_SOURCE_EXCLUDE_LIST = ["cancer genome interpreter", "civic"]
GSC_PHARMACOGENOMIC_SOURCE_DISPLAYNAME_EXCLUDE_LIST = ["CGI", "CIViC"]

BASE_THERAPEUTIC_TERMS = ["therapeutic efficacy", "eligibility"]
# the order here is the order these are applied, the first category matched is returned
Expand Down
14 changes: 11 additions & 3 deletions graphkb/genes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
GENE_RETURN_PROPERTIES,
ONCOGENE,
ONCOKB_SOURCE_NAME,
PHARMACOGENOMIC_SOURCE_EXCLUDE_LIST,
GSC_PHARMACOGENOMIC_SOURCE_DISPLAYNAME_EXCLUDE_LIST,
PREFERRED_GENE_SOURCE,
RELEVANCE_BASE_TERMS,
TSO500_SOURCE_NAME,
Expand Down 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 All @@ -349,12 +356,13 @@ def get_pharmacogenomic_info(
"conditions.reference2.biotype",
"conditions.reference2.displayName",
"source.name",
"source.displayName",
],
},
ignore_cache=False,
):
if record["source"]: # type: ignore
if record["source"]["name"].lower() in PHARMACOGENOMIC_SOURCE_EXCLUDE_LIST: # type: ignore
if record["source"]["displayName"] in excluded_statement_sources: # type: ignore
continue

for condition in record["conditions"]: # type: ignore
Expand Down
Loading