Skip to main content

A Python implementation of the BioPAX object model, and parts of PaxTools.

Project description

PyBioPAX: A python implementation of the BioPAX object model

License DOI Build Documentation PyPI version Python 3

PyBioPAX implements the BioPAX level 3 object model ( http://www.biopax.org/release/biopax-level3-documentation.pdf) as a set of Python classes. It exposes API functions to read OWL files into this object model, and to dump OWL files from this object model. This allows for the processing and creation of BioPAX models natively in Python.

Installation

PyBioPAX can be installed from PyPI as a package:

$ pip install pybiopax

Usage

Reading an OWL file into a BioPaxModel object:

import pybiopax
model = pybiopax.model_from_owl_file('test.owl')

Writing a BioPaxModel into an OWL file:

import pybiopax
pybiopax.model_to_owl_file(model, 'test.owl')

Querying Pathway Commons to get a BioPaxModel object:

import pybiopax
model = pybiopax.model_from_pc_query('pathsfromto', ['MAP2K1'], ['MAPK1'])

Working with the elements of the Python object model:

import pybiopax
model = pybiopax.model_from_pc_query('pathsfromto', ['MAP2K1'], ['MAPK1'])

# Each BioPaxModel instance has an objects attribute which is a dict
# whose keys are object URIs (strings) and values are BioPaxObject instances.
assert isinstance(model.objects, dict)
assert all(isinstance(obj, pybiopax.biopax.BioPaxObject)
           for obj in model.objects.values())

# Let's look at a specific object
bcr = model.objects['BiochemicalReaction_4f689747397d98089c551022a3ae2d88']

# This is a BiochemicalReaction which has a left and a right side. All list/set
# types per the BioPAX specification are represented as lists in the Python
# object model
# Both left and right consist of a single protein
left = bcr.left[0]
assert isinstance(left, pybiopax.biopax.Protein)
assert left.display_name == 'ERK1-2'
right = bcr.right[0]
assert isinstance(right, pybiopax.biopax.Protein)
assert right.display_name == 'ERK1-2-active'

Each BioPaxObject has attributes that are consistent with the BioPAX level 3 specification.

Funding

The development of PyBioPAX is funded under the DARPA Communicating with Computers program (ARO grant W911NF-15-1-0544).

Project details


Download files

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

Source Distribution

pybiopax-0.0.2.tar.gz (3.5 MB view details)

Uploaded Source

Built Distribution

pybiopax-0.0.2-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file pybiopax-0.0.2.tar.gz.

File metadata

  • Download URL: pybiopax-0.0.2.tar.gz
  • Upload date:
  • Size: 3.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.7.7

File hashes

Hashes for pybiopax-0.0.2.tar.gz
Algorithm Hash digest
SHA256 344c400c88e00cb09289aeeb3333083772cf7650501ac572f2cf9222b95cf872
MD5 f556974beb6ecd6037aa3da51dc96f84
BLAKE2b-256 440c377ce9e04018c10bad47ab8d4f08ef903004f5a129861371ad2e953de022

See more details on using hashes here.

File details

Details for the file pybiopax-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: pybiopax-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 15.0 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/46.1.3 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.7.7

File hashes

Hashes for pybiopax-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4dbcd1fbf6e4a4924245116039015556a3097d20e355f8a1c9850f20b38c06f0
MD5 b344ad843813cde941b3c38d1129f07b
BLAKE2b-256 c93f2fb307100ca7aff02d37593ce39d8020c019d7e4181a7af7677e7c8aa1aa

See more details on using hashes here.

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