A Django web application to make Phylogeny analysis.
NGPhylogeny.fr requires python 2.7.
To install it:
- You may first install and activate a new conda environment:
conda create --name ngphylo python=2.7
source activate ngphylo
- Install all NGPhylogeny.fr dependencies:
pip install -r requirement.txt
apt-get install redis-server # Ubuntu / Debian
- Create Django databases
python manage.py makemigrations
python manage.py migrate
python manage.py createcachetable
python manage.py collectstatic
- Create admin user
python manage.py createsuperuser
- Load tool categories (flags)
python manage.py loaddata tool_flags
- Link NGPhylogeny.fr to a running Galaxy server
python manage.py creategalaxyserver --url=http://url_galaxy:port --activate
python manage.py addgalaxykey --user <superuser name> --galaxyurl http://url_galaxy:port --galaxykey <galaxy key>
- Import existing tools from Galaxy to NGPhylogeny.fr
python manage.py importtools --galaxyurl=http://url_galaxy:port \
--query="phylogeny" \
--flags=toolflags.txt \
--inputfields=toolfields.txt
-
Two possibilities to link tools inputs and outputs
- Already computed links (preferable):
python manage.py import_links --linkfile=toollinks.txt
- Links computed on the fly (based on extension compatiblity, deprecated)
python manage.py compute_tools_links --ignore=txt
-
Import Phylogeny workflows from the Galaxy Instance
It will import all workflows with name containing "oneclick" (case insensitive):
python manage.py importworkflows --galaxyurl=http://url_galaxy:port --wfnamefile=wfnames.txt
-
Run Celery task queue
- Add following lines to
NGPhylogeny_fr/settings/local.py
:
EMAIL_HOST = 'smtp.server.url' EMAIL_PORT = 587 EMAIL_HOST_USER = 'smtp.user' EMAIL_HOST_PASSWORD = 'smtp.pass' EMAIL_USE_TLS=<True|False>
- Start celery
export PYTHONPATH=$PWD:$PYTHONPATH celery multi start 3 -l INFO -c:2 1 -c:3 1 -Q:1 default -Q:2 ncbi_blast -Q:3 monitor --app=NGPhylogeny_fr.celery:app celery beat --app=NGPhylogeny_fr.celery:app --loglevel=DEBUG --detach
- Add following lines to
-
Run the django server
python manage.py runserver
You can run NGPhylogeny.fr via its docker image:
Note: The remote galaxy instance must contain all necessary tools (listed here).
docker run -p 8080:8000 evolbioinfo/ngphylogeny django_admin_username django_admin_password django_admin_email galaxy_url galaxy_api_key
We provide a galaxy docker image with all tools and workflows already installed (see this github repo):
# Starting Docker image of Galaxy
docker run --privileged=true \
-p 8080:80 -p 8121:21 -p 8122:22 \
evolbioinfo/ngphylogeny-galaxy
# MacOS => Starting NGPhylogeny.fr
docker run -p 8000:8000 evolbioinfo/ngphylogeny admin admin@admin http://host.docker.internal:8080 admin
# Linux => Starting NGPhylogeny.fr
docker run -p 8000:8000 --net=host evolbioinfo/ngphylogeny admin admin@admin http://localhost:8080 admin
Fully automatic with docker-compose
The docker-compose.yml
file in the docker
folder is configured to set up a fully automatically running ngphylogeny instance, with 3 services:
- A Galaxy server
- A PostgreSQL database
- The NGPhylogeny.fr server
First the file must be adapted to specific needs, by changing values between <>
with real values, especially:
NGPHYLO_HOST
: The hostname or ip address of the server on which NGPhylogeny.fr will be running (for urls purpose)NGPHYLO_EMAIL_HOST
: The smtp server for email notificationNGPHYLO_EMAIL_PORT
: The smtp portNGPHYLO_EMAIL_HOST_USER
: The smtp user nameNGPHYLO_EMAIL_HOST_PASSWORD
: The smtp passwordNGPHYLO_EMAIL_USE_TLS
: True or False, if smtp uses TLSNGPHYLO_DATABASE_NAME
: Name of the PostgreSQL database (see below)NGPHYLO_DATABASE_USER
: PostgreSQL user name (see below)NGPHYLO_DATABASE_PASSWORD
: PostgreSQL password (see below)POSTGRES_USER
: PostgreSQL user name (database name is the same)POSTGRES_PASSWORD
: PostgreSQL password
Then to run the services:
> docker-compose up -d