# HG changeset patch # User francesco_lapi # Date 1746441186 0 # Node ID e87aeb3a33cdf0eeec7589ed47223d502cb6b5fb # Parent d54d6728b2047deb28f9486743662872093e2b52 Uploaded diff -r d54d6728b204 -r e87aeb3a33cd COBRAxy/flux_to_map.py --- a/COBRAxy/flux_to_map.py Mon May 05 10:15:46 2025 +0000 +++ b/COBRAxy/flux_to_map.py Mon May 05 10:33:06 2025 +0000 @@ -262,6 +262,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)): # @@ -476,6 +479,9 @@ 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) @@ -726,7 +732,6 @@ avg1 = sum(l1) / len(l1) avg2 = sum(l2) / len(l2) f_c = fold_change(avg1, avg2) - if math.isnan(p_value) or (isinstance(f_c, float) and math.isnan(f_c)): 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), f_c, z_score, avg1, avg2]