Skip to main content

Parsing, validation, and analysis of BEL graphs

Project description

PyBEL is a Python software package that parses BEL scripts, validates their semantics, applies common graph algorithms, and facilitates data interchange between common formats and database systems like JSON, CSV, SQL, and Neo4J.

Stable

Stable Build Status

Stable Coverage Status

Stable Documentation Status

Development

Development Build Status

Development Coverage Status

Development Documentation Status

Biological Expression Language (BEL) is a domain specific language that enables the expression of complex molecular relationships and their context in a machine-readable form. Its simple grammar and expressive power have led to its successful use in the IMI project, AETIONOMY, to describe complex disease networks with several thousands of relationships.

PyBEL provides a simple API so bioinformaticians and scientists with limited programming knowledge can easily use it to interface with BEL graphs, but is built on a rich framework that can be extended to develop new algorithms.

>>> import pybel, networkx
>>> g = pybel.from_url('http://resource.belframework.org/belframework/1.0/knowledge/small_corpus.bel')
>>> networkx.draw(g)  # NOTE: requires matplotlib as a dependency, which isn't automatically installed

Command Line Interface

PyBEL also installs a command line interface with the command pybel for simple utilities such as data conversion. Need help? All logs go to ~/.pybel or add -v for verbose output to the standard error stream

Export for Cytoscape

This example retrieves a BEL file from a path and exports to a GraphML file for use in Cytoscape.

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

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

Export to Neo4j

This example retrieves a BEL file from a URL, and exports to Neo4j

$ URL="http://resource.belframework.org/belframework/1.0/knowledge/small_corpus.bel"
$ NEO="neo4j:neo4j@localhost:7474"
$
$ pybel convert --url $URL --neo $NEO

Multiple Export

This example gets a file from stdin and exports to multiple locations, with logging

$ URL="http://resource.belframework.org/belframework/1.0/knowledge/small_corpus.bel"
$ NEO="neo4j:neo4j@localhost:7474"
$
$ curl $URL | pybel convert --neo $NEO --json ~/Desktop/example.json --log-file ~/Desktop/log.txt

Installation

Current version on PyPI Stable Supported Python Versions Apache 2.0 License

PyBEL can be installed easily from PyPI with the following code in your favorite terminal:

pip install pybel

See the documentation for more advanced instructions. Also, check the change log at CHANGELOG.rst.

Contributing

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

Acknowledgements

Project details


Release history Release notifications | RSS feed

This version

0.3.6

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.3.6.tar.gz (1.5 MB view details)

Uploaded Source

File details

Details for the file PyBEL-0.3.6.tar.gz.

File metadata

  • Download URL: PyBEL-0.3.6.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyBEL-0.3.6.tar.gz
Algorithm Hash digest
SHA256 1757af8d382843e89ea27d58f66a0da4df09b40e1db2506b0d81638e15f2ab8a
MD5 599cf9edfb43f53b01d55d8ebaadec4c
BLAKE2b-256 80da4ceedc210542015ff8d3445b25ac1c8bdacfd772cd26509970e515eda746

See more details on using hashes here.

Supported by

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