Small REST api to use with loqusdb.
Currently only supports get requests for variant, structural_variant, case and cases.
For all of the use cases below, do
git clone https://github.com/Clinical-Genomics/loqusdbapi
cd loqusdbapi
For all these examples you need to make sure that mongodb is running.
If mongod
is listening to another port than 27017
, if it is on another server than localhost, if it needs password
etc, use the environmental variable URI
.
If only testing the app use the docker-compose
-solution below.
More information about setup should be fairly easy to understand by looking at docker-compose.yml
.
Poetry is the friendliest and most intuitive package manager for python.
poetry install
uvicorn loqusdbapi.main:app --reload
To use with pip
the easy solution is to install micropipenv and generate a requirements file:
pip install micropipenv[toml]
micropipenv requirements --method poetry --no-hashes > requirements.txt
pip install -r requirements.txt
uvicorn loqusdbapi.main:app --reload
Go to http://127.0.0.1:8000/docs
To run with Docker build the image with docker build -t loqusapi .
Then start a container called myapi listening on port 80 with docker run -d --name myloqusapi -p 8000:80 -e APP_MODULE="loqusdbapi.main" loqusapi
Head over to http://127.0.0.1:8000/docs
docker-compose up
8000
is mapped to 9000
in the docker compose file so go to http://127.0.0.1:9000/docs
curl -X GET "http://127.0.0.1:9000/variants/1_880086_T_C"
curl -X GET "http://127.0.0.1:9000/svs/?chrom=1&end_chrom=1&pos=7889972&end=7890026&sv_type=DEL"
curl -X GET "http://127.0.0.1:9000/cases"
curl -X GET "http://127.0.0.1:9000/cases/recessive_trio"