Skip to content

Commit

Permalink
Also check for +/-inf
Browse files Browse the repository at this point in the history
  • Loading branch information
kkaris committed May 3, 2024
1 parent 3d43ae4 commit bf2fe66
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion depmap_analysis/network_functions/net_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@ def add_corr_to_edges(graph: DiGraph, z_corr: pd.DataFrame,
for u, v, data in tqdm(graph.edges(data=True)):
un = u[0] if isinstance(u, tuple) else u
vn = v[0] if isinstance(v, tuple) else v
if un in z_corr and vn in z_corr and not np.isnan(z_corr.loc[un, vn]):
z_sc = z_corr.loc[un, vn]
if un in z_corr and vn in z_corr and not np.isnan(z_sc) and not np.isinf(z_sc):
z_sc = z_corr.loc[un, vn]
data['z_score'] = round(z_sc, 4)
data['corr_weight'] = round(z_sc_weight(z_sc, self_corr), 4)
Expand Down

0 comments on commit bf2fe66

Please sign in to comment.