Usage: Web UI Server

Twitcher Workbench GUI consists of a backend server and a browser-based web UI. The backend server is always needed. It can run on a personal desktop/laptop computer or centrally on a shared server computer.

Tip: It is convenient (but not strictly necessary) to run the server in a ‘screen’ session. On Linux, a new session is started with screen -S twb and detached with Ctrl+a d, i.e. pressing simultaneously the ‘Ctrl’ and ‘a’ keys and then the ‘d’ key. An existing session is reattached with screen -r twb and detached as above. Running sessions can be listed with screen -ls. If ‘screen’ is used, one should start a session as the first step, perform then the necessary commands below, and then detach as the server starts outputting logging information.

Workbench server

Twitcher Workbench server is most easily run in a container. Instructions are provided for Singularity and Docker. It can also be run as a Python app. See Installation for instruction for pulling/building an image or installing the package.

Singularity

See Installation for instructions pulling and building the image. The ref/ directory needs to follow the structure explained in Reference/annotation data.

mkdir -p data
singularity run \
  -B $PWD/ref:/app/ref:ro -B $PWD/data:/data \
  --env TWB_DATA_DIR=/data twb.sif

Docker

See Installation for instructions pulling or building the image. The ref/ directory needs to follow the structure explained in Reference/annotation data.

docker run --rm \
  -p 8000:8000 -v $PWD/ref:/app/ref:ro \
  aryashta/twb:latest

Local / pip install

See Installation for instructions pulling or building the image. The ref/ directory needs to follow the structure explained in Reference/annotation data.

# if using virtual environment, activate it first
source twb_env/bin/activate  

twb serve

Command options

twb serve has the following options:

--host TEXT             Bind address. Default: 0.0.0.0
-p, --port INTEGER      Bind port. Default: 8000
-w, --workers INTEGER   Number of gunicorn worker processes. Ignored with --debug. Default: 2
--timeout INTEGER       Gunicorn worker timeout in seconds. Ignored with --debug. Default: 600
--debug                 Run Flask's built-in dev server with the auto-reloader instead of gunicorn, for active local development. Single-threaded; not for production or multi-user use.

Examples:

# Different port
twb serve --port 9000

# Active development: auto-reload on file changes
twb serve --debug --port 9000

# More gunicorn workers, longer timeout
twb serve --workers 4 --timeout 900

By default this runs the same gunicorn setup the Docker image uses in production: multiple worker processes, no auto-reload.