# HG changeset patch # User luca_milaz # Date 1722863437 0 # Node ID afaa7bcc730eef81db71f65a01a47a1f26a609e8 # Parent fbda3a0cc8b1be4ee246c3f711ff395e72a204aa Uploaded diff -r fbda3a0cc8b1 -r afaa7bcc730e marea_2/flux_to_map.py --- a/marea_2/flux_to_map.py Mon Aug 05 13:05:27 2024 +0000 +++ b/marea_2/flux_to_map.py Mon Aug 05 13:10:37 2024 +0000 @@ -904,8 +904,8 @@ metabMap_median = copy.deepcopy(metabMap) # Compute medians and means - medians = {key: np.median(np.array(value), axis=1) for key, value in class_pat.items()} - means = {key: np.mean(np.array(value), axis=1) for key, value in class_pat.items()} + medians = {key: np.round(np.median(np.array(value), axis=1), 6) for key, value in class_pat.items()} + means = {key: np.round(np.mean(np.array(value), axis=1),6) for key, value in class_pat.items()} # Normalize medians and means max_flux_medians = max(np.max(np.abs(arr)) for arr in medians.values()) @@ -925,12 +925,12 @@ for key in class_pat: # Create color mappings for median and mean colors_median = { - rxn_id: rgb_to_hex(cmap(abs(np.round(medians[key][i], 6)))) if medians[key][i] != 0 else '#bebebe' #grey blocked + rxn_id: rgb_to_hex(cmap(abs(medians[key][i]))) if medians[key][i] != 0 else '#bebebe' #grey blocked for i, rxn_id in enumerate(ids) } colors_mean = { - rxn_id: rgb_to_hex(cmap(abs(np.round(means[key][i], 6)))) if means[key][i] != 0 else '#bebebe' #grey blocked + rxn_id: rgb_to_hex(cmap(abs(means[key][i]))) if means[key][i] != 0 else '#bebebe' #grey blocked for i, rxn_id in enumerate(ids) }