installation.rst 6.68 KB
Newer Older
1
2
3
============
Installation
============
4

5
.. note::
6

7
8
9
10
    For the moment, ``ariaec``  Command Line Interface (CLI) is only compatible
    for **Python 2.7** but the transition to Python 3 is planned in the near
    future. Installation procedure may change in the future especially after
    the transition to **Python 3** which should be the next major update.
11

12
13
14
15
.. warning::

    This package contains patches for **CNS-solve** which needs to be compiled
    with the sources after the installation. Please follow post installation
16
    instruction before using ``aria2`` pipeline.
17

18
Dependencies
19
============
20

21
Before starting the installation procedure, be sure to check if dependencies
22
below are actually correctly installed.
Fabrice Allain's avatar
Fabrice Allain committed
23

24
25
* **pip** (>= 18.0)
* **git** (>= 2.0)
26
27
28
29
30
* **cns-solve** (1.21)
* **ccpnmr analysis** (optional)
* **ccpn data model** (optional)

CNS-solve
31
---------
32

33
Academic users can obtain a free version of CNS from the `CNS web site
34
35
<http://cns.csb.yale.edu>`_. Commercial users need to purchase a CNX license
from Accelrys (MSI).
36
37

CCPNMR
38
------
39
40
41
42
43
44

In order to use the CCPN data model for import/export or data conversion, you
also need to install the CCPN data model, and the CCPNMR Analysis software in
case you want to export restraint lists, NOE assignments, and analyses of the
generated structures, e.g. the result of the violation analysis. The complete
CCPN distribution including the API, the FormatConverter, and CCPNMR Analysis
45
can be obtained `here <http://www.ccpn.ac.uk/ccpn/software/downloads-v2/>`_.
46
47
48
49
50


The CCPN distribution provides scripts which guide you through the
installation process.

51
52
Virtual environments
====================
53

54
55
56
57
58
59
60
61
The usual installation process is to install the package inside a virtual
environment for `Python <https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/>`_.
In order to create a virtual environment, we need an environment manager like
``virtualenv`` (or ``venv`` if we use Python 3) with the package manager
``pip``. Another possibility is to use the `conda CLI
<https://docs.conda.io/projects/conda/en/latest/commands.html#id2>`_ from the
`Anaconda Python distribution <https://www.anaconda.com/distribution/>`_ which
is a package and an environment manager.
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
62

63
.. note::
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
64

65
66
    This step is optional but strongly recommended in order to avoid overlaps
    between Python packages already installed in your global/local environment.
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
67

68
69
virtualenv
----------
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
70
71
72
73
74
75
76
77
78

To install the latest stable release, do the following steps on your terminal :

1. Install or update `pip` and `virtualenv` in your current python environment

.. code-block:: shell

    python -m pip install --user --upgrade pip virtualenv

79
80
2. Go to your project directory and create a virtual environment by giving the
name of a directory to place the new virtual environment (e.g. `venv`).
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
81
82
83
84
85

.. code-block:: shell

    python -m virtualenv venv

86
3. Activate the new environment.
87

Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
88
.. code-block:: shell
89

Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
90
    source venv/bin/activate
91
92
93
94
95
96
97
98
99
100
101
102
103
104

.. note::
    With this procedure, you will need to activate the environment before any
    call to ``ariaec`` CLI with ``source venv/bin/activate``

conda
-----

If you have Anaconda distribution instead of , you can use ``conda`` can perform the same operations as ``virtualenv``.

1. Create an environment

.. code-block:: shell

105
    conda create --name ariaec python=2.7
106
107
108
109
110

2. Activate the environment

.. code-block:: shell

111
    source activate ariaec
112
113
114
115
116
117
118
119
120
121


Python Package Index
====================

Since ``ariaec`` is hosted on gitlab, we will use ``pip`` with ``git`` in order
to install the package.

.. code-block:: shell

Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
122
    pip install git+https://gitlab.pasteur.fr/bis-aria/ariaec
123

124
125
126
127
128
.. note::

    If you don't use a virtual environment for Python, it is recommemded to use
    the flag ``--user`` in order to install ``ariaec`` to the Python user
    install directory (typically ``~/.local`` folder)
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
129

130
From source
131
===========
132

133
134
Another possibility is to download the ZIP_ or TAR_ version from Gitlab_ and use
the following steps to install the package.
135

136
1. Download ZIP_ or TAR_ version from Gitlab_ website or through command line
137
138
139
140
141
142

.. code-block:: shell

    wget -O ariaec-master.tar.gz https://gitlab.pasteur.fr/bis-aria/ariaec/repository/master/archive.tar.gz
    mkdir ariaec-master && tar xzf ariaec-master.tar.gz -C ariaec-master --strip-components 1

143
2. You can then call ``pip`` locally to install the package in your environment.
144

Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
145
.. code-block:: shell
146
147

    cd ariaec-master
148
    mkdir build_aria && cp -r src setup.py PKG-INFO MANIFEST.in build_aria/
149
150
151
    cd build_aria
    pip install --user .

152
153
154
155
156
157

.. note::

    Local pip install may lead to unexpected computation time if your directory
    contains more than the ARIA package. In most cases, this is due to
    virtualenv folders within the same directory. In those situations,
158
    the `pip` command will also look into virtualenvs folders. A simple
159
    workaround to solve this issue is to create a empty folder for the
160
    installation as described above.
161
162


163
Singularity
164
===========
165

Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
166
167
168
169
170
171
172
173
For the sake of reproductibility, a Singularity_ recipe is also available
allowing cross platform and legacy OS support.


.. code-block:: shell

    sudo singularity build aria.simg aria.shub

174
The CLI described in [usage](usage.rst) section will
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
175
176
177
178
179
then be accessible by calling the generated singularity image.

.. code-block:: shell

    singularity run aria.simg COMMAND
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
180
181

Dockerfile
182
==========
183

184
Developers can also build their own Docker container using the Dockerfile_ [1]_.
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
185
186


187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
Post installation instructions
==============================

ARIA CNS
--------

The only piece of Fortran code that needs to be compiled together with your
CNS sources can be found in `src/aria/cns/src`. Only the code for floating
chirality assignment is being used. The procedure has not changed since ARIA
version 1.2 :

1. Please copy all the ARIA fortran files located in the subdirectory
``src/aria/cns/src`` to the directory
``cns_solve_1.1/source`` of the unpacked cns_solve distribution
(this will overwrite some files which is okay).

2. Edit the file ``cns_solve_env`` in the directory ``cns_solve_1.1`` to define
the location of the CNSsolve directory.

Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
206
207
3. Go to the directory ``cns_solve_1.1`` and type ``make install``. This should
start the compilation process.
208
209


Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
210
.. Footnotes
211
212
213
214
.. [1] In order to build it, you have to be root on your computer.


.. Hyperlinks
215
.. _Dockerfile: https://gitlab.pasteur.fr/bis-aria/ariaec/raw/master/Dockerfile?inline=false
216
217
.. _ZIP: https://gitlab.pasteur.fr/bis-aria/ariaec/repository/master/archive.zip
.. _TAR: https://gitlab.pasteur.fr/bis-aria/ariaec/repository/master/archive.tar
Fabrice  ALLAIN's avatar
Fabrice ALLAIN committed
218
.. _Gitlab: https://gitlab.pasteur.fr/bis-aria/ariaec
219
220
221
.. _Singularity: https://singularity.lbl.gov/
.. _CNSRequest: http://cns-online.org/cns_request/
.. _CNSDownload: http://cns-online.org/download/