changeset 196:4aca24a98a4c draft

Uploaded
author francesco_lapi
date Wed, 31 Jul 2024 14:28:30 +0000
parents 1579b38b9c90
children 036f93eca89c
files marea_2/flux_to_map.py
diffstat 1 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/marea_2/flux_to_map.py	Wed Jul 31 14:23:43 2024 +0000
+++ b/marea_2/flux_to_map.py	Wed Jul 31 14:28:30 2024 +0000
@@ -483,24 +483,29 @@
         pValue = values[0]
         foldChange = values[1]
         z_score = values[2]
-
+        print(reactionId)
         if isinstance(foldChange, str): foldChange = float(foldChange)
         if pValue >= ARGS.pValue: # pValue above tresh: dashed arrow
             INSIGNIFICANT_ARROW.styleReactionElements(metabMap, reactionId)
+            print(1)
             continue
 
         if abs(foldChange) <  (ARGS.fChange - 1) / (abs(ARGS.fChange) + 1):
             INVALID_ARROW.styleReactionElements(metabMap, reactionId)
+            print(2)
             continue
         
         width = Arrow.MAX_W
         if not math.isinf(foldChange):
-            try: width = max(abs(z_score * Arrow.MAX_W) / maxNumericZScore, Arrow.MIN_W)
+            try: 
+                width = max(abs(z_score * Arrow.MAX_W) / maxNumericZScore, Arrow.MIN_W) 
+                print(3)
             except ZeroDivisionError: pass
         
-        #if not reactionId.endswith("_RV"): # RV stands for reversible reactions
-        #    Arrow(width, ArrowColor.fromFoldChangeSign(foldChange)).styleReactionElements(metabMap, reactionId)
-        #    continue
+        if not reactionId.endswith("_RV"): # RV stands for reversible reactions
+            Arrow(width, ArrowColor.fromFoldChangeSign(foldChange)).styleReactionElements(metabMap, reactionId)
+            print(4)
+            continue
         
         #reactionId = reactionId[:-3] # Remove "_RV"
         
@@ -514,9 +519,11 @@
         # vvv These 2 if statements can both be true and can both happen
         if ARGS.net: # style arrow head(s):
             arrow.styleReactionElements(metabMap, reactionId + ("_B" if inversionScore == 2 else "_F"))
+            print(5)
         
         if not ARGS.using_RAS: # style arrow body
             arrow.styleReactionElements(metabMap, reactionId, mindReactionDir = False)
+            print(6)
 
 ############################ split class ######################################
 def split_class(classes :pd.DataFrame, resolve_rules :Dict[str, List[float]]) -> Dict[str, List[List[float]]]: