Skip to main content

Genotype Representation Graph Library

Project description

Genotype Representation Graph Library (GRGL)

GRGL can be used as a library in both C++ and Python. Support is currently limited to Linux and MacOS. It contains both an API (see docs) and a set of command-line tools.

Installing from pip

If you just want to use the tools (e.g., constructing GRG or converting tree-sequence to GRG) and the Python API then you can install via pip (from PyPi).

pip install pygrgl

This will use prebuilt packages for most modern Linux situations, and will build from source for MacOS. In order to build from source it will require CMake (at least v3.14), zlib development headers, and a clang or GCC compiler that supports C++11.

Building (C++ only)

Make sure you clone with git clone --recursive!

If you only intend to use GRGL from C++, you can just build it via CMake:

mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j4

See below to install the libraries to your system. It is recommended to install it to a custom location (prefix) since removing packages installed via make install is a pain otherwise. Example:

mkdir /path/to/grgl_installation/
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/path/to/grgl_installation/
make -j4
make install
# There should now be bin/, lib/, etc., directories under /path/to/grgl_installation/

Building (Python)

Make sure you clone with git clone --recursive!

Requires Python 3.7 or newer to be installed (including development headers). It is recommended that you build/install in a virtual environment.

python3 -m venv /path/to/MyEnv
source /path/to/MyEnv/bin/activate
python setup.py bdist_wheel               # Compiles C++, builds a wheel in the dist/ directory
pip install --force-reinstall dist/*.whl  # Install from wheel

Build and installation should take at most a few minutes on the typical computer. For more details on build options, see DEVELOPING.md.

Building (Docker)

We've included a Dockerfile if you want to use GRGL in a container.

Example to build:

docker build . -t grgl:latest

Example to run, constructing a GRG from an example VCF file:

docker run -v $PWD:/working -it grgl:latest bash -c "cd /working && grg construct /working/test/inputs/msprime.example.vcf

Usage (Command line)

There is a command line tool that is mostly for file format conversion and performing common computations on the GRG. For more flexibility, use the Python or C++ APIs. After building and installing the Python version, run grg --help to see all the command options. Some examples are below.

Convert a tskit tree-sequence into a GRG. This creates my_arg_data.grg from my_arg_data.trees:

grg convert /path/to/my_arg_data.trees my_arg_data.grg

Load a GRG and emit some simple statistics about the GRG itself:

grg process stats my_arg_data.grg

To construct a GRG from a VCF file, use the grg construct command:

grg construct --parts 20 -j 1 path/to/foo.vcf

Construction for small datasets (such as those included as tests in this repository) should be very fast, a few minutes at most. Really large datasets (such as Biobank-scale) can take on the order of a day when using lots of threads (e.g., 70).

Usage (Python API)

See the provided jupyter notebooks and GettingStarted.md for more examples.

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

pygrgl-1.3.tar.gz (7.6 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pygrgl-1.3-cp312-cp312-manylinux_2_24_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64

pygrgl-1.3-cp311-cp311-manylinux_2_24_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64

pygrgl-1.3-cp310-cp310-manylinux_2_24_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64

pygrgl-1.3-cp39-cp39-manylinux_2_24_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.24+ x86-64

pygrgl-1.3-cp38-cp38-manylinux_2_24_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.24+ x86-64

File details

Details for the file pygrgl-1.3.tar.gz.

File metadata

  • Download URL: pygrgl-1.3.tar.gz
  • Upload date:
  • Size: 7.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for pygrgl-1.3.tar.gz
Algorithm Hash digest
SHA256 1c126a1de2b9106753109d5e4542face1e5e94fd5898809b175acd7102765b7e
MD5 b758247ce6f31256bfe43016a1cca719
BLAKE2b-256 9b2c17bc1044c0f20a428832e8c5e62fa8d69b79bc5e41c58abf7e3ee2e3bb33

See more details on using hashes here.

File details

Details for the file pygrgl-1.3-cp312-cp312-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pygrgl-1.3-cp312-cp312-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 a2f398e20dc67200f9a0e659d5eda1072aaf699b7a33a0a28df2c4dba9a5942b
MD5 11703d1e51d1a29d13403d5433d1e15d
BLAKE2b-256 27a33d828f1311c43872c52c8d17db910f7dfd90c05944de93a68567960ae896

See more details on using hashes here.

File details

Details for the file pygrgl-1.3-cp311-cp311-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pygrgl-1.3-cp311-cp311-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 31a2a5d2a3d8d1f0022a6ed1381647f81a2cd61ce1a2023062aaaf897c14c15e
MD5 5646d7d21329170a488b41770d28fe77
BLAKE2b-256 a393d6205fddb9e8cb6d194f0bb229184bc2a3a74c50f82c24a5dce9f56719dd

See more details on using hashes here.

File details

Details for the file pygrgl-1.3-cp310-cp310-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pygrgl-1.3-cp310-cp310-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 d4779f04fa26642bdc4c34f58fe53fa4ffd83ce5c21ab8a96aa4e17cc306ec6c
MD5 d2038ea6527a6c330d9f956375644e0c
BLAKE2b-256 53e987803b83754e3e6b4c8ef63e28e160e739b8a5af5fdbb0886e555e0af974

See more details on using hashes here.

File details

Details for the file pygrgl-1.3-cp39-cp39-manylinux_2_24_x86_64.whl.

File metadata

  • Download URL: pygrgl-1.3-cp39-cp39-manylinux_2_24_x86_64.whl
  • Upload date:
  • Size: 3.0 MB
  • Tags: CPython 3.9, manylinux: glibc 2.24+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for pygrgl-1.3-cp39-cp39-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 a72b66885a07dcfff5731d49216d163523a7788ea5cd88f105a88370296d87ee
MD5 1b121bfe2b54e76b4f9defdfc029a112
BLAKE2b-256 187054e6e8b94b2bef014d95bb0e6e97622c84461a10fdc448a86f3a22b76a24

See more details on using hashes here.

File details

Details for the file pygrgl-1.3-cp38-cp38-manylinux_2_24_x86_64.whl.

File metadata

  • Download URL: pygrgl-1.3-cp38-cp38-manylinux_2_24_x86_64.whl
  • Upload date:
  • Size: 3.0 MB
  • Tags: CPython 3.8, manylinux: glibc 2.24+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for pygrgl-1.3-cp38-cp38-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 c2d715ad060583183b8106a5dafae4ed220298e5f88e0e28459c0ddc65db7ea5
MD5 003f3578545d99d3d89b47e2cb345ef0
BLAKE2b-256 01793dc4b2924011575bf26a0a00818abcb3cfbe86d31b9379bfd67f06ba9719

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page