Skip to content

Commit

Permalink
Merge pull request #107 from bcgsc/feature/KBDEV-1129-add-cancer-gene…
Browse files Browse the repository at this point in the history
…-flag

Add cancer_gene flag to get_gene_information
  • Loading branch information
mathieulemieux authored Nov 17, 2023
2 parents e60a2e8 + 31b886b commit 1ba0713
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion graphkb/genes.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ def get_gene_information(
Function is originally from pori_ipr_python::annotate.py
Gene flags (categories) are: ['cancerRelated', 'knownFusionPartner', 'knownSmallMutation',
Gene flags (categories) are: ['cancerGene', 'cancerRelated', 'knownFusionPartner', 'knownSmallMutation',
'oncogene', 'therapeuticAssociated', 'tumourSuppressor']
Args:
Expand Down Expand Up @@ -444,6 +444,8 @@ def get_gene_information(
gene_flags["oncogene"] = convert_to_rid_set(get_oncokb_oncogenes(graphkb_conn))
logger.info("fetching tumour supressors list")
gene_flags["tumourSuppressor"] = convert_to_rid_set(get_oncokb_tumour_supressors(graphkb_conn))
logger.info("fetching cancerGene list")
gene_flags["cancerGene"] = convert_to_rid_set(get_cancer_genes(graphkb_conn))

logger.info("fetching therapeutic associated genes lists")
gene_flags["therapeuticAssociated"] = convert_to_rid_set(
Expand Down
8 changes: 7 additions & 1 deletion tests/test_genes.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

CANONICAL_ONCOGENES = ["kras", "nras", "alk"]
CANONICAL_TS = ["cdkn2a", "tp53"]
CANONICAL_CG = ["ercc1", "fanci", "h2bc4", "h2bc17", "acvr1b"]
CANONICAL_CG = ["alb"]
CANONICAL_FUSION_GENES = ["alk", "ewsr1", "fli1"]
CANONICAL_STRUCTURAL_VARIANT_GENES = ["brca1", "dpyd", "pten"]
CANNONICAL_THERAPY_GENES = ["erbb2", "brca2", "egfr"]
Expand Down Expand Up @@ -203,6 +203,7 @@ def test_get_gene_information(conn):
conn,
CANONICAL_ONCOGENES
+ CANONICAL_TS
+ CANONICAL_CG
+ CANONICAL_FUSION_GENES
+ CANONICAL_STRUCTURAL_VARIANT_GENES
+ CANNONICAL_THERAPY_GENES
Expand Down Expand Up @@ -247,3 +248,8 @@ def test_get_gene_information(conn):
assert gene in [
g["name"] for g in gene_info if g.get("cancerRelated")
], f"Missed cancerRelated {gene}"

for gene in CANONICAL_CG:
assert gene in [
g["name"] for g in gene_info if g.get("cancerGene")
], f"Missed cancerGene {gene}"

0 comments on commit 1ba0713

Please sign in to comment.