# HG changeset patch # User luca_milaz # Date 1722787336 0 # Node ID 3671d7cb4eaf4caa8a009fffb362fedf7926b52b # Parent 0f853c2a6e75e359bc72c9fdd3278299ce3ff548 Uploaded diff -r 0f853c2a6e75 -r 3671d7cb4eaf marea_2/flux_to_map.py --- a/marea_2/flux_to_map.py Sun Aug 04 15:45:26 2024 +0000 +++ b/marea_2/flux_to_map.py Sun Aug 04 16:02:16 2024 +0000 @@ -854,8 +854,7 @@ colors_median={} i=0 for rxn_id in ids: - #colors_median[rxn_id] = rgba_to_hex(reds_cmap(medians[key][i])) - colors_median[rxn_id] = "#008000" + colors_median[rxn_id] = rgba_to_hex(reds_cmap(medians[key][i])) i+=1 colors_mean={} @@ -869,8 +868,18 @@ arrow.applyTo(arrow.getMapReactionId(rxn_id, mindReactionDir=False), metabMap_median, arrow.toStyleStr()) # Now we style the arrow head(s): idOpt1, idOpt2 = getArrowHeadElementId(arrow.getMapReactionId(rxn_id, mindReactionDir=False)) - arrow.applyTo(idOpt1, metabMap, arrow.toStyleStr(downSizedForTips = True)) - if idOpt2: arrow.applyTo(idOpt2, metabMap, arrow.toStyleStr(downSizedForTips = True)) + arrow.applyTo(idOpt1, metabMap_median, arrow.toStyleStr(downSizedForTips = True)) + if idOpt2: arrow.applyTo(idOpt2, metabMap_median, arrow.toStyleStr(downSizedForTips = True)) + + arrow = Arrow(width=5, col=colors_mean[rxn_id]) + arrow.applyTo(arrow.getMapReactionId(rxn_id, mindReactionDir=False), metabMap_mean, arrow.toStyleStr()) + # Now we style the arrow head(s): + idOpt1, idOpt2 = getArrowHeadElementId(arrow.getMapReactionId(rxn_id, mindReactionDir=False)) + arrow.applyTo(idOpt1, metabMap_mean, arrow.toStyleStr(downSizedForTips = True)) + if idOpt2: arrow.applyTo(idOpt2, metabMap_mean, arrow.toStyleStr(downSizedForTips = True)) + + svgFilePath = utils.FilePath("SVG Map mean - class " + str(key), ext = utils.FileFormat.SVG, prefix="result") + utils.writeSvg(svgFilePath, metabMap_mean) svgFilePath = utils.FilePath("SVG Map median - class " + str(key), ext = utils.FileFormat.SVG, prefix="result") utils.writeSvg(svgFilePath, metabMap_median)