forked from mayank-procogia/r-pharma-2023
-
Notifications
You must be signed in to change notification settings - Fork 0
/
enhancing_workflow_efficiency_of_bio_stats.qmd
237 lines (182 loc) · 11.9 KB
/
enhancing_workflow_efficiency_of_bio_stats.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
---
title: "<span style='color:white; background-color: #1fb8cc4a; font-size: 66px;'>Enhancing Efficiency and Workflow of Bio Statistics Teams</span>"
subtitle: "<span style='color:white; background-color: #1fb8cc4a; font-size: 24px;'>Converting Repeated Processes to a Shiny Suite of Applications for <br/>Reproducibility, Reporting, and Scalability </span>"
author: "<span style='color:white;'>Mayank Agrawal<br/><span style='font-size: 22px;'>Senior R developer Consultant I<br/>ProCogia</span></span>"
title-slide-attributes:
data-background-image: "data/LinkedIn_Banner_01.png"
data-background-opacity: "0.75"
date: '2023-10-27'
date-format: full
format:
revealjs:
logo: data/procogia_logo_minimal.png
footer: "R Pharma 2023"
smaller: true
slide-number: true
transition: slide
transition-speed: fast
theme: [default, custom.scss]
editor: visual
self-contained: true
---
## Phase 2 Trails
> *A Phase 2 trial answers the question, "Does Drug X improve Disease Y?"*
::: incremental
- Phase 2 clinical trials assess the [safety]{style="text-decoration:underline"} and [efficacy]{style="text-decoration:underline"} of a new drug or drug combination for a specific medical condition.
- **Goal**: Determine appropriate dose and treatment plan for Phase 3 testing.
- **Phase 2a**: Involves fewer patients, generally 100-300 patients to focus on [dose-response relationships]{style="text-decoration:underline"} and [optimal dosing frequency]{style="text-decoration:underline"}.
- **Phase 2b**: Rigorously assesses drug's effectiveness in disease treatment, prevention, or diagnosis.
- Assess **therapeutic effectiveness** in a specific patient group for potential Phase 3 study.
- Also used to assess and review **safety parameters** for **potential adverse events** that might have been missed in a particular patient group.
:::
------------------------------------------------------------------------
## Challenges
Dose Simulations for Phase 2 trails are often complex and time consuming with repeated similar workflow steps for each new variation of the dosage trail.
::: columns
::: {.column width="50%"}
::: fragment
This often leads to
- Delayed Analysis and reporting
- Longer study time (years)
- Delayed Time to Market
resulting in
- Hindered workflows
- Lower productivity
- Repeated boring processes
:::
:::
::: {.column width="50%"}
::: fragment
#### Key Issues
- Manual processes
- Lengthy simulation times
- Scalability constraints
- Limited collaboration
- Reporting challenges
- Flexibility
- Reproducibility
:::
:::
:::
![](data/logo_struggle.png){.absolute bottom="5rem" right="0" height="200"}
------------------------------------------------------------------------
## Meeting the Challenges
**Empowering Biostatisticians with discipline and the right set of tools.**
::: incremental
- Collaborated with Biostats to understand their pain points and challenges.
- An operational framework rooted in **Agile development** methodology, with a focus on **empowering Biostats** at its core.
- Enhanced workflow efficiency, reproducibility and productivity among the biostats team.
- Reproducible workflows with RStudio Projects, Git, `R`, `Shiny`, `renv` and `CRAN` packages.
- Scalable applications built with Software Engineering principles.
- Improved automated interactive reporting.
- Automated testing framework for validated analysis results.
- The framework operated like a well-oiled machine, effectively engaging Biostats with discipline and empowering them with new tools in the expanding ecosystem.
:::
------------------------------------------------------------------------
## Getting Started
::: incremental
- Define scope of each process.
- Document [repetition rate]{style="text-decoration:underline"}, [importance]{style="text-decoration:underline"}, and [time investment]{style="text-decoration:underline"} for each work request.
- Identify the most time-consuming, yet simplest workflow.
- Develop a **MVP** (Minimum Viable Product)
- Showcase a demo with the smallest workflow.
- This aids leaders in visualizing the impact of approval.
- Integrate workflows incrementally from small to large.
- Continuously improve process through rapid iterations, responding to user feedback, ideas and feature requests.
:::
![](data/logo_migration.png){.absolute bottom="3rem" right="0" height="175"}
------------------------------------------------------------------------
## Framework Principles
::: incremental
- Showcase early application design outlines using [draw.io](draw.io){target="_blank"} for UI layout prototyping.
- Invest time to establish a standard application template layout for the ecosystem with the organizational color scheme.
- Create smaller, independent [Proof of Concepts]{style="text-decoration:underline"} (POCs) for new feature requests.
- Define the flow of reactivity for the overall application.
- Prioritize [user-friendliness]{style="text-decoration:underline"}: if it's not intuitive, it won't be used.
- Prioritize [user-requests]{style="text-decoration:underline"} based on need, impact, time, effort and complexity.
- Enable [consistent reporting]{style="text-decoration:underline"} with parameterized Markdown/Quarto for dynamic MS Word reports, following organizational templates.
- Streamline workflow by adopting standard coding principles and agile project management.
:::
------------------------------------------------------------------------
## Tools Selection
::: incremental
- `Shiny` for building interactive web apps straight from R.
- Enhanced collaboration with Biostats in `R`; their preferred language for analysis and visualization of complex clinical trial data.
- Seamless integration of [Tables, Listings, and Graphs]{style="text-decoration:underline"} (TLGs).
- Enabled real-time updates with quick release cycles, crucial for adapting to evolving trial needs.
- Enhanced decision-making thru interactive tools.
- `renv` as a package management tool to ensure reproducibility across the team and environments.
- `CRAN` published and maintained packages to ensure accurate and consistent results.
:::
------------------------------------------------------------------------
## Enhancing Scalability
::: incremental
- Implement **modularization** and **functional programming** for a [**plug-and-play**]{style="text-decoration:underline"} development format across applications.
- Enable multiple studies to be added concurrently using standard **git branching strategies**, involving multiple concurrent developers.
- [**Async Programming**]{style="text-decoration:underline"}: Evaluate longer simulations in a **separate R process** preventing app performance issues.
- Take a step further and deploy simulation functions as internal APIs with **Plumber**.
- Write your **custom JavaScript and R bindings** for implementing unique feature requests.
- Approach feature requests as a blend of **web development**, **software engineering**, and **R development**.
:::
------------------------------------------------------------------------
## Ensuring Reproducibility with Automated Testing
::: columns
::: {.column width="50%"}
::: fragment
- Writing Test Cases (Inputs, Expected Outputs)
- Full Stack Testing
- [testthat](https://github.com/r-lib/testthat/){target="_blank"} for back-end testing,
- [shinytest2](https://github.com/rstudio/shinytest2/){target="_blank"} for front end testing, and
- [shinyloadtest](https://github.com/rstudio/shinyloadtest/){target="_blank"} for load testing.
- Types of Tests: **Unit**, **Functional**, **Integration**, and **End-to-End**
- Continuous Integration for Testing with Git branching strategies.
:::
:::
::: {.column width="50%"}
::: fragment
- Benefits
- Early bug detection
- Efficiency and speed
- Consistent and repeatable testing
- Increased test coverage
- Regression testing capabilities
- Greater confidence in release stability
:::
:::
:::
------------------------------------------------------------------------
## Enhancing Adoption
::: incremental
- Invest time to create an in-depth GitHub ReadMe providing comprehensive project reproducibility instructions.
- Include application workflow [**GIFs**]{style="text-decoration:underline"} in announcement emails.
- Create detailed application interaction [**user manuals**]{style="text-decoration:underline"} with screenshots and highlights for each step.
- Conduct regular (quarterly) [**training sessions**]{style="text-decoration:underline"} to provide guidance, answer questions, and assist users with new features.
- Record and share them for easier re-visit.
- Continuously engage user base for better ROI and on boarding.
- Prioritize most requested user features for each sprint.
- Have a team of [Application Champions]{style="text-decoration:underline"} available for queries/requests.
:::
![](data/logo_user_team.png){.absolute bottom="8rem" right="0" height="150"}
------------------------------------------------------------------------
## Thank you
- Slides available on [GitHub Pages](https://mayank-procogia.github.io/r-pharma-2023/){target="_blank"} at [https://bit.ly/r-pharma-2023](https://bit.ly/r-pharma-2023){target="_blank"}
- Quarto presentation code available on [GitHub](https://github.com/mayank-procogia/r-pharma-2023){target="_blank"} at [https://bit.ly/github-r-pharma-2023](https://bit.ly/github-r-pharma-2023){target="_blank"}
- Connect and/or send me a DM for a follow up question or catch up
- Linkedin: [mayank-agrawal-7jan](https://www.linkedin.com/in/mayank-agrawal-7jan/){target="_blank"}
- X (previously Twitter): [mayank7jan](https://twitter.com/mayank7jan){target="_blank"}
- Mastodon: [mayank7j](https://fosstodon.org/@mayank7j){target="_blank"}
![](data/logo_thank_you_signboard.png){.absolute bottom="5rem" right="0" height="200"}
------------------------------------------------------------------------
## References - R Packages
- [shinyDashboard](https://rstudio.github.io/shinydashboard/){target="_blank"}, [bslib](https://rstudio.github.io/bslib/){target="_blank"}, [bs4dash](https://rinterface.github.io/bs4Dash/index.html){target="_blank"} for standard dashboard template.
- [rmarkdown](https://github.com/rstudio/rmarkdown){target="_blank"} and [Quarto](https://quarto.org/docs/computations/r.html){target="_blank"} for parameterized reporting.
- [renv](https://rstudio.github.io/renv/articles/renv.html){target="_blank"} for package management in a R project.
- [glue](https://glue.tidyverse.org/){target="_blank"} for interpreted string literals for dynamic reporting.
- Async programming: [callr](https://github.com/r-lib/callr/){target="_blank"}, [mirai](https://github.com/shikokuchuo/mirai){target="_blank"}, [crew](https://github.com/wlandau/crew){target="_blank"}, [coro](https://github.com/r-lib/coro){target="_blank"}, [future](https://github.com/HenrikBengtsson/future){target="_blank"} and [promises](https://github.com/rstudio/promises/){target="_blank"}.
- [plumber](https://github.com/rstudio/plumber/){target="_blank"} for API creation.
- [httr2](https://github.com/r-lib/httr2/){target="_blank"} for API calls.
- [pins](https://github.com/rstudio/pins-r/){target="_blank"} for shareable secured publishing of data, models, and R objects
- [testthat](https://github.com/r-lib/testthat/){target="_blank"}, [shinytest2](https://github.com/rstudio/shinytest2/){target="_blank"} and [shinyloadtest](https://github.com/rstudio/shinyloadtest/){target="_blank"} for testing.
- [dplyr](https://github.com/tidyverse/dplyr/){target="_blank"} for data manipulation.
- [ggplot2](https://github.com/tidyverse/ggplot2){target="_blank"}, [plotly](https://github.com/plotly/plotly.R){target="_blank"} and [echarts4r](https://github.com/JohnCoene/echarts4r){target="_blank"} for visualization.
- [profvis](http://rstudio.github.io/profvis/){target="_blank"} for code profiling and time estimation.