# HG changeset patch # User francesco_lapi # Date 1747214632 0 # Node ID c8622bca24800dd106f88017d50b37d6cf976c4c # Parent eaa623b4b703dca3cc16da3d73d23cb3e1b07184 Uploaded diff -r eaa623b4b703 -r c8622bca2480 COBRAxy/marea.py --- a/COBRAxy/marea.py Wed May 14 08:44:03 2025 +0000 +++ b/COBRAxy/marea.py Wed May 14 09:23:52 2025 +0000 @@ -371,8 +371,10 @@ Returns: Tuple[str, str]: either a single str ID for the correct arrow head followed by an empty string or both options to try. """ + print("getArrowHeadElementId: ", reactionId) if reactionId.endswith("_RV"): reactionId = reactionId[:-3] #TODO: standardize _RV elif ReactionDirection.fromReactionId(reactionId) is not ReactionDirection.Unknown: + print(f"getArrowHeadElementId: {reactionId} this was not unknown.") return reactionId[:-3:-1] + reactionId[:-2], "" # ^^^ Invert _F to F_ return f"F_{reactionId}", f"B_{reactionId}" @@ -382,6 +384,7 @@ Encodes possible arrow colors based on their meaning in the enrichment process. """ Invalid = "#BEBEBE" # gray, fold-change under treshold + Transparent = "#ffffff00" # transparent, not significant p-value UpRegulated = "#ecac68" # orange, up-regulated reaction DownRegulated = "#6495ed" # lightblue, down-regulated reaction @@ -434,6 +437,7 @@ # Now we style the arrow head(s): idOpt1, idOpt2 = getArrowHeadElementId(reactionId) + print("styleReactionElements: ", idOpt1, idOpt2) self.applyTo(idOpt1, metabMap, self.toStyleStr(downSizedForTips = True)) if idOpt2: self.applyTo(idOpt2, metabMap, self.toStyleStr(downSizedForTips = True)) @@ -496,10 +500,12 @@ if isinstance(foldChange, str): foldChange = float(foldChange) if pValue >= ARGS.pValue: # pValue above tresh: dashed arrow + print("Invalid pValue: ", pValue) INSIGNIFICANT_ARROW.styleReactionElements(metabMap, reactionId) continue if abs(foldChange) < (ARGS.fChange - 1) / (abs(ARGS.fChange) + 1): + print("Invalid fc: ", foldChange) INVALID_ARROW.styleReactionElements(metabMap, reactionId) continue