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
To build from GitHub, 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
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.0.tar.gz
(1.1 MB
view hashes)
Built Distributions
Close
Hashes for Pgenlib-0.90.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | adc48ab98cb70e9c303cb7764d0cc7d416acac9de0d164b756514797ad64a2e6 |
|
MD5 | fc5f709516f14de4b01a6581513a9e53 |
|
BLAKE2b-256 | 4560dd584321eedc419f7b1aee92fc15110070714ca949ee012bf5dddffec6cf |
Close
Hashes for Pgenlib-0.90.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f279914c09a7721479efc775313af204490016266f2b25fff5d09e6c5900b4f |
|
MD5 | aa6f40085ee3b0a2a319c7db209ce414 |
|
BLAKE2b-256 | 05cc185166c604f18f1d60291fd0d407d6c02b26e712af8e39bfaabfe9be57ce |
Close
Hashes for Pgenlib-0.90.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e63d5f3b7fc91cbf3f9f70afc866525e040e253144990d1411323c11a903b19 |
|
MD5 | cb5f76fd10bfb3441f7f37dde603313d |
|
BLAKE2b-256 | f3b001e1c04e3fe156252d1ebb82f362da5642a128d72c5a67c481b26986d450 |
Close
Hashes for Pgenlib-0.90.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb2c64c50511141161674d5b568e054f0e012b3bd2d8f21c829aa3f34f11c6c0 |
|
MD5 | 8ec58ab4b3988c220c7c2997d86be372 |
|
BLAKE2b-256 | 95af14f03aa5e6568810347aef280eb57b82a5a45e03f33c9653d56685a5157c |
Close
Hashes for Pgenlib-0.90.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d124da3e8ab9ad66a0248e664502fb110c87acece1ea5826844da8361415c6ac |
|
MD5 | baa8c0f324ce2aba496ab8d4850e9086 |
|
BLAKE2b-256 | 4345b23b200529cc05e27de60c6623e3c272f3babacd46ba7ca04f8ba8cee212 |
Close
Hashes for Pgenlib-0.90.0-cp310-cp310-macosx_13_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de846a2c389cadb6c098603f736c44f8f6d7c6356a54bd4855004c7a8ed7a288 |
|
MD5 | 7fc8acb4c94ffdb457ae796271e7cff8 |
|
BLAKE2b-256 | 16245e5f3f751fc014e67c567073089e5ff22887c890ddcb33b2eee234b2ff66 |
Close
Hashes for Pgenlib-0.90.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89f22566a61bca2e12acab41a389ab353c4853fa55994704d81d112a1d4782da |
|
MD5 | 1046a73a6c4ff069b59eb0ca2655e41a |
|
BLAKE2b-256 | da25eef614e9ea13964aed3aa93211d44fc0a53591fe59901def7f0842c26259 |
Close
Hashes for Pgenlib-0.90.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 165c46b7c3c6dea1533f80baac3354e38abe6c897d8a56c27ff34fb5a2866734 |
|
MD5 | 35ae6500a8d008e4ddcf1bb98ef24600 |
|
BLAKE2b-256 | 7f7503cbd46f9f1cb21c22745c4548f85b5e548b1e5a5cbb4d69064f111c3f77 |
Close
Hashes for Pgenlib-0.90.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e3088375ca0fe3c1d87d0d1cb43a3a950c78a7ef5fc5ea4f6ae18ed32756fa3 |
|
MD5 | 73675d067950f31ba7153af1494619ea |
|
BLAKE2b-256 | 4b623d03109e3a79b4981cde01c00f7d63b2f850599d3b4c06125e0561b0dbd7 |
Close
Hashes for Pgenlib-0.90.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53c638d30126b4cfddda0968b9734748c66fb1b33c615bec68ae97dd4c618548 |
|
MD5 | 1ceabe5e25f4235696375240bc29398e |
|
BLAKE2b-256 | 59d67157c61da0ebb0d2f05ba178ef1c57e567054192e47153ea29952de377c9 |