Use Python 3.6
--------------
lorax was tested under Anaconda Python 3.6. As of this writing, there is
no compelling reason to use earlier or later versions. Begin by downloading
Anaconda Python 3.6 (the command-line installer is fine) and
making sure that it is in your PATH.

Configure Channels
-------------------
lorax requires some packages that are in non-default channels, which
may be obtained by the following:

	conda config --add channels conda-forge
	conda config --add channels defaults
	conda config --add channels bioconda

After the channels are configured, update the installation by issuing:

	conda update --all

This command usually results in several packages being updated.

Create a Virtualenv
-------------------
Although it is possible to run lorax directly from the root installation,
it is not advisable to do so because lorax's dependencies could break other
packages.  As of the current conda version (4.3.21), there are four packages
in the channels that are too old for use with lorax:

Package     Anaconda Version Required Version
----------- ---------------- ----------------
setuptools  27.2.0           >30.3.0)
markupsafe  0.23             1.0.0
gunicorn    19.1.0           19.7.1
supervisor  3.3.2            4.0 (from git)

Replacing setuptools, in particular, could cause breakage of your root
Anaconda Python distribution. For this reason, it is required to create a
python virtual environment for lorax and its dependencies. I prefer to name
this environment "loraxenv" to prevent confusion between package and
environment names.  You should create this environment as the user under which
you intend the web server to run (using "sudo -u USER -i " if necessary),
using the following commands:

	conda create -y --name loraxenv biopython click hmmer raxml redis nginx
	source activate loraxenv


Install gcc if using MacOSX
---------------------------
If you are installing under MacOS (and only under MacOS), gcc and libgcc
MUST be installed in the current virtual environment:

	conda install -y gcc libgcc

Failure to do this step will result in a message to the effect "Unable to
resolve paths in MacOS executable" in the lorax installation step 
later.

Upgrade setuptools
------------------
Next continue the installation by updating setuptools and installing lorax.
The first will end with an error; this is expected, so don't be worried by it:

	pip install -U setuptools

Choose root location
--------------------
When lorax installs itself, it will place some files in the bin/ and etc/
subdirectories of LORAX_ROOT.  Normally LORAX_ROOT is set to the same directory
as parent of the python installation in use (that is, in sys.prefix).  This
is usually fine for most installations, but if you wish to override it,
you must define LORAX_ROOT before installation:

    export LORAX_ROOT=some_directory_you_choose


Install lorax
-------------
Next, install the lorax dependencies and binaries:

	pip install --global-option=build_py lorax

Put lorax_env script in alias or on path
----------------------------------------
The lorax_env script is the only executable that you will need to control
lorax and associated process. You should usually not put the entire lorax
bin/ directory into your path, as this may cause binaries from the virtual
environment such as python to be used in contexts where they were not intended
to be used.  The easiest way to do this is with a symlink to a directory
on your path, such as the Anaconda Python directory:

	ln -s /path/to/anaconda/envs/loraxenv/bin/lorax_env /path/to/anaconda/bin

Deactivate virtual environment
------------------------------
You no longer need to work inside the virtual environment you created.  Leave
the virtual environment with the following command:

   source deactivate

Next, follow the instructions in INSTALL.configure+run.txt.
