Skip to content

Latest commit

 

History

History

Pybind11

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

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)