Python wrapper for pgenlib's basic reader and writer.
Project description
This provides a basic Python API for pgenlib; see python_api.txt for details.
Build instructions
PyPI:
pip install 'pip>=20.3'
pip install Pgenlib
To build from GitHub instead, clone the repository:
# clone repo
git clone https://github.com/chrchang/plink-ng
# go to python folder
cd plink-ng/2.0/Python
Then install Cython and NumPy:
pip3 install "cython>=0.29.21" "numpy>=1.19.0"
and then build and install the package
python3 setup.py build_clib build_ext -i
python3 setup.py install
You can test the package with pytest
.
Example usage:
#write a 2 sample file
import numpy as np
import pgenlib as pg
with pg.PgenWriter("test.pgen".encode("utf-8"), 2, variant_ct=3, nonref_flags=False) as writer:
writer.append_alleles(np.array([0,1,1,1],dtype=np.int32))
writer.append_alleles(np.array([0,1,0,0],dtype=np.int32))
writer.append_alleles(np.array([0,0,0,0],dtype=np.int32))
See tests/test_pgenlib.py for more sophisticated examples.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file pgenlib-0.92.0.tar.gz
.
File metadata
- Download URL: pgenlib-0.92.0.tar.gz
- Upload date:
- Size: 1.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 805c87976d8371d5c33a1d87ba1bd2f08150805119b1ff0453bb2aca813b74f9 |
|
MD5 | 72cef722cfd98cf503b1a99d77acfff7 |
|
BLAKE2b-256 | 18ec5434c4a6012ef2ff12d0e71b6c341532686ee82d63e5101717abc24eb3f5 |
File details
Details for the file Pgenlib-0.92.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: Pgenlib-0.92.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 461.6 kB
- Tags: PyPy, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76962967efd246349fa1c33a0cd971505b440b226c5fda907b085c22e3e34a9d |
|
MD5 | a14dccea21b8e3295803921cbf80d7c8 |
|
BLAKE2b-256 | 76fbd19c30862a8f0dc8c6cd6114d9732a572a51aee6c8ddd2015bbb200b03be |
File details
Details for the file Pgenlib-0.92.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: Pgenlib-0.92.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1875f05956d08217adbf8750598dc564741ad6bda1d8f724f45dda9b740ecf66 |
|
MD5 | eeea8e80215a97ced9e45ac4cfb80562 |
|
BLAKE2b-256 | 8999b692da8386ff7b0dd80cf17f1be918127e3279d8878cdadf5494b70dd4f6 |
File details
Details for the file Pgenlib-0.92.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: Pgenlib-0.92.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.8 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56cc9715c3464f2d5559f0779cf671922c7651ed2aff3b851974968b86c167f7 |
|
MD5 | 09bc0c1b04fa134d4e49c76e95766ff2 |
|
BLAKE2b-256 | 552093ef95a37e1aa3c3dd2ca1cd1cba8c8849823311d034921c0ec38949ffad |
File details
Details for the file Pgenlib-0.92.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: Pgenlib-0.92.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.8 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa07107f71e0f143d60fd4f35fec2e642ef5be120eff519a7b4b778cb31d8f30 |
|
MD5 | 8cb86256a5eedb0d431adceb47dab4d2 |
|
BLAKE2b-256 | 2e9f16aafc4b071e2984e5f6e97e7217e775594241aa0bc968612692c6ef2f93 |
File details
Details for the file Pgenlib-0.92.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: Pgenlib-0.92.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eaed5814eb31904f56379355ecbad930b6d3f111ed94fcfc61a08eb84fd11b84 |
|
MD5 | 6af5ca64e7fcd5009700f3a83f6cffe8 |
|
BLAKE2b-256 | 65d597da5fb8739fcb73d091dd0149e15afa91878dac4c2d7bab3c0711458970 |
File details
Details for the file Pgenlib-0.92.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: Pgenlib-0.92.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.8 MB
- Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61ac8c05865556656cbc1a7da2d0414980deba61686518081061d032d6137e3d |
|
MD5 | 6863666a03974ed2fa0a79e86b7d44e8 |
|
BLAKE2b-256 | 378c0d1a73ad9c3654cc0d3bc30c8a7e67f0b84073f0d5a025848b62bcdf9925 |
File details
Details for the file Pgenlib-0.92.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: Pgenlib-0.92.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.8 MB
- Tags: CPython 3.6m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1386c756c6738d5273131924b31fdd491d438da7ac723d9faa7e5b6f42a3191 |
|
MD5 | a4831c78e01ffa475ae6081d58afba19 |
|
BLAKE2b-256 | 01959df0b9ed34aa7bb9151a53da10bf094ef35c5fbcfec5dcb42dbeeef3e19d |