Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 607 Bytes

readme.org

File metadata and controls

23 lines (17 loc) · 607 Bytes

How to use vcfpp in Python

Install pybind11 and htslib in conda

conda install -c conda-forge pybind11
conda install -c bioconda htslib

Compiling the py_example.cpp

g++ -O3 -Wall -shared -std=c++11 -fPIC $(python3 -m pybind11 --includes) py_example.cpp -o py_example$(python3-config --extension-suffix) -I${CONDA_PREFIX}/include -L${CONDA_PREFIX}/lib -lhts

Call the C++ function in Python

import py_example
ret = py_example.heterozygosity(vcffile, region, samples)