Skip to content

Commit

Permalink
Merge pull request #45 from RConsortium/app-comments
Browse files Browse the repository at this point in the history
Address comments from review and finalize ADRG
  • Loading branch information
rpodcast authored Sep 26, 2022
2 parents a8f60cb + 7d87097 commit 3edd75f
Show file tree
Hide file tree
Showing 24 changed files with 80 additions and 2,900 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: pilot2wrappers
Type: Package
Title: R Consortium R Submission Pilot 2
Version: 0.3.0
Version: 0.4.0
Authors@R: c(
person("Eric", "Nantz", email = "[email protected]", role = c("aut", "cre")),
person("Yilong", "Zhang", role = c("aut")),
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# pilot2wrappers 0.4.0

- Ensure column width of efficacy table's 95% CI header is wide enough to fit in a single row
- Add missing footnotes to primary table
- Add new vignettes for ADRG as a [Quarto](https://quarto.org/) document (with HTML and PDF output) and cover letter as a R-Markdown document using the [`{pagedown}`](https://pagedown.rbind.io/#letter) package.

# pilot2wrappers 0.3.0

- Enable support for using `{pkglite}` to create package bundle compliant with ECTD submission transfer standards
Expand Down
8 changes: 5 additions & 3 deletions R/tm_t_efficacy.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ui_t_efficacy <- function(id, datasets) {
tags$br(),
tags$hr(),
fluidRow(
h6(tags$i("*Abbreviation: CI=Confidence Interval; LS=Least Squarses; SD=Standard Deviation"))
h6(tags$i("Abbreviations: CI=Confidence Interval; LS=Least Squarses; SD=Standard Deviation"))
)
)
}
Expand Down Expand Up @@ -136,10 +136,12 @@ srv_t_efficacy <- function(input, output, session, datasets) {
"N","Mean (SD)",
"N","Mean (SD)","LS Mean (95% CI)")
colgr=c(1,2,2,3,3,4,4,4)
colwidths <- c(rep(100, 7), 150)
colgrn=c("","Baseline","Week 20","Change from Baseline")
collist = lapply(1:ncol(apr0ancova1),function(xx) colDef(name=coln[xx]))
collist = purrr::map2(1:ncol(apr0ancova1), colwidths, ~{
colDef(name = coln[.x], minWidth = .y)
})
names(collist) = names(apr0ancova1)

reactable(
apr0ancova1,
columns = collist,
Expand Down
7 changes: 6 additions & 1 deletion R/tm_t_primary.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
#' @importFrom shiny NS tagList uiOutput
ui_t_primary <- function(id, datasets) {
ns <- NS(id)
uiOutput(ns("table"))
tagList(
uiOutput(ns("table")),
p("[1] Based on Analysis of covariance (ANCOVA) model with treatment and site group as factors and baseline value as a covariate."),
p("[2] Test for a non-zero coefficient for treatment (dose) as a continuous variable."),
p("[3] Pairwise comparison with treatment as a categorical variable: p-values without adjustment for multiple comparisons.")
)
}

#' srv_t_primary Server Functions
Expand Down
2 changes: 1 addition & 1 deletion inst/golem-config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
default:
golem_name: pilot2wrappers
golem_version: 0.0.0.9000
golem_version: 0.4.0
app_prod: no
adam_path: "datasets/adam"
production:
Expand Down
Binary file modified vignettes/R Consortium R Submission Pilot 2 Cover Letter.pdf
Binary file not shown.
Binary file modified vignettes/adrg-quarto.pdf
Binary file not shown.
39 changes: 20 additions & 19 deletions vignettes/adrg-quarto.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Analysis Data Reviewer's Guide"
author: "R Consortium"
subtitle: "R Consortium R Submission Pilot 2"
date: "2022-09-23"
date: "2022-09-26"
format:
pdf:
number-sections: true
Expand All @@ -14,6 +14,7 @@ format:
html:
toc: true
toc-location: body
self-contained: true
execute:
echo: false
warning: false
Expand All @@ -33,7 +34,7 @@ library(magrittr)

## Purpose

The Analysis Data Reviewer's Guide (ADRG) provides specific instructions for executing a Shiny application created with the R-language for viewing analysis results and performing custom subpopulation analysis based on the data sets and analytical methods used in the R Consortium R Submission Pilot 1. This document provides context for the analysis datasets and terminology that benefit from additional explanation beyond the Data Definition document (define.xml), as well as a summary of ADaM conformance findings. Appendices 1 and 2 provide detailed procedures for installing and configuring a local R environment to access the previous Pilot 1 content and to install the Shiny application for use within a local R session.
The Analysis Data Reviewer's Guide (ADRG) provides specific instructions for executing a Shiny application created with the R-language for viewing analysis results and performing custom subpopulation analysis based on the data sets and analytical methods used in the R Consortium R Submission Pilot 1. This document provides context for the analysis datasets and terminology that benefit from additional explanation beyond the Data Definition document (define.xml), as well as a summary of ADaM conformance findings. Appendix 1 provides detailed procedures for installing and configuring a local R environment to view the included Shiny application.

## Study Data Standards and Dictionary Inventory

Expand Down Expand Up @@ -614,15 +615,15 @@ Create a temporary working directory, For example, `C:\tempwork`. Copy all submi

The R packages are based on CRAN at 2021-08-31. To install the exact R package versions used in this project, run the code below to set the snapshot repository.

``` r
```r
options(repos = "https://mran.microsoft.com/snapshot/2021-08-31")
```

4. Install Open-Source R Packages

In the same R session, install the required packages by running the code below.

``` r
```r
install.packages(c("haven", "dplyr", "emmeans", "pkglite" , "r2rtf",
"rtables", "ggplot2", "cowplot", "visR", "Tplyr",
"pharmaRTF", "huxtable"))
Expand All @@ -632,7 +633,7 @@ install.packages(c("haven", "dplyr", "emmeans", "pkglite" , "r2rtf",

The proprietary R package `pilot1wrappers` is packed in the file `r0pkg.txt`. In the same R session, restore the package structures and install them by running the code below. Adjust the output path as needed to use a writable local directory.

``` r
```r
pkglite::unpack("r0pkg.txt", output = ".", install = TRUE)
```

Expand All @@ -648,7 +649,7 @@ OUTPUT path: To save the analysis results, define the path variable

All of these paths must be defined before executing the analysis output program. For example:

``` r
```r
path = list(
# Modify path to the actual location
adam = "path/to/esub/analysis/adam/datasets",
Expand Down Expand Up @@ -683,7 +684,7 @@ Download and install R 4.1.2 for Windows from <https://cran.r-project.org/bin/wi

A minimum set of R packages are required to ensure the Pilot 2 Shiny application files are successfully unpacked and the custom package environment used for the application is replicated correctly. The first packages to install are the `remotes` and `pkglite` packages:

``` r
```r
install.packages(c("remotes", "pkglite"))

# install version 0.15.2 of the renv package:
Expand All @@ -699,13 +700,13 @@ The console may display a warning message about Rtools being required to build R

Use the `pkglite` package to unpack the Shiny application bundle `r1pkg.txt` within the Pilot 2 eCTD submission transfer. This file is located in the following relative path within the eCTD transfer directory:

```
```sh
m5\datasets\rconsortiumpilot2\analysis\adam\programs\r1pkg.txt
```

Enter the following command in the R console to extract the Shiny application files to the destiniation directory.
Enter the following command in the R console to extract the Shiny application files to the destination directory.

``` r
```r
pkglite::unpack(
input = "C:/pilot2/m5/datasets/rconsortiumpilot2/analysis/adam/programs/r1pkg.txt",
output = "C:/pilot2_files"
Expand All @@ -714,7 +715,7 @@ pkglite::unpack(

The console will display messages of unpacking and writing files to the destination directory. Note that the procedure creates a sub-directory called `pilot2wrappers` in the destination directory. Take note of that particular directory path on your system, as you will use this in the remaining procedures. In this example, the directory is located in the following path:

```
```sh
C:\pilot2_files\pilot2wrappers
```

Expand All @@ -732,7 +733,7 @@ Create a new RStudio Project within the `pilot2wrappers` directory:

RStudio will refresh the window and automatically install the `renv` package into the project directory. To complete the process of restoring the pilot R packages, run the following command in the R console:

```
```r
renv::restore(prompt = FALSE)
```

Expand All @@ -754,21 +755,21 @@ The procedure below assumes R 4.1.2 has been installed in a default location. If


1. Open the Windows Powershell program by searching for Windows Powershell in the Windows Start menu.
1. Change the current directory to the `pilot2wrappers` directory by running the following command (substitute the `pilot2_files` location for your appropriate directory as needed):
2. Change the current directory to the `pilot2wrappers` directory by running the following command (substitute the `pilot2_files` location for your appropriate directory as needed):

```
```sh
Set-Location -Path "C:\pilot2_files\pilot2wrappers"
```

1. Launch the Windows R GUI in this session by running the following command:
3. Launch the Windows R GUI in this session by running the following command:

```
```sh
C:\"Program Files"\R\R-4.1.2\bin\x64\Rgui.exe
```
The R GUI will launch and automatically install the `renv` package into the project directory. To complete the process of restoring the pilot R packages, run the following command in the R console:
```
```r
renv::restore(prompt = FALSE)
```
Expand All @@ -778,13 +779,13 @@ The package installation procedure may take a few minutes or longer depending on
The Shiny application needs one configuration update in order to import the ADaM data sets contained in the eCTD transfer. The data files are located in the following relative path within the eCTD transfer directory:
```
```sh
m5\datasets\rconsortiumpilot2\analysis\adam\datasets
```
Run the following command in the R console (substitute the `pilot2` location for your appropriate directory as needed):
``` r
```r
pilot2wrappers::set_data_path("C:/pilot2/m5/datasets/rconsortiumpilot2/analysis/adam/datasets")
```
Expand Down
Loading

0 comments on commit 3edd75f

Please sign in to comment.