Proof of concept for an API and Frontend to support of the ensembl-vep tool
- Clone this repo &
cd vep_webapp
- Install Poetry, as its the package manager for this project
$ poetry config virtualenvs.create false && poetry shell
to let Poetry create a local env and have it manage it. If the venv doesn't activate automatically, do source.venv/bin/activate
$ poetry install
to install the Python dependencies$ python manage.py runserver 8080
, and go to http://127.0.0.1:8080/ in your web-browser
- Clone this repo &
cd vep_webapp
, as the docker image is not registered $ docker-compose up --build
$ python manage.py runserver 8080
, and go to http://127.0.0.1:8000/ or http://localhost:8000/ in your web-browser.- Your local host may not be my local host!
- Docker compose will run things at build time
- Tests are run at build time
- A few tests that need access to the volume run at run time just before the server starts
- NB! You need the volumes to be setup, with genomic data & you must have
homo_sapiens -y GRCh38
unpacked at the very least as the end2end test calls vep against this genome with the example human.vcf
file.
Do $ docker-compose up
to get the server running. I used
Postman to test the API but curl works just as well.
With curl and POSTing to /api/ping/
you can get a pong back
$ curl -H "Content-Type: application/json" --data '{"data": "ping"}' http://localhost:8000/api/ping/
Returns {"data":"pong"}
or {"data":["field must be `ping`"]}
With curl and POSTing to /api/vcf/
you can check if the file is valid or not.
$ curl -F "vcf_file=@homo_sapiens_GRCh38.vcf" http://127.0.0.1:8000/api/vcf/
Returns {"is_valid":true}
or {"is_valid":false}
With curl and POSTing to /api/vep/
you can get the variant effect output of
the VEP program. curl -F "vcf_file=@homo_sapiens_GRCh38.vcf" http://127.0.0.1:8000/api/vep/
Returns the formatted json the test required or {"is_valid":false}
for an invalid file.
My vep_data
directory lives in my user folder. Hence, in the
docker-compose.yml
the volume bridge is supplied as follows
volumes:
- $HOME/vep_data:/opt/vep/.vep
My vep_data
was installed and setup by the perl install and directory layout
is as follows.
vep_data
├── Plugins
├── drosophila_melanogaster
│ └── 99_BDGP6.28
├── homo_sapiens
│ └── 99_GRCh38
└── rattus_norvegicus
└── 99_Rnor_6.0
Very similar to how you might do it with docker.
$ docker-compose run web perl INSTALL.pl -a cf -s homo_sapiens -y GRCh38
$ docker-compose run web perl INSTALL.pl -a cf -s rattus_norvegicus -y Rnor_6.0
$ docker-compose run web perl INSTALL.pl -a cf -s drosophila_melanogaster -y BDGP6.28