Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 1ba0713

Browse files
Merge pull request #107 from bcgsc/feature/KBDEV-1129-add-cancer-gene-flag
Add cancer_gene flag to get_gene_information
2 parents e60a2e8 + 31b886b commit 1ba0713

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

graphkb/genes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def get_gene_information(
392392
393393
Function is originally from pori_ipr_python::annotate.py
394394
395-
Gene flags (categories) are: ['cancerRelated', 'knownFusionPartner', 'knownSmallMutation',
395+
Gene flags (categories) are: ['cancerGene', 'cancerRelated', 'knownFusionPartner', 'knownSmallMutation',
396396
'oncogene', 'therapeuticAssociated', 'tumourSuppressor']
397397
398398
Args:
@@ -444,6 +444,8 @@ def get_gene_information(
444444
gene_flags["oncogene"] = convert_to_rid_set(get_oncokb_oncogenes(graphkb_conn))
445445
logger.info("fetching tumour supressors list")
446446
gene_flags["tumourSuppressor"] = convert_to_rid_set(get_oncokb_tumour_supressors(graphkb_conn))
447+
logger.info("fetching cancerGene list")
448+
gene_flags["cancerGene"] = convert_to_rid_set(get_cancer_genes(graphkb_conn))
447449

448450
logger.info("fetching therapeutic associated genes lists")
449451
gene_flags["therapeuticAssociated"] = convert_to_rid_set(

tests/test_genes.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
CANONICAL_ONCOGENES = ["kras", "nras", "alk"]
2525
CANONICAL_TS = ["cdkn2a", "tp53"]
26-
CANONICAL_CG = ["ercc1", "fanci", "h2bc4", "h2bc17", "acvr1b"]
26+
CANONICAL_CG = ["alb"]
2727
CANONICAL_FUSION_GENES = ["alk", "ewsr1", "fli1"]
2828
CANONICAL_STRUCTURAL_VARIANT_GENES = ["brca1", "dpyd", "pten"]
2929
CANNONICAL_THERAPY_GENES = ["erbb2", "brca2", "egfr"]
@@ -203,6 +203,7 @@ def test_get_gene_information(conn):
203203
conn,
204204
CANONICAL_ONCOGENES
205205
+ CANONICAL_TS
206+
+ CANONICAL_CG
206207
+ CANONICAL_FUSION_GENES
207208
+ CANONICAL_STRUCTURAL_VARIANT_GENES
208209
+ CANNONICAL_THERAPY_GENES
@@ -247,3 +248,8 @@ def test_get_gene_information(conn):
247248
assert gene in [
248249
g["name"] for g in gene_info if g.get("cancerRelated")
249250
], f"Missed cancerRelated {gene}"
251+
252+
for gene in CANONICAL_CG:
253+
assert gene in [
254+
g["name"] for g in gene_info if g.get("cancerGene")
255+
], f"Missed cancerGene {gene}"

0 commit comments

Comments
 (0)