Cookbook

An extensive set of examples can be found on the PyBEL Notebooks repository on GitHub. These notebooks contain basic usage and also make numerous references to the analytical package PyBEL Tools

Configuration

The default connection string can be set as an environment variable in your ~/.bashrc. If you’re using MySQL or MariaDB, it could look like this:

$ export PYBEL_CONNECTION="mysql+pymysql://user:password@server_name/database_name?charset=utf8"

Prepare a Cytoscape Network

Load, compile, and export to Cytoscape format:

$ pybel convert --path ~/Desktop/example.bel --graphml ~/Desktop/example.graphml

In Cytoscape, open with Import > Network > From File.