Skip to content

Quickstart local development (clusters app)

Bhavyaa Chandarana edited this page Jun 22, 2023 · 1 revision

Introduction and resources

In our lab, we develop Shiny apps by programming and testing locally, and uploading major changes to the server when they are ready to be public. Please visit the general shiny wiki for a diagram and more details about this workflow.

In the braindex app, no data is actually stored within the braindex git repository. only code. Instead, we locally copy smaller versions of the data for testing and development (e.g. fewer genes). When on the server, the same code is applied to the original (larger) files. For more information on the exact data files used in the app, visit the page: Data files used within the app

Tutorial

To begin developing the clusters app locally for the first time, perform the following steps.

  1. Clone this repository to your local computer (not a computing cluster such as Hydra or Narval/Compute Canada).
  2. If applicable, create or enter an existing development branch for your changes e.g. dev-bhavyaa
  3. Enter the data folder of the clusters app: clusters/data
  4. Populate the data folder with small versions of files from Hydra by running populate_data_flags.R with the following command(<first.last> refers to your Hydra cluster username before the "@" symbol). Copy the commands produced as output from this script and paste them into the terminal to begin copying the data.
Rscript populate_data_flags.R <first.last> -small
  1. After data has been copied, enter the data_prep directory: clusters/data/data_prep and run the R script prep_palettes.R. This will produce processed files essential for running the app.
  2. The app should now be ready to run locally. Test it by opening clusters/global.R in Rstudio and clicking "Run app" in the top right corner of the code window.