Reproducible and Reliable Shiny Apps for Regulatory Submissions

[This article was first published on Tag: r - Appsilon | Enterprise R Shiny Dashboards, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Shiny Apps have emerged as a powerful tool, transforming data analysis and visualization. These interactive web applications are crafted using the R programming language, and no knowledge of HTML, CSS, or JavaScript is required.

When it comes to industries governed by stringent regulations, such as pharmaceuticals and healthcare, an important question arises: Is validating Shiny Apps necessary for regulatory submissions?

In this post, we go through the concept of validation and assess whether these apps must be validated, considering various regulatory points.

Table of Contents


Risk Assessment and Validation

The concept of validation can be quite diverse, often representing the internal procedures within an organization. We have previously discussed the latest insights on R Package Quality and Validation for Clinical Trials in our blog post. According to the FDA, any package can be used for regulatory submissions.

R has now become an essential tool highly utilized for clinical trial data analysis and reporting. There is a growing number of R packages and Shiny applications that assist researchers in quickly deriving insights from their data.

Explore the future of FDA submissions: Read our insights on Testing Containers and WebAssembly.

As outlined in the R Package Validation Framework white paper developed by Phuse, the appropriate approach involves conducting a risk assessment of the software. It clearly specifies that the software used to calculate values or generate tables for decision-making purposes should undergo validation.

Following the available guidelines regarding the validation of software utilized for submissions, Shiny applications that are part of the decision-making process would require validation.

Why R Matters in Clinical Trials?

  1. R is a key player in clinical trial data analysis and reporting.
  2. An increasing array of R packages and Shiny applications are enhancing research efficiency.

Shiny Apps – The R Powerhouse

Shiny, an open-source package for R, offers a sophisticated and robust web framework to develop web applications in R. It enables the transformation of your analysis into interactive web applications, all without the need for HTML, CSS, or JavaScript expertise.

R Validation Hub Insights

For statistical programmers in the pharmaceutical industry, the selection of software packages is quite broad. The incorporation of extra packages typically follows the guidance of the Risk-Based Approach by the R Validation Hub. This advice ensures conformity of the selected packages with industry-specific risk management tactics and adherence to compliance norms. Their white paper provides more information.

Validated R Package Repository

The R Validation Hub is currently in the process of creating a validated R package Repository. Updates on this project are available on their website.

Riskmetric and Riskassessment Tools

The R Validation Hub provides two risk-based software packages to solve the validation problem for R packages. These are the {riskmetric} package and the {riskassessment} application.

{riskmetric} offers a process consisting of five key stages for assessing the quality of a collection of R packages. This method aids users in selecting R packages of superior quality, enhances the dependability of these packages, and supports the confirmation of R packages’ credibility in industries that are subject to strict regulations.

{riskassessment} is an R package that includes a Shiny interface, designed to enhance the functionality of the riskmetric package in an organizational setting. This addition provides a more user-friendly and interactive platform, making the riskmetric package’s capabilities more accessible and practical for use within a corporate environment.

Reliable and Reproducible Shiny Apps in Pharma

Pharmaceutical companies are starting to use Shiny applications for internal clinical trial data exploration and reporting. As mentioned above, validation is a term used to express reliability and reproducibility; these characteristics can be achieved when the developed Shiny applications follow good programming practices and are developed at an enterprise level.

There are some examples of the Shiny applications used in clinical trials’ data exploration:

  1. Realtime Clinical Summaries Shiny app
    1. This application shows 6 derived datasets from the publicly available SDTM/ADaM datasets from the CDISC Pilot Project using the ‘Realtime Summary Model’ (RSuM).
  2. GOahead Shiny app
    1. A Shiny app to help with the decision-making process during drug development.
    2. Read more in this research paper.
  3. safetyGraphics app
    A Shiny application that allows users to explore safety data using a series of interactive graphics.

The Shiny apps should be tested, reproducible and reliable; there are several tools developed for this purpose:

  1. {shinytest}
    It provides a simulation of a Shiny app that you can control in order to automate testing.
  2. {shinytest2}
    shinytest2 provides a streamlined toolkit for unit testing Shiny applications and seamlessly integrates with the popular testthat framework for unit testing R code.
  3. {shinyValidator}
    1. It aims at automating the audit of a Shiny App project’s quality of particular interest during a validation/qualification process. {shinyValidator} performs the following:
      1. Lints the code to ensure consistency and quality.
      2. Runs a devtools::check() to assess package quality.
      3. Checks whether the Shiny app starts and is available after heavy usage.
      4. Performs output comparison between commits.
      5. Launches a load test to measure app performance to identify bottlenecks with shinyloadtest.
      6. Records an overall code profiling with profvis.
      7. Audits reactivity with reactlog.
      8. Provides an overview of project structure with flow.
  4. Rhino
    1. This framework allows you to create Shiny applications The Appsilon Way – like a fullstack software engineer. It aids in applying best software engineering practices, modularizing the code, testing it well, making a beautiful UI and considering user adoption from the very beginning.
    2. It supports Shiny app development in 3 main areas:
      1. Clear code: scalable app architecture, modularization based on Box and Shiny modules.
      2. Quality: unit tests, E2E tests with Cypress, logging and monitoring, lining.
      3. Automation: project startup, CI with GitHub Actions, dependency management with {renv}, configuration management with config, Sass and JavaScript bundling with ES6 support via Node.js.
    3. All of these features can be implemented using various well-known packages, but Rhino brings them all together out of the box.
  5. Golem
    1. This is a framework for building production-grade Shiny applications. It is a toolkit for simplifying the creation, development and deployment of a Shiny application.
  6. {shinymeta}
    1. This package provides tools for capturing logic in a Shiny app and exposing it as code that can be run outside of Shiny (e.g., from an R console). It also provides tools for bundling both the code and results to the end user.

The Shiny App Validation Process

The Validation of Shiny apps could follow a process that is similar to the validation of R packages. Usually, a decision tree first analyses the level of risk of the package, or in this case, the Shiny app, and then a human needs to verify the results. The process is semi-automated.

CI/CD Pipeline

In terms of CI/CD, previously a push-based mechanism to continuously deploy a Shiny application was proposed. In this scenario, the developers will trigger the publication of the application by pushing code to specific branches in the code repository. The initial deployment is done manually, while the subsequent deployments are handled automatically.

Also, to mitigate the risk of automatically deploying content by non-publishing roles, a mechanism was suggested to review and validate deployments using a pull request rather than using a direct push to branches that are associated with automatic deployment.

The First Shiny Application Reviewed by the FDA

According to the clarifying statement released by the FDA, they do not require the use of any specific software and statistical software: Title 21 of the Code of Federal Regulations [e.g., in 21CFR part 11].

The FDA, in collaboration with the R Submissions Working Group, has been testing this and other technologies to improve the submission process and move away from relying only on legacy software (such as SAS). The pilot 2 project was bundled with a simply shiny application that the FDA successfully reviewed; the submissions working group received an FDA CDER response letter on September 27, 2023.

This opens the door for submitting Shiny applications to the FDA since this technology has already been tested and positively reviewed by the FDA. Shiny applications could enhance the way the clinical trial data is reviewed, for example, by generating interactive clinical study reports (iCSRs) that would allow reviewers to explore the data and gather insights; this would eventually lead to a reduction in the needed time for a review, fast tracking the approval of new drugs.

Explore Novo Nordisk’s innovative path: Learn more about their first R-Based FDA submission.

Bring Your Shiny App to an Enterprise-Level

Enlist our expertise to advance your Shiny app to an enterprise-grade, thereby ensuring compliance with regulatory bodies. For more information or to discuss this further, we welcome you to reach out to us.

Join us at PHUSE US Connect 2024! Visit Booth 17 to connect and engage with our team.

The post appeared first on appsilon.com/blog/.

To leave a comment for the author, please follow the link and comment on their blog: Tag: r - Appsilon | Enterprise R Shiny Dashboards.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)