Our goal is to provide clinicians with a powerful decision making tool that enhances clinical understanding of patient-level data. The PredictMod platform utilizes machine learning tools and complex datasets based on electronic health records, gut microbiome, and -omics data to forecast patient outcomes, often in response to treatment for a particular condition. While our primary condition of interest is Prediabetes, the tool is designed to be used for a variety of conditions, interventions, and data types.
The PredictMod web app was designed using Figma and implemented using several frameworks, spanning primarily the Python and JavaScript languages.
To run the PredictMod system locally, Python and JavaScript runtimes must be available:
node: >= 10.8.2
python3: >= 3.10.2
Additionally, to run PredictMod as Docker containers, docker (>= 26.1.3) must also be available.
This repository can be cloned directly using the following command:
git clone https://github.com/GW-HIVE/PredictMod.git
Ensure you have docker running in your environment. Then, navigate to the PredictMod directory and use the following commands to:
1 - Create an approriate docker newtork
2 - Install the necessary dependencies
3 - Compile the frontend
4 - Create and run the dockerized frontend
5 - Create and run the dockerized middleware
6 - Create and run the dockerized backend
$ docker network create predictmod
$ cd vuetify_app
$ npm install
$ ./build_frontend.sh
$ ./run_frontend.sh
$ ./build_middleware
$ ./run_middleware
$ docker exec -it middleware bash
<docker># cd scripts
<docker># ./initialize_db.sh
<docker># exit
$
$ ./build_backend.sh
$ ./run_backend.sh
$ python3 build_backends.py
$ python3 run_backends.py
Then open a browser and navigate to http://localhost:4244/ to begin interacting with the dockerized application.
Prepare your own virtually environment using the requirement.txt file then activate your environment. Virtual environments are highly recommended when running modern python stacks (i.e. since at least 2015). See virtualenvwrapper docs for a primer on creating virtual environments.
Navigate to the PredictMod directory and use the following commands to:
1 - Install the necessary JavaScript dependencies and start the user interface
2 - Install the necessary middleware dependencies and start the middleware
3 - Install the necessary analytical dependencies and start the backend
NB: Running locally will require launching 3 separate processes: 1 node, 1 flask, and 1 django. To have logs visible from all 3, use separate shell instances.
$ cd <path/to/repo/>
$ cd PredictMod
$ cd vuetify_app
$ npm install
$ npm run dev
Install middleware requirements, initialize the database, and start the development server (Shell instance 2)
$ cd django_server
$ # Install requirements
$ pip install -r requirements.txt
$ # Initialize the database
$ pushd scripts; ./initialize_db.sh; popd;
$ # Start the server
$ python manage.py runserver
$ cd flask_backend
$ pip install -r requirements.txt
$ flask --app flask_python_interface.py run
"Hidden" Dependencies
The sheetJS (CE) library (currently v0.20.0) should be installed manually, as so:
npm i --save https://cdn.sheetjs.com/xlsx-0.20.0/xlsx-0.20.0.tgz
See SheetJS documentation for additional details.
With the three processes running, open a browser window an navigate to localhost:3000 to begin using the local instance.
See documentation in flask_backend/models/new_model_examples/ for additional details.
Holds files that are currently not in use, but may be useful to reference at a later time.
Contains all resources related to running the Django webserver middleware.
Contains all resources required to run the Flask webserver and analysis backend.
Docker requirements for serving the user interface via nginx process. Also establishes reverse proxy activity for middleware access.
Documentation, scripts, BCOs, and datasets for all models.
Convenience scripts to compile/transpile the frontend and to launch the application.
Contains all resources required to create & run the frontend.