PyBioPAX: A python implementation of the BioPAX object model
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.
Gyori BM, Hoyt CT (2022). PyBioPAX: biological pathway exchange in Python. Journal of Open Source Software, 7(71), 4136, https://doi.org/10.21105/joss.04136
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'
We can also use the pybiopax.paths module to construct iterators over
objects based on a string specification from a given starting point.
Continuing from the block of code above, we take the BiochemicalReaction
bcr and link to reactants on its left hand side, then linking to their
entity references, and finally linking back to all the physical entities
that those are references of.
from pybiopax.paths import find_objects
erks = find_objects(bcr, 'left/entity_reference/entity_reference_of')
Contribution and support
To contribute to the code, please submit a pull request after reading the contribution guidelines. To report bugs and issues, or ask questions related to PyBioPAX, please submit an issue.
Funding
Development of this software was supported by the Defense Advanced Research Projects Agency under award W911NF-15-1-0544 and the National Cancer Institute under award U54-CA225088.
Metadata
Release files for pybiopax 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pybiopax-0.1.5.tar.gz | 3.7 MB | Without provenance | Details for pybiopax-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pybiopax-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for pybiopax-0.1.5-py3-none-any.whl |
Total release size: 3.7 MB
Release files / pybiopax-0.1.5.tar.gz
| Download URL | pybiopax-0.1.5.tar.gz |
|---|---|
| Size | 3.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0e0bf410592c36c32c0428d8f64fca65aac69293859b0d233815ae62ceca547c
|
|
BLAKE2b-256 checksum How to use checksums |
0c174288bc531ab56e177894b7064b28fc0da844b25b0bfd4225e764cde80f76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.13
|
Release files / pybiopax-0.1.5-py3-none-any.whl
| Download URL | pybiopax-0.1.5-py3-none-any.whl |
|---|---|
| Size | 24.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8f75ce10af61d0909f77b0cb178eeacc718976bd5e3368dc57d9bc5335d54d90
|
|
BLAKE2b-256 checksum How to use checksums |
59910b2b61b643f9c8aecbc9fca8063c617ac5be69614264c86b954d4e65fdf3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.13
|
Security for pybiopax 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.