From c09d70844040d2545a571210cc0c2a2a647e894d Mon Sep 17 00:00:00 2001 From: mathieulemieux Date: Wed, 15 Nov 2023 16:21:26 -0800 Subject: [PATCH 1/4] Add cancer_gene flag to get_gene_information --- graphkb/genes.py | 4 ++++ tests/test_genes.py | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/graphkb/genes.py b/graphkb/genes.py index 7d5792b..85f8232 100644 --- a/graphkb/genes.py +++ b/graphkb/genes.py @@ -444,6 +444,10 @@ 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 cancer_gene list") + gene_flags["cancer_gene"] = convert_to_rid_set(get_cancer_genes(graphkb_conn)) + logger.info("fetching cancer_gene list") + gene_flags["cancer_gene"] = convert_to_rid_set(get_cancer_genes(graphkb_conn)) logger.info("fetching therapeutic associated genes lists") gene_flags["therapeuticAssociated"] = convert_to_rid_set( diff --git a/tests/test_genes.py b/tests/test_genes.py index 00e391e..6f9b3e6 100644 --- a/tests/test_genes.py +++ b/tests/test_genes.py @@ -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"] @@ -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 @@ -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("cancer_gene") + ], f"Missed cancer_gene {gene}" From 0f0f1cd53215710ded2f7d18712a94035eaad54d Mon Sep 17 00:00:00 2001 From: mathieulemieux Date: Thu, 16 Nov 2023 07:33:25 -0800 Subject: [PATCH 2/4] Removing duplicated lines added by mistake --- graphkb/genes.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/graphkb/genes.py b/graphkb/genes.py index 85f8232..8f0397b 100644 --- a/graphkb/genes.py +++ b/graphkb/genes.py @@ -446,8 +446,6 @@ def get_gene_information( gene_flags["tumourSuppressor"] = convert_to_rid_set(get_oncokb_tumour_supressors(graphkb_conn)) logger.info("fetching cancer_gene list") gene_flags["cancer_gene"] = convert_to_rid_set(get_cancer_genes(graphkb_conn)) - logger.info("fetching cancer_gene list") - gene_flags["cancer_gene"] = convert_to_rid_set(get_cancer_genes(graphkb_conn)) logger.info("fetching therapeutic associated genes lists") gene_flags["therapeuticAssociated"] = convert_to_rid_set( From 31b886b153d66bf7d28a88468a6f663d8a2c9fe3 Mon Sep 17 00:00:00 2001 From: mathieulemieux Date: Thu, 16 Nov 2023 11:09:26 -0800 Subject: [PATCH 3/4] Renaming cancerGene flag --- graphkb/genes.py | 6 +++--- tests/test_genes.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/graphkb/genes.py b/graphkb/genes.py index 8f0397b..afc2f80 100644 --- a/graphkb/genes.py +++ b/graphkb/genes.py @@ -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: @@ -444,8 +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 cancer_gene list") - gene_flags["cancer_gene"] = convert_to_rid_set(get_cancer_genes(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( diff --git a/tests/test_genes.py b/tests/test_genes.py index 6f9b3e6..c5a5d96 100644 --- a/tests/test_genes.py +++ b/tests/test_genes.py @@ -251,5 +251,5 @@ def test_get_gene_information(conn): for gene in CANONICAL_CG: assert gene in [ - g["name"] for g in gene_info if g.get("cancer_gene") - ], f"Missed cancer_gene {gene}" + g["name"] for g in gene_info if g.get("cancerGene") + ], f"Missed cancerGene {gene}" From 798fc9823bb787917540601729af0918ba8bdb2a Mon Sep 17 00:00:00 2001 From: mathieulemieux Date: Mon, 20 Nov 2023 15:53:04 -0800 Subject: [PATCH 4/4] Update release version to 1.14.0 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index ac8829a..4a8f1d5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -10,7 +10,7 @@ include_trailing_comma = true [metadata] name = graphkb url = https://github.com/bcgsc/pori_graphkb_python -version = 1.13.0 +version = 1.14.0 author_email = graphkb@bcgsc.ca description = python adapter for interacting with the GraphKB API long_description = file: README.md