Skip to content

Commit

Permalink
Expand READMEs about flatgfa-py
Browse files Browse the repository at this point in the history
  • Loading branch information
sampsyo committed May 16, 2024
1 parent 1afd8cd commit c44d6ab
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 14 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ Now type `slow_odgi --help` to see if everything's working.
[mygfa-docs]: http://cucapra.github.io/pollen/mygfa/


FlatGFA
-------

[FlatGFA](./flatgfa) is an efficient representation for GFA files. It is implemented in Rust and available with [Python bindings](./flatgfa-py). The latter is [on PyPI][flatgfa-pypi], so you can get started with:

$ pip install flatgfa

Then read the [API documentation][flatgfa-py-docs] to see what's available. Or see [the included example](./flatgfa-py/example.py) for a synopsis.

[flatgfa-pypi]: https://pypi.org/project/flatgfa/


Credits
-------

Expand Down
41 changes: 27 additions & 14 deletions flatgfa-py/README.md
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

0 comments on commit c44d6ab

Please sign in to comment.