/coil_web

web repository for web version of COIL

Primary LanguagePythonApache License 2.0Apache-2.0

coil_web

This is the repository for the web version of COIL, a method for estimating malarial complexity of infection from bi-allelic single nucleotide polymorphism (SNP) barcode data. Read more about COIL in the published manuscript.

For the stand-alone/ command-line version, see this repository.

The frontend of this tool was adapted from this flask-boilerplate repository. It uses a very basic/ barbones setup of Flask, Bootstrap and pure JS for dynamic UI.

setup

To setup/ deploy this app on fresh install of Debian/ Ubuntu, install the following system requirements (if you don't have them already):

# get Apache
sudo apt-get install apache2
sudo apt-get install apache2-dev

# get R-3.3.3
sudo apt-get install r-base=3.3.3

# get python and header files
sudo apt-get install python-2.7
sudo apt-get install libpython-dev

To install the python dependencies (again, if you don't have them already), execute:

# get pip
wget https://bootstrap.pypa.io/get-pip.py

# install mod_wsgi
sudo pip install mod_wsgi
sudo pip install mod_wsgi-httpd

If you'd like to build a virtualenv (a wiser option) rather than system installations, do the following:

# get virtualenv, and open new env
pip install virtualenv
virualenv coil_web_env
source coil_web_env/bin/activate

# then mod_wsgi
sudo pip install mod_wsgi
sudo pip install mod_wsgi-httpd

Then install and deploy coil_web to port 80:

# get coil_web 
cd /var/www/
git clone http://github.com/tmfarrell/coil_web.git

# install dependencies
cd coil_web
sudo pip install -r requirements.txt
cd ..

# setup server configurations 
sudo mod_wsgi-express setup-server \
     /var/www/coil_web/coil_web.wsgi \
     --port 80 \
     --user www-data --group www-data \
     --server-root=/var/www/coil_web/ \
     --recorder-directory /var/www/coil_web/ \
     --document-root /var/www/coil_web/coil_web/

# deploy on port 80 
sudo ./apachectl start

For more detailed instructions, see these tutorials: