Installation
Requirements
Python 3.x
Python packages numpy and click
Command-line utilities sort (the Unix version), bgzip (shipped with samtools) and samtools. If available, pairtools can compress outputs with bgzip, pbgzip and lz4.
Install using conda
We highly recommend using the conda package manager to install pre-compiled pairtools together with all its dependencies. To get it, you can either install the full Anaconda Python distribution or just the standalone conda package manager.
With conda, you can install pre-compiled pairtools and all of its dependencies from the bioconda channel:
$ conda install -c conda-forge -c bioconda pairtools
Install using pip
Alternatively, compile and install pairtools and its Python dependencies from PyPI using pip:
$ pip install pairtools
Install the development version
Finally, you can install the latest development version of pairtools from github. First, make a local clone of the github repository:
$ git clone https://github.com/open2c/pairtools
Then, you can compile and install pairtools in the development mode, which installs the package without moving it to a system folder and thus allows immediate live-testing any changes in the python code. Please, make sure that you have cython and pysam installed!
$ pip install cython pysam numpy
$ cd pairtools
$ pip install -e ./ --no-build-isolation
- A few notes on the installation:
pairtools have to use –no-build-isolation, because it extends pysam via Cython and re-compiles it during the build process. When build isolation is enabled, these pysam objects get lost after the build.
Because of the –no-build-isolation flag, build does not install build-requires, so you have to install cython, pysam and numpy manually before the build.
Building on MacOS is not fully supported yet, but this tentative solution seems to work:
$ pip install build cython pysam numpy delocate
$ cd pairtools
$ python -m build -n
$ DYLD_LIBRARY_PATH=$(python -c 'import pysam, os; print(os.path.dirname(pysam.get_libraries()[0]))') delocate-wheel -v dist/{wheel_name}.whl
$ pip install dist/{wheel_name}.whl
Note that you need to change the {wheel_name} to the actual name of the wheel file.