Server Setup#

If you want to setup a server that displays your pre-analyzed data for other users, you need to use a WSGI server e.g. gunicorn.

Here is example python code that can be used for server setup:

import os
os.environ["RAPDOR_CONFIG_FILE"] = "customConfig.yaml"
from RAPDOR.visualize.appDefinition import app
from RAPDOR.visualize.runApp import get_app_layout
from RAPDOR.datastructures import RAPDORData

app.layout = get_app_layout()

server = app.server

After you set up this startup code in a file called main.py you can run the server via:

Note

If you want to use custom settings, make sure to set the environment variable RAPDOR_CONFIG_FILE before importing the app. Else, it wont have an effect.

gunicorn -b 0.0.0.0:8080 main:server

Custom Settings:#

You can change the default settings via a custom config file as specified above. Below you find the default yaml file that is loaded from the RAPDOR module. Fields are overwritte via using a custom file and setting the global variable RAPDOR_CONFIG_FILE.

REDIS:
  # Set this to an integer other than zero when using redis as db for queuing long callbacks. You need to run celery in order to process these tasks.
  # If this is set to false long_callbacks will use a cache inside the backend specified underneath
  long_callbacks: False
  database: False # Set this to another integer than the callbacks if you want to store user data in a redis db. (Not recommended)
  host: "" # Host of the redis db
  port: "" # port of the redis db


backend:
  name: "filesystem_backend" # If REDIS database is false this will use the Filesystem Backend named like the directory here
  threshold: 200 # Threshold of concurrent user data. A user can have  a plot and a data file so the number of users is this threshold / 2

# If this is enabled the tool will run in display mode and use the file specified underneath as the displayed file.

display:
  mode: false
  file: 'RAPDOR.json'
  custom_tutorial_dialog: False # Here you can put your own dialog json file to change what is said in the tutorial.
  welcome_files: False # Use a List of markdown files here to display them in several boxes on the Welcome Page
  default_columns: ["Gene", "Rank", "ANOSIM R", "Mean Distance"] # Use this as the list of per default displayed columns

# This specifies the maximum selectable kernel range. adjust this if you have a high number of fractions accordingly.
kernel:
  max: !!int 7