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 this library you will first need to 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_ext
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, 3, 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))
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.82.0.tar.gz
(387.1 kB
view details)
File details
Details for the file Pgenlib-0.82.0.tar.gz.
File metadata
- Download URL: Pgenlib-0.82.0.tar.gz
- Upload date:
- Size: 387.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5ae939bf98ef6eb9297ad790d0b34643f8b4cd2f75940bc83f808357f5edb39
|
|
| MD5 |
5bf89c55bad27d1c368fdd5eb4b863a0
|
|
| BLAKE2b-256 |
29d3311512e956d1bc898cd6020e15691e2778e1bf3a1c2e01eadbb6031d8bd5
|