In development web browser for the Molecular Oncology Almanac database, viewable at: dev.moalmanac.org.
This repository can be downloaded through GitHub by either using the website or terminal. To download on the website, navigate to the top of this page, click the green Clone or download
button, and select Download ZIP
to download this repository in a compressed format. To install using GitHub on terminal, type:
git clone https://github.com/vanallenlab/moalmanac-browser.git
cd moalmanac-browser
This repository uses Python 3.12. We recommend using a virtual environment and running Python with either Anaconda or Miniconda.
Run the following from this repository's directory to create a virtual environment and install dependencies with Anaconda or Miniconda:
conda create -y -n moalmanac-browser python=3.12
conda activate moalmanac-browser
pip install -r requirements.txt
Or, if using base Python:
virtualenv venv
source activate venv/bin/activate
pip install -r requirements.txt
The Molecular Oncology Almanac web browser supports multiple configurable instances, each defined by a folder under `deploy/. Each instance has its own configuration file, https set up, and dedicated SQLite cache. Our API provides the data source for the local SQLite3 cache, which is populated according to the settings in the selected config file.
To update a local cache, run:
python -m app.populate_database --api https://api.moalmanac.org --config deploy/default/config.ini --drop-tables
To update multiple local caches, append --config
multiple times. For example:
python -m app.populate_database --api https://api.moalmanac.org --config deploy/default/config.ini --config deploy/ie/config.ini --drop-tables
Each instance is defined under the deploy/
directory. To activate a specific instance, run:
bash switch_instance.sh default
This command updates internal symlinks so that the app and deployment scripts point to the correct files for that instance.
Flask configuration variables are managed using environment files:
- .env - used for local development
- .env.production - used for production, loaded with systemd
To launch the application for development, using variables from .env:
python run.py
This repository uses Gunicorn to serve the Flask application for production. The service is configured using a systemd unit file, service/moalmanac-browser.service, which sets environment variables from .env.production via the EnvironmentFile
variable:
EnvironmentFile=/home/breardon/moalmanac-browser/.env.production
Gunicorn is launched using the provided ExecStart
command:
/home/breardon/mambaforge-pypy3/envs/moalmanac-browser/bin/gunicorn --workers 5 --bind unix:moalmanac-browser.sock -m 007 run:app
Systemd and Gunicorn manage launching the application for production using the service/moalmanac-browser.service file, so there is no need to run python run.py
for production use.
If you find this tool or any code herein useful, please cite:
DIAGNOSTIC AND CLINICAL USE PROHIBITED. DANA-FARBER CANCER INSTITUTE (DFCI) and THE BROAD INSTITUTE (Broad) MAKE NO REPRESENTATIONS OR WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT OR VALIDITY OF ANY INTELLECTUAL PROPERTY RIGHTS OR CLAIMS, WHETHER ISSUED OR PENDING, AND THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE.
In no event shall DFCI or Broad or their Trustees, Directors, Officers, Employees, Students, Affiliates, Core Faculty, Associate Faculty and Contractors, be liable for incidental, punitive, consequential or special damages, including economic damages or injury to persons or property or lost profits, regardless of whether the party was advised, had other reason to know or in fact knew of the possibility of the foregoing, regardless of fault, and regardless of legal theory or basis. You may not download or use any portion of this program for any non-research use not expressly authorized by DFCI or Broad. You further agree that the program shall not be used as the basis of a commercial product and that the program shall not be rewritten or otherwise adapted to circumvent the need for obtaining permission for use of the program other than as specified herein.