From 0231bbd618666e2ac3dc0803fd97675ac9067ff7 Mon Sep 17 00:00:00 2001 From: ashuaibi7 Date: Wed, 15 Jan 2025 15:12:26 -0500 Subject: [PATCH] modify the p value thresholds to a single constant to use across methods and experiment with changes more easily --- src/dialect/utils/plotting.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/dialect/utils/plotting.py b/src/dialect/utils/plotting.py index 79e8c34..4a3a90f 100644 --- a/src/dialect/utils/plotting.py +++ b/src/dialect/utils/plotting.py @@ -35,6 +35,7 @@ DRIVER_GENE_COLOR = "#A3C1DA" # Blue-gray for driver genes EDGE_COLOR = "black" EPSILON = 0.02 # DIALECT Threshold for Tau_1X and Tau_X1 +PVALUE_THRESHOLD = 0.05 # ---------------------------------------------------------------------------- # @@ -171,11 +172,17 @@ def draw_network_gridplot_across_methods( elif method == "MEGSA": top_ranking_pairs = top_ranking_pairs[top_ranking_pairs["MEGSA S-Score (LRT)"] > 0] elif method == "DISCOVER": - top_ranking_pairs = top_ranking_pairs[top_ranking_pairs["Discover ME P-Val"] < 0.05] + top_ranking_pairs = top_ranking_pairs[ + top_ranking_pairs["Discover ME P-Val"] < PVALUE_THRESHOLD + ] elif method == "Fisher's Exact Test": - top_ranking_pairs = top_ranking_pairs[top_ranking_pairs["Fisher's ME P-Val"] < 0.05] + top_ranking_pairs = top_ranking_pairs[ + top_ranking_pairs["Fisher's ME P-Val"] < PVALUE_THRESHOLD + ] elif method == "WeSME": - top_ranking_pairs = top_ranking_pairs[top_ranking_pairs["WeSME P-Val"] < 0.05] + top_ranking_pairs = top_ranking_pairs[ + top_ranking_pairs["WeSME P-Val"] < PVALUE_THRESHOLD + ] edges = top_ranking_pairs[["Gene A", "Gene B"]].values G = nx.Graph()