Running REST Service
Spinning Up the REST Server
AnyVar uses FastAPI to provide a REST-style HTTP interface for registering and retrieving variant data. In an environment where AnyVar is installed, you can start the server with:
% python -m uvicorn anyvar.restapi.main:app
See the uvicorn documentation or run uvicorn --help for additional options.
Once the server is running, most endpoints work immediately. However, operations that require asynchronous background processing—such as handling VCF input—also need a running Celery worker:
% python -m celery -A anyvar.queueing.celery_worker:celery_app worker
Storing Environment Variables
The AnyVar FastAPI app uses python-dotenv to load environment variables from a .env file when launched. See the example file for a starting point.
Stateless Annotation and Translation
To use AnyVar in stateless mode, set the environment variable ANYVAR_STORAGE_URI to a blank value (i.e. an empty string).
% ANYVAR_STORAGE_URI="" uvicorn anyvar.restapi.main:app