Mercurial > repos > bimib > cobraxy
changeset 289:3f5cfcf4d9eb draft
Uploaded
author | francesco_lapi |
---|---|
date | Wed, 14 May 2025 10:08:09 +0000 |
parents | d1d732d1705c |
children | 71ec0b6ddde9 |
files | COBRAxy/marea.py |
diffstat | 1 files changed, 2 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/COBRAxy/marea.py Wed May 14 10:04:23 2025 +0000 +++ b/COBRAxy/marea.py Wed May 14 10:08:09 2025 +0000 @@ -371,10 +371,8 @@ 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}" @@ -384,7 +382,6 @@ 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 @@ -427,10 +424,8 @@ self.dash = isDashed def applyTo(self, reactionId :str, metabMap :ET.ElementTree, styleStr :str) -> None: - #if - getElementById(reactionId, metabMap).map(lambda el : styleMapElement(el, styleStr)).unwrap() - #.isErr: - # ERRORS.append(reactionId) + if getElementById(reactionId, metabMap).map(lambda el : styleMapElement(el, styleStr)).isErr: + ERRORS.append(reactionId) def styleReactionElements(self, metabMap :ET.ElementTree, reactionId :str, *, mindReactionDir = True) -> None: # If We're dealing with RAS data or in general don't care about the direction of the reaction we only style the arrow body @@ -439,7 +434,6 @@ # 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)) @@ -502,12 +496,10 @@ 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