# HG changeset patch # User luca_milaz # Date 1722852144 0 # Node ID c500117b79e260393bc5b2fe12a1afa0d511344d # Parent d281a6e06489aa435fd2db1d628cefcab3a62380 Uploaded diff -r d281a6e06489 -r c500117b79e2 marea_2/flux_to_map.py --- a/marea_2/flux_to_map.py Mon Aug 05 09:48:18 2024 +0000 +++ b/marea_2/flux_to_map.py Mon Aug 05 10:02:24 2024 +0000 @@ -926,11 +926,17 @@ colors_mean = {rxn_id: rgb_to_hex(jet_colormap(means[key][i])) for i, rxn_id in enumerate(ids)} for rxn_id in ids: + new_rxn_id="" + if(medians[key][rxn_id] < 0): + new_rxn_id = "B_" + rxn_id + else: + new_rxn_id = "F_" + rxn_id + # Apply median arrows - apply_arrow(metabMap_median, rxn_id, colors_median[rxn_id]) + apply_arrow(metabMap_median, new_rxn_id, colors_median[rxn_id]) # Apply mean arrows - apply_arrow(metabMap_mean, rxn_id, colors_mean[rxn_id]) + apply_arrow(metabMap_mean, new_rxn_id, colors_mean[rxn_id]) # Save and convert the SVG files save_and_convert(metabMap_mean, "mean", key) @@ -949,11 +955,11 @@ None """ arrow = Arrow(width=5, col=color) - arrow.styleReactionElements(metabMap, rxn_id, mindReactionDir=True) - '''idOpt1, idOpt2 = getArrowHeadElementId(rxn_id) + arrow.styleReactionElements(metabMap, rxn_id, mindReactionDir=False) + idOpt1, idOpt2 = getArrowHeadElementId(rxn_id) arrow.applyTo(idOpt1, metabMap, arrow.toStyleStr(downSizedForTips=True)) if idOpt2: - arrow.applyTo(idOpt2, metabMap, arrow.toStyleStr(downSizedForTips=True))''' + arrow.applyTo(idOpt2, metabMap, arrow.toStyleStr(downSizedForTips=True)) def save_and_convert(metabMap, map_type, key): """