Skip to content

Commit 2c096e1

Browse files
committed
Add example using paths to README
1 parent 47f01d3 commit 2c096e1

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

README.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,18 @@ assert isinstance(right, pybiopax.biopax.Protein)
7373
assert right.display_name == 'ERK1-2-active'
7474
```
7575

76-
Each BioPaxObject has attributes that are consistent with the
77-
BioPAX level 3 specification.
76+
We can also use the `pybiopax.paths` module to construct iterators over
77+
objects based on a string specification from a given starting point.
78+
Continuing from the block of code above, we take the BiochemicalReaction
79+
`bcr` and link to reactants on its left hand side, then linking to their
80+
entity references, and finally linking back to all the physical entities
81+
that those are references of.
82+
83+
```python
84+
from pybiopax.paths import find_objects
85+
86+
erks = find_objects(bcr, 'left/entity_reference/entity_reference_of')
87+
```
7888

7989
Contribution and support
8090
------------------------

0 commit comments

Comments
 (0)