|
1 | 1 | # Shiny-iAtlas |
2 | 2 |
|
3 | | -Shiny-iAtlas is an interactive web portal that provides multiple analysis modules to visualize and explore immune response characterizations across cancer types. The app is hosted on shinyapps.io at https://isb-cgc.shinyapps.io/shiny-iatlas/ and can also be accessed via the main CRI iAtlas page at http://www.cri-iatlas.org/. |
| 3 | +Shiny-iAtlas is an interactive web portal that provides multiple analysis modules to visualize and explore immune response characterizations across cancer types. The app is hosted on shinyapps.io at [https://isb-cgc.shinyapps.io/shiny-iatlas/](https://isb-cgc.shinyapps.io/shiny-iatlas/) and can also be accessed via the main CRI iAtlas page at [http://www.cri-iatlas.org/](http://www.cri-iatlas.org/). |
4 | 4 |
|
5 | 5 | The portal is built entirely in **R** and **Shiny** using the **RStudio** development environment. Layout and interactivity within the portal are achieved by heavy use of the following packages: |
6 | 6 |
|
7 | | -+ **`shinydashboard`** |
8 | | -+ **`plotly`** |
9 | | -+ **`crosstalk`** |
| 7 | +- [shinydashboard](https://rstudio.github.io/shinydashboard/) |
| 8 | +- [plotly](https://plot.ly/r/) |
| 9 | +- [crosstalk](https://rstudio.github.io/crosstalk/) |
10 | 10 |
|
11 | | -Violin plots are not available in the current version of plotly in CRAN; need to use development version from GitHub (e.g., 4.7.1.9000). To install the development version: |
| 11 | +## Install |
12 | 12 |
|
13 | | -```R |
14 | | -devtools::install_github("ropensci/plotly") |
15 | | -``` |
| 13 | +### Requirements |
16 | 14 |
|
17 | | -Other data transformation and formatting operations, as well as many other general application tasks, are supported by a variety of packages in the **`tidyverse`**. For a full list of dependencies (as generated by `rsconnect::appDependencies()`), see the [`DEPENDENCIES`](https://github.com/CRI-iAtlas/shiny-iatlas/blob/master/DEPENDENCIES) file. |
| 15 | +- R: https://www.r-project.org/ - v3.6.2 |
18 | 16 |
|
19 | | -## Data |
| 17 | +- RStudio: https://rstudio.com/products/rstudio/download |
20 | 18 |
|
21 | | -Input data for the Shiny-iAtlas portal were accessed from multiple remote sources, including **Synapse**, the **ISB Cancer Genomics Cloud**, and **Google Drive**. For convenience, we have created locally cached versions of dataframe objects as **`feather`** files: |
| 19 | +- lib cairo: https://www.cairographics.org/ (only required for iAtlas client) |
22 | 20 |
|
23 | | -+ `fmx_df.feather` |
24 | | -+ `feature_df.feather` |
25 | | -+ `feature_method_df.feather` |
26 | | -+ `im_direct_relationships.feather` |
27 | | -+ `im_potential_factors.feather` |
28 | | -+ `im_expr_df.feather` |
29 | | -+ `sample_group_df.feather` |
| 21 | +- gfortran (libgfortran): usually installed with gcc |
30 | 22 |
|
31 | | -## Methods |
| 23 | +### MacOS Install instructions |
32 | 24 |
|
33 | | -While many of the results presented in tables and plots are taken directly from IRWG data (including the main **feature matrix** and various feature and group annotations), we compute some values internally. Unless otherwise noted, the following methods/tools were used to compute summary statistics: |
| 25 | +Install brew: https://brew.sh/ |
| 26 | + |
| 27 | +Then: |
| 28 | + |
| 29 | +- brew install R |
| 30 | +- brew install cairo |
| 31 | +- download and install RStudio: https://rstudio.com/products/rstudio/download |
| 32 | + |
| 33 | +### Initialize R Packages, Database and run App |
| 34 | + |
| 35 | +To run the app locally: |
| 36 | + |
| 37 | +1. Clone this repository |
| 38 | + |
| 39 | +1. Open `shiny-iatlas.Rproj` |
| 40 | + |
| 41 | +1. Install packages. In the RStudio console, run: |
| 42 | + |
| 43 | + ```R |
| 44 | + renv::restore() |
| 45 | + ``` |
| 46 | + |
| 47 | + This may take some time to complete - get something nice to drink :) |
34 | 48 |
|
35 | | -#### Correlation — Spearman's rank-order correlation: |
| 49 | +1. Start the app by running: |
| 50 | + |
| 51 | + ```R |
| 52 | + shiny::runApp() |
| 53 | + ``` |
| 54 | + |
| 55 | +## Development |
| 56 | + |
| 57 | +When adding any new dependencies to the application, they may be added using (where "useful_package" is the name of the package to add): |
36 | 58 |
|
37 | 59 | ```R |
38 | | -stats::cor(x, y, method = "spearman", use = "pairwise.complete.obs") |
| 60 | +renv::install("useful_package") |
39 | 61 | ``` |
40 | 62 |
|
41 | | -#### Concordance Index (CI): |
| 63 | +see [https://rstudio.github.io/renv/reference/install.html](https://rstudio.github.io/renv/reference/install.html) for more details. |
42 | 64 |
|
43 | | -Concordance indexes for survival endpoints with respect to different immune readouts were computed using a custom package developed by Tai-Hsien Ou Yang at Columbia University. The **concordanceIndex** package includes a single synonymous function that can be used as follows: |
| 65 | +Once a new package is added, run: |
44 | 66 |
|
45 | 67 | ```R |
46 | | -concordanceIndex::concordanceIndex(predictions, observations) |
| 68 | +renv::snapshot() |
47 | 69 | ``` |
48 | 70 |
|
49 | | -... where `predictions` and `observations` are numerical vectors of the same length. |
| 71 | +This will ensure the new package is added to the renv.lock file. |
50 | 72 |
|
51 | | -The **concordanceIndex** package can be installed from GitHub using *devtools*: |
| 73 | +To remove an installed package, run (where "useful_package" is the name of the package to remove): |
52 | 74 |
|
53 | 75 | ```R |
54 | | -devtools::install_github("th86/concordanceIndex") |
| 76 | +renv::remove("no_longer_useful_package") |
55 | 77 | ``` |
56 | 78 |
|
| 79 | +For more on package management with renv, please see [https://rstudio.github.io/renv/articles/renv.html](https://rstudio.github.io/renv/articles/renv.html) |
57 | 80 |
|
58 | | -## Local Shiny-iAtlas Session |
| 81 | +## Deployment |
59 | 82 |
|
60 | | -To run the app locally, clone this repository and use the following command in the `shiny-iatlas` directory: |
| 83 | +The first time you deploy, go through the Deployment-Setup instructions below. Afterwards, you can just deploy as needed. |
61 | 84 |
|
| 85 | +### Deployment Setup (First-Time-Only) |
| 86 | + |
| 87 | +You'll need to set up your credentials for shinyapps.io. You can get your codes from: |
| 88 | + |
| 89 | +- https://www.shinyapps.io/admin/#/tokens |
| 90 | + |
| 91 | +Paste and evaluate your tokens in the RStudio console. They look like this: |
| 92 | + |
| 93 | +```R |
| 94 | +# shinyapps.io example credentials |
| 95 | +rsconnect::setAccountInfo( |
| 96 | + name='shiny-iatlas', |
| 97 | + token='xxx', |
| 98 | + secret='yyy' |
| 99 | +) |
62 | 100 | ``` |
63 | | -shiny::runApp() |
| 101 | + |
| 102 | + |
| 103 | +### Deploy |
| 104 | + |
| 105 | +```R |
| 106 | +rsconnect::deployApp() |
| 107 | +``` |
| 108 | + |
| 109 | + |
| 110 | +## Data |
| 111 | + |
| 112 | +Input data for the Shiny-iAtlas portal were accessed from multiple remote sources, including **Synapse**, the **ISB Cancer Genomics Cloud**, and **Google Drive**. For convenience, we have created locally cached versions of dataframe objects as **`feather`** files in the `data2` folder: |
| 113 | + |
| 114 | +- `driver_mutations1.feather` |
| 115 | +- `driver_mutations2.feather` |
| 116 | +- `driver_mutations3.feather` |
| 117 | +- `driver_mutations4.feather` |
| 118 | +- `driver_mutations5.feather` |
| 119 | +- `driver_results1.feather` |
| 120 | +- `driver_results2.feather` |
| 121 | +- `feature_values_long.feather` |
| 122 | +- `features.feather` |
| 123 | +- `groups.feather` |
| 124 | +- `immunomodulator_expr.feather` |
| 125 | +- `immunomodulators.feather` |
| 126 | +- `io_target_expr1.feather` |
| 127 | +- `io_target_expr2.feather` |
| 128 | +- `io_target_expr3.feather` |
| 129 | +- `io_target_expr4.feather` |
| 130 | +- `io_targets.feather` |
| 131 | +- `til_image_links.feather` |
| 132 | + |
| 133 | +## Methods |
| 134 | + |
| 135 | +While many of the results presented in tables and plots are taken directly from IRWG data (including the main **feature matrix** and various feature and group annotations), we compute some values internally. Unless otherwise noted, the following methods/tools were used to compute summary statistics: |
| 136 | + |
| 137 | +### Correlation — Spearman's rank-order correlation |
| 138 | + |
| 139 | +```R |
| 140 | +stats::cor(x, y, method = "spearman", use = "pairwise.complete.obs") |
64 | 141 | ``` |
| 142 | + |
| 143 | +### Concordance Index (CI) |
| 144 | + |
| 145 | +Concordance indexes for survival endpoints with respect to different immune readouts were computed using a custom package developed by Tai-Hsien Ou Yang at Columbia University. The **concordanceIndex** package includes a single synonymous function that can be used as follows: |
| 146 | + |
| 147 | +```R |
| 148 | +concordanceIndex::concordanceIndex(predictions, observations) |
| 149 | +``` |
| 150 | + |
| 151 | +... where `predictions` and `observations` are numerical vectors of the same length. |
| 152 | + |
0 commit comments