-
Notifications
You must be signed in to change notification settings - Fork 79
Python API Reference
visbio includes a Python package for building maps. Maps generated with the Python API can be viewed in a browser, shared as standalone HTML files, or displayed directly in an IPython Notebook.
The Python package for visbio can be installed using pip:
pip install visbioAlternatively, one can download the source files and install the package directly:
python setup.py installWhen a Map object is created, the map data is automatically downloaded and cached locally. A list of map IDs that are available are kept up-to-date at http://zakandrewking.github.io/visbio/.
Map(map_name="e-coli-core", flux={})
Generates a new Map object.
-
map_name: This is the map ID available from http://zakandrewking.github.io/visbio/. The map data will be downloaded when Map() is called, if it is not already cached.
-
flux: A dictionary with reaction IDs as keys and flux values as keys.
create_standalone_html(outfilepath=None)
Outputs the maps as a standalone HTML file. Supply outfilepath to save the file to a particular location. If outfilepath is not supplied, then a temporary file is generated and displayed. Paste this file path into a web browser to view the map.
view_browser()
Generates a temporary HTML file and launches it with the default application. Note: If .html files are associated with an application other than your browser, then this function will not behave as advertised. The create_standalone_html() function is a safer bet.