Manual Setup

More advanced users may want to tailor resources to their specific needs. This section provides all required steps for a complete manual setup, but is intentionally high-level because user needs may vary depending on use cases.

Prerequisites

Python Package

Install AnyVar from PyPI with optional dependencies for PostgreSQL storage and task queueing:

% python -m pip install "anyvar[postgres,queueing]"

Storage Backend: PostgreSQL Service

Most AnyVar users will require persistent variation storage, which is supported via a PostgreSQL database. See the PostgreSQL docs for installation suggestions.

AnyVar utilizes the connection string defined by the environment variable ANYVAR_STORAGE_URI to instantiate a connection to the PostgreSQL instance. The user and database declared in this string must be created manually. For example:

% psql -U postgres -c "CREATE USER anyvar WITH PASSWORD 'anyvar-pw';"
% psql -U postgres -c "CREATE DATABASE anyvar WITH OWNER anyvar;"
% psql -U postgres -d anyvar -c "CREATE EXTENSION IF NOT EXISTS btree_gist;"
% export ANYVAR_STORAGE_URI="postgresql://anyvar:anyvar-pw@localhost:5432/anyvar"

See more on storage configuration here.

Data Resource: UTA

UTA provides transcript- and alignment-level data used by AnyVar.

For installation and maintenance instructions, see the UTA documentation:

Data Resource: SeqRepo

SeqRepo provides local, versioned access to reference sequences.

For setup options, see the SeqRepo documentation and Docker image:

Verifying Installation

Launch the REST API server:

% python -m uvicorn anyvar.restapi.main:app

…and direct your web browser to http://127.0.0.1. You should see the Swagger UI documentation demonstrating AnyVar REST API endpoints.

Optional: Queueing Configuration

Optionally, additional setup may be performed to enable asynchronous processing of large files, using Celery.

Backend/Broker

First, Celery requires a backend and broker for task queueing. Most users are recommended to use Redis. For example, to launch a Redis docker container:

% docker run -d --name redis -p 6379:6379 redis:latest

See here for details on configuring the broker and backend connections.

Shared Working Directory

A path to a working directory accessible by an AnyVar server and Celery workers must be explicitly declared with the environment variable ANYVAR_VCF_ASYNC_WORK_DIR.

% export ANYVAR_VCF_ASYNC_WORK_DIR=path/to/shared/worker/volume

See here for more information.