Skip to content

Commit

Permalink
modify network visualization plots to properly subset method tables a…
Browse files Browse the repository at this point in the history
…ccording to required schemes. for dialect the subsetting is done based on the marginal driver mutation rates as specified in the manuscript and for mutual exclusivity only to include the pairs with rho values less than 0. MEGSA subsetting is done by retaining values with LRT s-score values greater than 0. the remaining p-value methods are modified to retain p-values less than 0.05
  • Loading branch information
ashuaibi7 committed Jan 15, 2025
1 parent 6d15fee commit 688dc5d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/dialect/utils/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
DECOY_GENE_COLOR = "#FFB3B3" # Pastel red for decoy genes
DRIVER_GENE_COLOR = "#A3C1DA" # Blue-gray for driver genes
EDGE_COLOR = "black"
EPSILON = 0.02 # DIALECT Threshold for Tau_1X and Tau_X1


# ---------------------------------------------------------------------------- #
Expand Down Expand Up @@ -160,6 +161,22 @@ def draw_network_gridplot_across_methods(
top_ranking_pairs = results_df.sort_values(
col, ascending=col != "MEGSA S-Score (LRT)"
).head(top_k)

if method == "DIALECT":
top_ranking_pairs = top_ranking_pairs[
(top_ranking_pairs["Rho"] < 0)
& (top_ranking_pairs["Tau_1X"] > EPSILON)
& (top_ranking_pairs["Tau_X1"] > EPSILON)
]
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]
elif method == "Fisher's Exact Test":
top_ranking_pairs = top_ranking_pairs[top_ranking_pairs["Fisher's ME P-Val"] < 0.05]
elif method == "WeSME":
top_ranking_pairs = top_ranking_pairs[top_ranking_pairs["WeSME P-Val"] < 0.05]

edges = top_ranking_pairs[["Gene A", "Gene B"]].values
G = nx.Graph()
G.add_edges_from(edges)
Expand Down

0 comments on commit 688dc5d

Please sign in to comment.