-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
39 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,43 @@ | ||
# Python Bindings for FlatGFA | ||
Python Bindings for FlatGFA | ||
=========================== | ||
|
||
This is a Python wrapper for the FlatGFA library. | ||
Read [the API documentation][flatgfa-py-docs] for details about what it can do so far. | ||
This is a Python interface for the [FlatGFA][] library, which provides an efficient representation for pangenomic variation graphs in the [Graphical Fragment Assembly (GFA)][gfa] format. | ||
|
||
To build it, first install [Maturin][]: | ||
You can install it [from PyPI][flatgfa-pypi]: | ||
|
||
pipx install maturin | ||
$ pip install flatgfa | ||
|
||
Then, read [the API documentation][flatgfa-py-docs] for details about what it can do so far. | ||
|
||
Development | ||
----------- | ||
|
||
To build this library, first install [Maturin][]: | ||
|
||
$ pipx install maturin | ||
|
||
Next, we'll build and install the Python library in our virtualenv. | ||
Starting from the repository root: | ||
|
||
uv venv # Unless you already created the virtualenv. | ||
uv pip install pip # Maturin depends on pip. | ||
source .venv/bin/activate | ||
cd flatgfa-py | ||
maturin develop | ||
$ uv venv # Unless you already created the virtualenv. | ||
$ uv pip install pip # Maturin depends on pip. | ||
$ source .venv/bin/activate | ||
$ cd flatgfa-py | ||
$ maturin develop | ||
|
||
Now the `flatgfa` module is available to Python programs. | ||
Try our example: | ||
Try our [example][]: | ||
|
||
python example.py | ||
$ python example.py | ||
|
||
Or run the tests: | ||
|
||
uv pip install pytest | ||
pytest | ||
$ uv pip install pytest | ||
$ pytest | ||
|
||
[maturin]: https://www.maturin.rs | ||
[flatgfa-py-docs]: https://cucapra.github.io/pollen/flatgfa/ | ||
[flatgfa]: https://github.com/cucapra/pollen/tree/main/flatgfa | ||
[gfa]: https://github.com/GFA-spec/GFA-spec/blob/master/GFA1.md | ||
[flatgfa-pypi]: https://pypi.org/project/flatgfa/ | ||
[example]: https://github.com/cucapra/pollen/blob/main/flatgfa-py/example.py |