Visualize simulations, interactively

This module implements functions to visualize simulation results interactively using altair.

plot_ensemble_interactive(data_df: DataFrame, quant_type, selected_data: Optional[list] = None, x_scale: str = 'linear', y_scale: str = 'linear', x_lim: Optional[tuple] = None, y_lim: Optional[tuple] = None)

Takes in a pandas dataframe with median and 1st and 3rd quartile concentration or flux values calculated over all models in the ensemble for each time point, and plots them using altair. The median is represented by a line, and uncertainty is given by the 25% quantile and the 75% one.

Parameters
  • data_df – dataframe with summarized concentration or flux data for each time point.

  • quant_type – the column name for the concentrations or fluxes to be plotted.

  • selected_data – a list of metabolite or reaction names whose concentrations or fluxes will be plotted.

  • x_scale – whether the x-scale should be log, symlog, or linear.

  • y_scale – whether the y-scale should be log, symlog, or linear.

  • x_lim – the limits for the x-axis.

  • y_lim – the limits for the y-axis.

Returns

An altair plot with the median, 1st quartile, and 3rd quartile metabolite concentrations or reaction fluxes.

plot_model_interactive(data_df: DataFrame, model_i: int, quant_type: str, selected_data: list, x_scale: str = 'linear', y_scale: str = 'linear', x_lim: Optional[tuple] = None, y_lim: Optional[tuple] = None)

Given a pandas dataframe with metabolite concentrations or reaction fluxes, it plots the selected ones (specified in selected data) for the selected model. The plots are made using altair.

Parameters
  • data_df – dataframe with metabolite concentrations or reaction fluxes.

  • model_i – number of the model to plot.

  • quant_type – the column name for the concentrations or fluxes to be plotted.

  • selected_data – a list of metabolite or reaction names whose concentrations or fluxes will be plotted.

  • x_scale – whether the x-scale should be log, symlog, or linear.

  • y_scale – whether the y-scale should be log, symlog, or linear.

  • x_lim – the limits for the x-axis.

  • y_lim – the limits for the y-axis.

Returns

An altair plot with the selected metabolite concentrations or reaction fluxes plotted for a given model.