PyBEL is a pure Python package for parsing and handling biological networks encoded in the Biological Expression Language (BEL). It also facilitates data interchange between common formats and databases such as NetworkX, JSON, JGIF, CSV, SIF, Cytoscape, CX, NDEx, SQL, and Neo4J.
Its companion package, PyBEL Tools, contains a suite of functions and pipelines for analyzing the resulting biological networks.
We realize that we have a name conflict with the python wrapper for the cheminformatics package, OpenBabel. If you're looking for their python wrapper, see here.
If you find PyBEL useful for your work, please consider citing:
[1] | Hoyt, C. T., et al. (2017). PyBEL: a Computational Framework for Biological Expression Language. Bioinformatics, 34(December), 1–2. |
PyBEL can be installed easily from PyPI with the following code in your favorite shell:
$ pip install pybel
or from the latest code on GitHub with:
$ pip install git+https://github.com/pybel/pybel.git
See the installation documentation for more advanced instructions. Also, check the change log at CHANGELOG.rst.
Note: while PyBEL works on the most recent versions of Python 3.5, it does not work on 3.5.3 or below due to changes
in the typing
module.
More examples can be found in the documentation and in the PyBEL Notebooks repository.
This example illustrates how the a BEL document from the Human Brain Pharmacome project can be loaded from GitHub.
>>> import pybel
>>> url = 'https://raw.githubusercontent.com/pharmacome/knowledge/master/hbp_knowledge/proteostasis/kim2013.bel'
>>> graph = pybel.from_url(url)
PyBEL can handle BEL 1.0 and BEL 2.0+ simultaneously.
After installing jinja2
and ipython
, BEL graphs can be displayed in Jupyter notebooks.
>>> from pybel.examples import sialic_acid_graph
>>> from pybel.io.jupyter import to_jupyter
>>> to_jupyter(sialic_acid_graph)
PyBEL also installs a command line interface with the command pybel
for simple utilities such as data
conversion. In this example, a BEL document is compiled then exported to GraphML
for viewing in Cytoscape.
$ pybel compile ~/Desktop/example.bel
$ pybel serialize ~/Desktop/example.bel --graphml ~/Desktop/example.graphml
In Cytoscape, open with Import > Network > From File
.
Contributions, whether filing an issue, making a pull request, or forking, are appreciated. See CONTRIBUTING.rst for more information on getting involved.
This project has been supported by several organizations:
- University of Bonn
- Bonn Aachen International Center for IT
- Fraunhofer Institute for Algorithms and Scientific Computing
- Fraunhofer Center for Machine Learning
- The Cytoscape Consortium
The PyBEL logo was designed by Scott Colby.