changeset 168:f327ddec6749 draft

Uploaded
author francesco_lapi
date Fri, 26 Jul 2024 10:33:58 +0000
parents acc46800ad84
children c9908e5f107f
files marea_2/marea.py
diffstat 1 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/marea_2/marea.py	Wed Jul 24 16:41:56 2024 +0000
+++ b/marea_2/marea.py	Fri Jul 26 10:33:58 2024 +0000
@@ -217,8 +217,8 @@
         return '-INF'
     elif avg2 == 0:
         return 'INF'
-    else:
-        return (avg1 - avg2) / abs(avg2)
+    else: # (threshold_F_C - 1) / (abs(threshold_F_C) + 1) con threshold_F_C > 1
+        return (avg1 - avg2) / (abs(avg1) + abs(avg2))
     
 def fix_style(l :str, col :Optional[str], width :str, dash :str) -> str:
     """
@@ -732,11 +732,16 @@
             reactDir = ReactionDirection.fromReactionId(reactId)
             # Net score is computed only for reversible reactions when user wants it on arrow tips or when RAS datasets aren't used
             if (ARGS.net or not ARGS.using_RAS) and reactDir is not ReactionDirection.Unknown:
-                try: position = ids.index(reactId[:-1] + ('B' if reactDir is ReactionDirection.Direct else 'F'))
-                except ValueError: continue # we look for the complementary id, if not found we skip
-
-                nets1 = np.subtract(l1, dataset1Data[position])
-                nets2 = np.subtract(l2, dataset2Data[position])
+                try: 
+                    position = ids.index(reactId[:-1] + ('B' if reactDir is ReactionDirection.Direct else 'F'))
+                    nets1 = np.subtract(l1, dataset1Data[position])
+                    nets2 = np.subtract(l2, dataset2Data[position])
+                except ValueError: 
+                    if ARGS.net:
+                        continue # we look for the complementary id, if not found we skip
+                    else:
+                        nets1 = l1
+                        nets2 = l2
 
                 p_value, z_score = computePValue(nets1, nets2)
                 avg1 = sum(nets1)   / len(nets1)