# HG changeset patch # User francesco_lapi # Date 1746441210 0 # Node ID 2748cef7fa1286a4fd6c58a153f5cf68ea7a7aa3 # Parent e87aeb3a33cdf0eeec7589ed47223d502cb6b5fb Uploaded diff -r e87aeb3a33cd -r 2748cef7fa12 COBRAxy/marea.py --- a/COBRAxy/marea.py Mon May 05 10:33:06 2025 +0000 +++ b/COBRAxy/marea.py Mon May 05 10:33:30 2025 +0000 @@ -293,6 +293,9 @@ p_val :float = tmp[0] f_c = tmp[1] z_score = tmp[2] + + if math.isnan(p_val) or (isinstance(f_c, float) and math.isnan(f_c)): continue + if p_val <= threshold_P_V: if not isinstance(f_c, str): if abs(f_c) < ((threshold_F_C - 1) / (abs(threshold_F_C) + 1)): # @@ -491,6 +494,8 @@ foldChange = values[1] z_score = values[2] + if math.isnan(pValue) or (isinstance(foldChange, float) and math.isnan(foldChange)): continue + if isinstance(foldChange, str): foldChange = float(foldChange) if pValue >= ARGS.pValue: # pValue above tresh: dashed arrow INSIGNIFICANT_ARROW.styleReactionElements(metabMap, reactionId) @@ -761,7 +766,6 @@ # fallthrough is intended, regular scores need to be computed when tips aren't net but RAS datasets aren't used p_value, z_score = computePValue(l1, l2) avg = fold_change(sum(l1) / len(l1), sum(l2) / len(l2)) - if math.isnan(p_value) or (isinstance(avg, float) and math.isnan(avg)): continue if not isinstance(z_score, str) and max_z_score < abs(z_score): max_z_score = abs(z_score) tmp[reactId] = [float(p_value), avg, z_score]