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, 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 there 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 use PyBEL in your work, please cite:
|||Hoyt, C. T., et al. (2017). PyBEL: a Computational Framework for Biological Expression Language. Bioinformatics, 34(December), 1–2.|
This example illustrates how the Selventa Small Corpus
can be loaded and visualized in a Jupyter Notebook. Note that this requires an extension, the
repository. This is not included by default because installing the Jupyter and iPython stack has a large footprint.
>>> import pybel, pybel_jupyter >>> graph = pybel.from_url('http://resources.openbel.org/belframework/20150611/knowledge/small_corpus.bel') >>> graph.number_of_nodes() # Will be smaller than expected because we have the most strict settings enabled 1207 >>> pybel_jupyter.to_jupyter(graph) # Need to pip install pybel-jupyter first
PyBEL also installs a command line interface with the command
pybel for simple utilities such as data
conversion. In this example, a BEL Script is exported to GraphML for viewing in Cytoscape.
$ pybel convert --path ~/Desktop/example.bel --graphml ~/Desktop/example.graphml
In Cytoscape, open with
Import > Network > From File.
PyBEL can be installed easily from PyPI with the following code in your favorite terminal:
$ python3 -m pip install pybel
or from the latest code on GitHub with:
$ python3 -m pip install git+https://github.com/pybel/pybel.git@develop
See the installation documentation for more advanced
instructions. Also, check the change log at
Contributions, whether filing an issue, making a pull request, or forking, are appreciated. See
CONTRIBUTING.rst for more information on getting involved. Please add your name to
- This package was originally developed as part of the master's work of Charles Tapley Hoyt at Fraunhofer SCAI.
- This software is proudly built with Paul McGuire's PyParsing package.
- Scott Colby designed our logo and provided sage advice
- Christian Ebeling for supervision and consultation