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 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
Pgenlib-0.90.2.tar.gz
(1.4 MB
view hashes)
Built Distributions
Close
Hashes for Pgenlib-0.90.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9a37c7a424f3157de7f45578f3cdf374a5a140e9afb6c7d233d1dfcdcecbfed |
|
MD5 | 0fe32f1607f558050c8850982b9673a5 |
|
BLAKE2b-256 | 8dfb778474f5bf817493b7045c6b1683f35e93a86920c7c6f3f33465f09a874e |
Close
Hashes for Pgenlib-0.90.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd597f6b636475e9e8c43fda45b5e7b623e76eebf8ac7fa85e2d037f5aed43fe |
|
MD5 | 077b9d4442981bb062de13c75ce8270a |
|
BLAKE2b-256 | 87bd4fa502ecdd6b567344b45d95a23646200aa29f37aca0aa1ec1964d63c266 |
Close
Hashes for Pgenlib-0.90.2-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81651d8e1e64c2169e560f7cb6409161cf4c31d24a0c3fd3f49cb7dae51ccc67 |
|
MD5 | e313f46b1f4916278fbcb2c040aa6a0a |
|
BLAKE2b-256 | 898a0923185576ae4c3e2fd78f3f409f0ad88c64386f0d5805343d56dc9915a4 |
Close
Hashes for Pgenlib-0.90.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 683b879ab760fc07a5772519b97c8135fc8929fd609803727220051784159243 |
|
MD5 | 093eca663264470020fd29af9edb88bb |
|
BLAKE2b-256 | 146969b3665864ef6393949d8cdf702e4d8404ae316c6d549f73eb83e6e7577b |
Close
Hashes for Pgenlib-0.90.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96c3597570d72b1cab1d6114cb4e68b979dc09cf43e66164b89e68ff56dc09c2 |
|
MD5 | 286677a0c8cffa8e83bad72db2735cbe |
|
BLAKE2b-256 | 0c80d561e55243fd241b2a62e6a53c4ce417fbd45262eb88deddd4ca0919d59b |
Close
Hashes for Pgenlib-0.90.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33acb019041131df384f5a2e4748e206ba6dc0419d2b487252183b1576ff8ad3 |
|
MD5 | 516526ecd3515db61910159538adbfab |
|
BLAKE2b-256 | dd434ba76d0de21abf47f3f01ddd48d0c75fb69b7c341af63ce0501c81eeee11 |
Close
Hashes for Pgenlib-0.90.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b4b694ad89b64ce8d85f615d9a88f9b6f08086a44badf41fabf0799ea43d07a |
|
MD5 | 057e4f4d4192bf643149e715b6261ef1 |
|
BLAKE2b-256 | a833d2a53933f482f12f67c6b0b3a4cc23db48452c10ed66f5508c69a4ea256f |
Close
Hashes for Pgenlib-0.90.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0ce76e36c39f1290ff128c6737633187369f62e50b4b778b25b2c3795c10638 |
|
MD5 | 8a42d4fdac2d5df0133481b879fde97f |
|
BLAKE2b-256 | e7ed79bb17524d472dc9538acca2c02c7048a74134606b22b35b22274b572acd |
Close
Hashes for Pgenlib-0.90.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16208477f273f1184dee217bd24c25c83d44946b4485148f0d7bf71ad2ed83a9 |
|
MD5 | 16cac5187b21f2f10f7b433649fd2789 |
|
BLAKE2b-256 | 20847a2c2509d2f998d92884c4dd68b2003eafe11cafa45728cdbbb2c19ef89e |