Tellurium static model visualizations (pyvipr.tellurium_viz.static_viz)

class pyvipr.tellurium_viz.static_viz.TelluriumStaticViz(model)[source]

Class to generate static visualization of sbml models from tellurium

sp_comm_louvain_hierarchy_view(random_state=None)[source]

Use the Louvain algorithm https://en.wikipedia.org/wiki/Louvain_Modularity for community detection to find groups of nodes that are densely connected. It generates the data of all the intermediate clusters obtained during the Louvain algorithm generate to create a network with compound nodes that hold the communities.

Parameters

random_state (int, optional) – Random state seed use by the community detection algorithm, by default None

Returns

A Dictionary object that can be converted into Cytoscape.js JSON. This dictionary contains all the information (nodes,edges, parent nodes, positions) to generate a cytoscapejs network.

Return type

dict

sp_comm_louvain_view(random_state=None)[source]

Use the Louvain algorithm https://en.wikipedia.org/wiki/Louvain_Modularity for community detection to find groups of nodes that are densely connected. It generates the data to create a network with compound nodes that hold the communities.

Parameters

random_state (int, optional) – Random state seed use by the community detection algorithm, by default None

Returns

A Dictionary object that can be converted into Cytoscape.js JSON. This dictionary contains all the information (nodes,edges, parent nodes, positions) to generate a cytoscapejs network.

Return type

dict

sp_rxns_graph()[source]

Creates a bipartite nx.DiGraph graph where one set of nodes is the model species and the other set is the model bidirectional reactions.

Returns

Graph that has the information for the visualization of the model

Return type

nx.Digraph

sp_rxns_view()[source]

Generate a dictionary that contains the species and reactions network information

Returns

A Dictionary object that can be converted into Cytoscape.js JSON. This dictionary contains all the information (nodes,edges, positions) to generate a cytoscapejs network.

Return type

dict

sp_view()[source]

Generate a dictionary that contains the species network information

Returns

A Dictionary object that can be converted into Cytoscape.js JSON. This dictionary contains all the information (nodes,edges, positions) to generate a cytoscapejs network.

Return type

dict

species_graph()[source]

Creates a graph of the model species interactions :returns: Graph that has the information for the visualization of the model :rtype: nx.Digraph

Tellurium Dynamic model visualizations (pyvipr.tellurium_viz.dynamic_viz)

class pyvipr.tellurium_viz.dynamic_viz.TelluriumDynamicViz(sim_model, cmap='RdBu_r')[source]

class to visualize the dynamics of systems biology models defined in sbml or antimony format

Parameters
dynamic_sp_view(type_viz='consumption')[source]

Generates a dictionary with the model dynamics data that can be converted in the Cytoscape.js JSON format

Parameters

type_viz (str) – Type of the dynamic visualization, it can be ‘consumption’ or ‘production’

Returns

A Dictionary Object with all nodes and edges information that can be converted into Cytoscape.js JSON to be visualized

Return type

dict

edges_colors_sizes()[source]

This function obtains values for the size and color of the edges in the network. The color is a representation of the percentage of flux going through an edge. The edge size is a representation of the relative value of the reaction normalized to the maximum value that the edge can attain during the whole simulation.

Returns

Three dictionaries. The first one contains the information of the edge sizes at all time points. The second one contains the information of the edge colors at all time points. The third one contains the values of the reaction rates at all time points.

Return type

tuple

node_data()[source]

Obtains the species concentration values and the relative concentration compared with the maximum concentration across all time points

Returns

Two dictionaries. The first one has the species concentration. The second one has the relative species concentrations

Return type

tuple

Tellurium visualization views (pyvipr.tellurium_viz.views)

pyvipr.tellurium_viz.views.sp_view(model, layout_name='cose-bilkent')[source]

Render a visualization of the interactions between the species in a model.

Parameters
  • model (tellurium model) – Model to visualize. an SBML or BNGL model

  • layout_name (str) – Layout to use

pyvipr.tellurium_viz.views.sp_rxns_view(model, layout_name='cose-bilkent')[source]

Render a visualization of the interactions between the species and reactions in a model.

Parameters
  • model (tellurium model) – Model to visualize. an SBML or BNGL model

  • layout_name (str) – Layout to use

pyvipr.tellurium_viz.views.sp_comm_louvain_view(model, layout_name='klay', random_state=None)[source]

Render a visualization of the interactions between the species in a model. The species nodes are grouped by the communities detected by the Louvain algorithm: https://en.wikipedia.org/wiki/Louvain_Modularity.

Parameters
  • model (tellurium model) – Model to visualize.

  • layout_name (str) – Layout to use

  • random_state (int) – Random state seed use by the community detection algorithm

pyvipr.tellurium_viz.views.sp_dyn_view(simulation, process='consumption', layout_name='cose-bilkent', cmap='RdBu_r')[source]

Render a dynamic visualization of the simulation

Parameters
  • simulation (tellurium simulation) – Simulation to visualize

  • process (str) – Type of the dynamic visualization, it can be ‘consumption’ or ‘production’

  • layout_name (str) – Layout to use

  • cmap (str or Colormap instance) – The colormap used to map the reaction rate values to RGBA colors. For more information visit: https://matplotlib.org/3.1.0/tutorials/colors/colormaps.html

pyvipr.tellurium_viz.views.sp_comm_greedy_view(model, layout_name='klay')[source]

Render a visualization of the interactions between the species in a model. The species nodes are grouped by the communities detected by the Clauset-Newman-Moore greedy modularity maximization algorithm implemented in Networkx

Parameters
  • model (pysb.model or str) – Model to visualize. It can be a pysb model, or the file path to an an SBML or BNGL model

  • layout_name (str) – Layout to use

pyvipr.tellurium_viz.views.sp_comm_asyn_lpa_view(model, random_state=None, layout_name='klay')[source]

Render a visualization of the interactions between the species in a model. The species nodes are grouped by the communities detected by the asynchronous label propagation algorithm implemented in Networkx.

Parameters
  • model (pysb.model or str) – Model to visualize. It can be a pysb model, or the file path to an an SBML or BNGL model

  • layout_name (str) – Layout to use

  • random_state (int) – Random state seed use by the community detection algorithm

pyvipr.tellurium_viz.views.sp_comm_label_propagation_view(model, layout_name='klay')[source]

Render a visualization of the interactions between the species in a model. The species nodes are grouped by the communities detected by the label propagation algorithm implemented in Networkx.

Parameters
  • model (pysb.model or str) – Model to visualize. It can be a pysb model, or the file path to an an SBML or BNGL model

  • layout_name (str) – Layout to use

pyvipr.tellurium_viz.views.sp_comm_girvan_newman_view(model, layout_name='klay')[source]

Render a visualization of the interactions between the species in a model. The species nodes are grouped by the communities detected by the Girvan-Newman method implemented in Networkx.

Parameters
  • model (pysb.model or str) – Model to visualize. It can be a pysb model, or the file path to an an SBML or BNGL model

  • layout_name (str) – Layout to use

pyvipr.tellurium_viz.views.sp_comm_asyn_fluidc_view(model, k, max_iter=100, seed=None, layout_name='fcose')[source]

Render a visualization of the interactions between the species in a model. The species nodes are grouped by the communities detected by the asynchronous label propagation algorithm implemented in Networkx.

Parameters
  • model (pysb.model or str) – Model to visualize. It can be a pysb model, or the file path to an an SBML or BNGL model

  • k (int) – The number of communities to be found

  • max_iter (int) – The number of maximum iterations allowed

  • random_state (int) – Random state seed use by the community detection algorithm

  • layout_name (str) – Layout to use