File: installation.rst

package info (click to toggle)
pairtools 1.1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,284 kB
  • sloc: python: 8,792; sh: 123; makefile: 68; ansic: 31
file content (80 lines) | stat: -rw-r--r-- 2,761 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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 <https://www.continuum.io/downloads>`_ Python 
distribution or just the standalone 
`conda <http://conda.pydata.org/miniconda.html>`_ package manager.

With `conda`, you can install pre-compiled `pairtools` and all of its
dependencies from the `bioconda <https://bioconda.github.io/index.html>`_ channel:

.. code-block:: bash

    $ conda install -c conda-forge -c bioconda pairtools

Install using pip
-----------------

Alternatively, compile and install `pairtools` and its Python dependencies from
PyPI using pip:

.. code-block:: bash

    $ 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:

.. code-block:: bash

    $ git clone https://github.com/open2c/pairtools 

Then, you can compile and install `pairtools` in 
`the development mode <https://setuptools.readthedocs.io/en/latest/setuptools.html#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!

.. code-block:: bash

    $ 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: 

.. code-block:: bash

    $ 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.