Producing more colors in sensitivity analysis #74
-
Hi @himoto , I am Aryaman Joshi, currently working over the EGFR-Ras signaling network using biomass. I am trying to perform sensitivity analysis and am getting the following error:
I understand there is a requirement of producing colors equal to the conditions in my model (51) and tried to deal with it in a similar manner as done in SingleObservable() in viz.py. However, upon doing so I realized that sensitivity_options is not subscriptable as SensitivityOptions() accepts only one parameter. Could you please let me know how to produce different colors for my model conditions? Regards, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @aryaman3900, Thank you very much for using biomass! def get_single_observable_options(self):
cm_name = 'jet'
get_cmap = plt.cm.get_cmap(cm_name)
colors = get_cmap(np.linspace(0, 1, 51))
for i, _ in enumerate(self.obs_names):
self.single_observable_options[i].cmap = [colors[j] for j in range(51)]
self.single_observable_options[i].shape = list(Line2D.filled_markers) * 4
return self.single_observable_options To use the same colormap for sensitivity analysis, you need to modify def get_sensitivity_options(self):
cm_name = 'jet'
get_cmap = plt.cm.get_cmap(cm_name)
colors = get_cmap(np.linspace(0, 1, 51))
self.sensitivity_options.cmap = [colors[j] for j in range(51)]
return self.sensitivity_options I think this would work, but currently it is very difficult to visualize the result of sensitivity analysis as barplot when a model contains dozens of simulation conditions. I recommend you to start from around 5 conditions. Please do let me know if the problem still persists. Best, |
Beta Was this translation helpful? Give feedback.
Hi @aryaman3900,
Thank you very much for using biomass!
If I remember correctly, you produced 51 colors for SingleObservable() via:
To use the same colormap for sensitivity analysis, you need to modify
get_sensitivity_opttions
as follows: