Skip to content

Commit

Permalink
Merge branch 'develop' into refactor/lint_black
Browse files Browse the repository at this point in the history
  • Loading branch information
elewis2 authored Feb 29, 2024
2 parents 5fe32cf + 15180c6 commit df3ca4b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions graphkb/genes.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ def get_preferred_gene_name(
return gene_names[0]


def get_cancer_predisposition_info(conn: GraphKBConnection) -> Tuple[List[str], Dict[str, str]]:
def get_cancer_predisposition_info(
conn: GraphKBConnection, source: str = PREFERRED_GENE_SOURCE
) -> Tuple[List[str], Dict[str, str]]:
"""
Return two lists from GraphKB, one of cancer predisposition genes and one of associated variants.
Expand Down Expand Up @@ -282,7 +284,7 @@ def get_cancer_predisposition_info(conn: GraphKBConnection) -> Tuple[List[str],
if name and biotype == "gene":
genes.add(name)
elif name:
gene = get_preferred_gene_name(conn, name)
gene = get_preferred_gene_name(conn, name, source)
if gene:
infer_genes.add((gene, name, biotype))
else:
Expand All @@ -301,7 +303,9 @@ def get_cancer_predisposition_info(conn: GraphKBConnection) -> Tuple[List[str],
return sorted(genes), variants


def get_pharmacogenomic_info(conn: GraphKBConnection) -> Tuple[List[str], Dict[str, str]]:
def get_pharmacogenomic_info(
conn: GraphKBConnection, source: str = PREFERRED_GENE_SOURCE
) -> Tuple[List[str], Dict[str, str]]:
"""
Return two lists from GraphKB, one of pharmacogenomic genes and one of associated variants.
Expand Down Expand Up @@ -357,7 +361,7 @@ def get_pharmacogenomic_info(conn: GraphKBConnection) -> Tuple[List[str], Dict[s
if name and biotype == "gene":
genes.add(name)
elif name:
gene = get_preferred_gene_name(conn, name)
gene = get_preferred_gene_name(conn, name, source)
if gene:
infer_genes.add((gene, name, biotype))
else:
Expand Down

0 comments on commit df3ca4b

Please sign in to comment.