biosimulators_utils.viz.vega.escher package#

Submodules#

biosimulators_utils.viz.vega.escher.core module#

Utility for converting metabolic maps from Escher to Vega format

Author:

Jonathan Karr <karr@mssm.edu>

Date:

2021-02-06

Copyright:

2021, Center for Reproducible Biomedical Modeling

License:

MIT

biosimulators_utils.viz.vega.escher.core.escher_to_vega(reaction_fluxes_data_set, escher_filename, vega_filename, max_width_height=800, legend_padding=20, legend_width=40, signal_height=20, arrow_head_gap=16.0, indent=2, metabolic_map_data_file=None)[source]#

Convert a metabolic pathway map from Escher format to Vega format.

Parameters:
  • reaction_fluxes_data_set (dict) –

    Vega data set with each predicted reaction flux. The dictionary should have one of the following schemas

    • Contain a key values whose value is a list of the predicted flux values. Each predicted flux value should be a dictionary with two keys

      • label: value should be the BiGG identifier of the corresponding reaction

      • values: array with a single value equal to the predicted flux

    • Contain a key url whose value is a URL where the predicted flux values can be retrieved in JSON format. The data should be in the same format outlined above.

    • Contain a key sedmlUri whose value is an array which contains two elements that indicate

      • The location of the SED-ML file (within its parent COMBINE/OMEX archive) which will produce the flux predictions for the visualization

      • The id of the SED-ML report which will contain the flux predictions for the visualization

  • escher_filename (str) – path to the visualization in Escher format

  • vega_filename (str) – path to save the visualization in Vega format

  • max_width_height (int, optional) – maximum height/width of the metabolic map in pixels

  • legend_padding (int, optional) – horizontal spacing between the metabolic map and legend in pixels

  • legend_width (int, optional) – legend width in pixels, including the width of the title

  • signal_height (int, optional) – height of signals in pixels

  • arrow_head_gap (float, optional) – spacing between arrow heads and nodes

  • indent (int or None, optional) – indentation

  • metabolic_map_data_file (dict or None, optional) – If None, store the data for the metabolic map (e.g., coordinates of metabolites, reactions) inline within the generated Vega file. If not None, store the data for the metabolic map in a separate file to be loaded via a URL. In this case, the argument must be a dictionary which two keys, filename and url which indicate where the data should be saved and where this file will be hosted.

biosimulators_utils.viz.vega.escher.core.read_escher_map_config(filename)[source]#

Read the configuration of an Escher map from a file

Parameters:

filename (str) – path to a configuration of an Escher map

Returns:

configuration of an Escher map

Return type:

list