Skip to main content

Parsing, validation, compilation, and data exchange of Biological Expression Language (BEL)

Project description

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.

Citation

If you find PyBEL useful for your work, please consider citing:

Installation Current version on PyPI Stable Supported Python Versions MIT License

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.

Getting Started

More examples can be found in the documentation and in the PyBEL Notebooks repository.

Compiling a BEL Graph

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.

Displaying a BEL Graph in Jupyter

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)

Using the CLI

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.

Contributing

Contributions, whether filing an issue, making a pull request, or forking, are appreciated. See CONTRIBUTING.rst for more information on getting involved.

Acknowledgements

Supporters

This project has been supported by several organizations:

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybel-0.14.4.tar.gz (353.1 kB view details)

Uploaded Source

Built Distribution

pybel-0.14.4-py3-none-any.whl (308.7 kB view details)

Uploaded Python 3

File details

Details for the file pybel-0.14.4.tar.gz.

File metadata

  • Download URL: pybel-0.14.4.tar.gz
  • Upload date:
  • Size: 353.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for pybel-0.14.4.tar.gz
Algorithm Hash digest
SHA256 b77b3445328fb2d1ceb3578c948e6be25d49158c64e801dce1fd7445760694b0
MD5 0e2a2694e0b191da4039009df304da6d
BLAKE2b-256 7f535b7085c497e8d6834dca0febe2ca095bfa351e88cbb6d78451c9c55a33d3

See more details on using hashes here.

Provenance

File details

Details for the file pybel-0.14.4-py3-none-any.whl.

File metadata

  • Download URL: pybel-0.14.4-py3-none-any.whl
  • Upload date:
  • Size: 308.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for pybel-0.14.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c6bc50b40c289fbfb283a12e2d739b3586b5f1d0c80b2ed3553326f43320dad6
MD5 ef521e2258420dfba996d68af8fe08dc
BLAKE2b-256 93364ab480a768c62496952f8b3f90a98ef6116daf4960ae2d3ddd4403d2ec08

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page