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.
Metadata
Release files for pgenlib 0.92.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pgenlib-0.92.0.tar.gz | 1.4 MB | Details |
Built distributions (wheels)
Total release size: 18.9 MB
Release files / pgenlib-0.92.0.tar.gz
| Download URL | pgenlib-0.92.0.tar.gz |
|---|---|
| Size | 1.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
805c87976d8371d5c33a1d87ba1bd2f08150805119b1ff0453bb2aca813b74f9
|
|
BLAKE2b-256 checksum How to use checksums |
18ec5434c4a6012ef2ff12d0e71b6c341532686ee82d63e5101717abc24eb3f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.1
|
Release files / Pgenlib-0.92.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | Pgenlib-0.92.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 461.6 kB |
| Tags | Linux glibc 2.17+ x86-64 PyPy 3.7 PyPy 3.7 7.3 |
|
SHA-256 checksum How to use checksums |
76962967efd246349fa1c33a0cd971505b440b226c5fda907b085c22e3e34a9d
|
|
BLAKE2b-256 checksum How to use checksums |
76fbd19c30862a8f0dc8c6cd6114d9732a572a51aee6c8ddd2015bbb200b03be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.2
|
Release files / Pgenlib-0.92.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | Pgenlib-0.92.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
1875f05956d08217adbf8750598dc564741ad6bda1d8f724f45dda9b740ecf66
|
|
BLAKE2b-256 checksum How to use checksums |
8999b692da8386ff7b0dd80cf17f1be918127e3279d8878cdadf5494b70dd4f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.2
|
Release files / Pgenlib-0.92.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | Pgenlib-0.92.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
56cc9715c3464f2d5559f0779cf671922c7651ed2aff3b851974968b86c167f7
|
|
BLAKE2b-256 checksum How to use checksums |
552093ef95a37e1aa3c3dd2ca1cd1cba8c8849823311d034921c0ec38949ffad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.2
|
Release files / Pgenlib-0.92.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | Pgenlib-0.92.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
aa07107f71e0f143d60fd4f35fec2e642ef5be120eff519a7b4b778cb31d8f30
|
|
BLAKE2b-256 checksum How to use checksums |
2e9f16aafc4b071e2984e5f6e97e7217e775594241aa0bc968612692c6ef2f93
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.2
|
Release files / Pgenlib-0.92.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | Pgenlib-0.92.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
eaed5814eb31904f56379355ecbad930b6d3f111ed94fcfc61a08eb84fd11b84
|
|
BLAKE2b-256 checksum How to use checksums |
65d597da5fb8739fcb73d091dd0149e15afa91878dac4c2d7bab3c0711458970
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.2
|
Release files / Pgenlib-0.92.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | Pgenlib-0.92.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
61ac8c05865556656cbc1a7da2d0414980deba61686518081061d032d6137e3d
|
|
BLAKE2b-256 checksum How to use checksums |
378c0d1a73ad9c3654cc0d3bc30c8a7e67f0b84073f0d5a025848b62bcdf9925
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.2
|
Release files / Pgenlib-0.92.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | Pgenlib-0.92.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
c1386c756c6738d5273131924b31fdd491d438da7ac723d9faa7e5b6f42a3191
|
|
BLAKE2b-256 checksum How to use checksums |
01959df0b9ed34aa7bb9151a53da10bf094ef35c5fbcfec5dcb42dbeeef3e19d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.2
|