Skip to content

Commit bab7281

Browse files
committed
Don't include self corr in check and fix syntax
1 parent 3e10e7e commit bab7281

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

depmap_analysis/network_functions/net_functions.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,12 @@ def add_corr_to_edges(graph: DiGraph, z_corr: pd.DataFrame,
394394
)
395395
z_sc_values = z_corr.values
396396
z_sc_max = np.max(
397-
np.nanmax(z_sc_values[z_sc_values != np.inf]),
398-
np.abs(np.nanmin(z_sc_values[z_sc_values != -np.inf]))
397+
[
398+
np.nanmax(z_sc_values[(z_sc_values != np.inf) & (z_sc_values != self_corr)]),
399+
np.abs(np.nanmin(
400+
z_sc_values[(z_sc_values != -np.inf) & (z_sc_values != self_corr)]
401+
))
402+
]
399403
)
400404
for u, v, data in tqdm(graph.edges(data=True)):
401405
un = u[0] if isinstance(u, tuple) else u

0 commit comments

Comments
 (0)