Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ vignettes/x0*
^CRAN-SUBMISSION$
^scripts$
\.sass$
manifest.json
^\.posit$
9 changes: 3 additions & 6 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,17 @@ jobs:
use-public-rspm: true

- uses: r-lib/actions/setup-renv@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Install specific pkgdown version
run: install.packages("remotes") ; remotes::install_version("pkgdown", version = "2.0.3", repos = "cran.rstudio.com", dependencies = FALSE)
- name: Install dev dependencies
run: install.packages(c("pkgdown", "devtools", "covr"))
shell: Rscript {0}

- name: Install tidyCDISC
shell: bash
run: R CMD INSTALL --preclean .

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
run: pkgdown::build_site_github_pages(new_process = FALSE, install = TRUE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ jobs:
use-public-rspm: true

- uses: r-lib/actions/setup-renv@v2
with:
extra-packages: covr

- name: Install dev dependencies
run: install.packages(c("devtools", "covr"))
shell: Rscript {0}

- name: Install tidyCDISC
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ docs/
revdep/
/doc/
/Meta/
/.posit
26 changes: 22 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: tidyCDISC
Title: Quick Table Generation & Exploratory Analyses on ADaM-Ish Datasets
Version: 0.2.1
Version: 0.2.1.9000
Authors@R: c(
person("Aaron", "Clark", , "clark.aaronchris@gmail.com", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-0123-0970")),
Expand All @@ -10,6 +10,8 @@ Authors@R: c(
person("Maya", "Gans", , "maya.gans@biogen.com", role = "aut"),
person("Robert", "Krajcik", , "robert.krajcik@biogen.com", role = "ctb"),
person("Marly", "Gotti", , "marly.cormar@biogen.com", role = "ctb"),
person("Ryan", "Harrison", , "harrison.ryan.w@gmail.com", role = "aut",
comment = c(ORCID = "0000-0003-4575-006X")),
person("Biogen", "Inc", role = "cph")
)
Description: Provides users a quick exploratory dive into common
Expand All @@ -36,40 +38,56 @@ License: AGPL (>= 3)
URL: https://github.com/Biogen-Inc/tidyCDISC/, https://Biogen-Inc.github.io/tidyCDISC/
BugReports: https://github.com/Biogen-Inc/tidyCDISC/issues
Depends:
R (>= 2.10)
R (>= 4.1)
Imports:
arrow,
broom.helpers,
cicerone,
cli,
config,
dplyr,
DT,
fs,
GGally,
ggcorrplot,
ggplot2,
ggsurvfit,
glue,
golem,
gt,
gtsummary,
haven,
IDEAFilter,
pkgload,
plotly,
purrr,
readxl,
rlang,
rmarkdown,
shiny,
shinyjs,
shinyWidgets,
sjlabelled,
stringdist,
stringr,
survival,
tibble,
tidyr,
tidyselect,
timevis,
tippy (== 0.1.0)
tippy (== 0.1.0),
vroom
Suggests:
devtools,
knitr,
shinyalert,
spelling,
testthat
VignetteBuilder:
knitr
Config/Needs/website: pkgdown
Config/Needs/coverage: covr
Encoding: UTF-8
Language: en-US
LazyData: true
RoxygenNote: 7.2.3
RoxygenNote: 7.3.3
9 changes: 9 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Generated by roxygen2: do not edit by hand

S3method(error_handler,default)
S3method(error_handler,purrr_error_indexed)
S3method(error_handler,rlang_error)
export(app_methods)
export(col_for_list_expr)
export(common_rownames)
Expand Down Expand Up @@ -36,6 +39,11 @@ importFrom(ggplot2,ggplot)
importFrom(ggplot2,labs)
importFrom(ggplot2,scale_color_manual)
importFrom(ggplot2,scale_x_continuous)
importFrom(ggsurvfit,add_censor_mark)
importFrom(ggsurvfit,add_confidence_interval)
importFrom(ggsurvfit,add_risktable)
importFrom(ggsurvfit,ggsurvfit)
importFrom(ggsurvfit,survfit2)
importFrom(glue,glue)
importFrom(golem,activate_js)
importFrom(golem,add_resource_path)
Expand Down Expand Up @@ -111,6 +119,7 @@ importFrom(shinyjs,useShinyjs)
importFrom(sjlabelled,get_label)
importFrom(sjlabelled,set_label)
importFrom(stats,as.formula)
importFrom(stats,reformulate)
importFrom(stringr,str_detect)
importFrom(stringr,str_locate_all)
importFrom(stringr,str_remove)
Expand Down
14 changes: 14 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# tidyCDISC (development version)

* Update wordlist
* Add Ryan Harrison as author

### Population Explorer
* Refactor KM plots from plotly to ggsurvfit
* Add estimated median table to KM plot
* Add estimate survival probabilities table to KM plot
* Add time-axis ticks configuration to KM plot
* Enable multiple groups to KM plot
* Add Cox PH Hazard Ratios table to KM plot
* Add ADaM validation functions
* Allow more input file types: csv, parquet, txt, xls, xlsx

# tidyCDISC 0.2.1 (CRAN Release)

Expand Down
113 changes: 83 additions & 30 deletions R/global.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
utils::globalVariables(c(
"AEDECOD",
"AESER",
"AESER",
"AESEV",
"AESTDT",
"..prop..",
Expand Down Expand Up @@ -29,17 +29,17 @@ utils::globalVariables(c(
"value",
"ymax",
"ymin",
"stats",
"as.dist",
"cor",
"stats",
"as.dist",
"cor",
"hclust",
"PopuExplor",
"AVAL",
"AVISIT",
"AVISITN",
"CMDECOD",
"CMSTDT",
"DECODE",
"AVAL",
"AVISIT",
"AVISITN",
"CMDECOD",
"CMSTDT",
"DECODE",
"DOMAIN",
"END",
"EVENTTYP",
Expand All @@ -48,7 +48,7 @@ utils::globalVariables(c(
"LBDY",
"LBSTNRHI",
"LBSTNRLO",
"MHCAT",
"MHCAT",
"MHDECOD",
"MHENDTC",
"MHSTDTC",
Expand All @@ -57,8 +57,8 @@ utils::globalVariables(c(
"PARAMCD",
"START",
"USUBJID",
"VISIT",
"Visit",
"VISIT",
"Visit",
"all_of",
"className",
"col_exist",
Expand All @@ -74,7 +74,7 @@ utils::globalVariables(c(
"hcl",
"min_lbdt",
"missing_disp",
"not_exist",
"not_exist",
"not_exist_disp",
"ord",
"setNames",
Expand Down Expand Up @@ -113,20 +113,73 @@ utils::globalVariables(c(
"adtte",
"warn",
"dy_min",
"AEACN", "AEACNOTH", "AREL", "CNSR", "FASFL", "ITTFL", "LOWER", "Lower",
"MEAN", "Mean (SD)",
"Median", "Min | Max", "N", "PANEL", "Q1 | Q3", "SAFFL", "SEM", "STD",
"TRTEMFL", "UPPER", "Upper",
"Variable", "ae_data", "avals_by", "bds_data", "colour", "colour2",
"corr", "corr_lab",
"corr_lab_hover", "descr", "grp", "id_block", "id_desc", "id_rn",
"id_stat", "inner_sort",
"lab", "n_subgroups", "n_tot", "orig_id_rn", "orig_var_rn", "param_x",
"param_y", "pt", "pval",
"pval_hover", "sort_n", "v", "var", "var_rn", "where", "y",
"type", "title"
,":=",
"DATE", "EVENT_TIME", "DATE_ST", "DECODE_ST", "DATE_EN", "DECODE_EN"
"AEACN",
"AEACNOTH",
"AREL",
"CNSR",
"FASFL",
"ITTFL",
"LOWER",
"Lower",
"MEAN",
"Mean (SD)",
"Median",
"Min | Max",
"N",
"PANEL",
"Q1 | Q3",
"SAFFL",
"SEM",
"STD",
"TRTEMFL",
"UPPER",
"Upper",
"Variable",
"ae_data",
"avals_by",
"bds_data",
"colour",
"colour2",
"corr",
"corr_lab",
"corr_lab_hover",
"descr",
"grp",
"id_block",
"id_desc",
"id_rn",
"id_stat",
"inner_sort",
"lab",
"n_subgroups",
"n_tot",
"orig_id_rn",
"orig_var_rn",
"param_x",
"param_y",
"pt",
"pval",
"pval_hover",
"sort_n",
"v",
"var",
"var_rn",
"where",
"y",
"type",
"title",
":=",
"DATE",
"EVENT_TIME",
"DATE_ST",
"DECODE_ST",
"DATE_EN",
"DECODE_EN",
"time",
"est_ci",
"Strata",
"0.95LCL",
"0.95UCL",
"label",
"id"
))


42 changes: 29 additions & 13 deletions R/mod_dataUpload.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ mod_dataUpload_ui <- function(id){
div(style="display: inline-block; ",h3("Data upload")),
div(style="display: inline-block; float:right;",mod_dataComplyRules_ui("dataComplyRules_ui_1")),
HTML("<br>ADSL file is mandatory & BDS/ OCCDS files are optional"),
fileInput(ns("file"), "Upload sas7bdat files",accept = c(".sas7bdat"), multiple = TRUE),
# fileInput(ns("file"), "Upload sas7bdat files",accept = c(".sas7bdat"), multiple = TRUE),
fileInput(ns("file"), "Upload datasets", accept = c(".txt", ".csv", ".xls", ".xlsx", ".sas7bdat"), multiple = TRUE),
uiOutput(ns("radio_test"))
)
),
Expand Down Expand Up @@ -91,18 +92,25 @@ mod_dataUpload_server <- function(input, output, session){
data_list <- list()

## data list
for (i in 1:nrow(input$file)){
if(length(grep(".sas7bdat", input$file$name[i], ignore.case = TRUE)) > 0){
data_list[[i]] <- haven::zap_formats(haven::read_sas(input$file$datapath[i])) %>%
dplyr::mutate(dplyr::across(.cols = where(is.character),
.fns = na_if, y = ""))
}else{
data_list[[i]] <- NULL
}
}
# for (i in 1:nrow(input$file)){
# if(length(grep(".sas7bdat", input$file$name[i], ignore.case = TRUE)) > 0){
# data_list[[i]] <- haven::zap_formats(haven::read_sas(input$file$datapath[i])) %>%
# dplyr::mutate(dplyr::across(.cols = where(is.character),
# .fns = na_if, y = ""))
# }else{
# data_list[[i]] <- NULL
# }
# }

data_list <- input$file$datapath |>
purrr::map(\(x) {
read_data(x)
}) |>
purrr::set_names(toupper(tools::file_path_sans_ext(input$file$name)))


# names
names(data_list) <- toupper(stringr::str_remove(input$file$name, ".sas7bdat"))
# names(data_list) <- toupper(stringr::str_remove(input$file$name, ".sas7bdat"))



Expand All @@ -111,11 +119,19 @@ mod_dataUpload_server <- function(input, output, session){
id = NULL, #"dataComply_ui_1",
datalist = reactive(data_list))

# if(length(names(dl_comply)) > 0){
# # append to existing reactiveValues list
# dd$data <- c(dd$data, dl_comply) # dl_comply #

# }
if(length(names(dl_comply)) > 0){
# append to existing reactiveValues list
dd$data <- c(dd$data, dl_comply) # dl_comply #
# Normalize ADaM dataset names based on domain validation
dl_normalized <- normalize_adam_datasets(dl_comply)

# append to existing reactiveValues list
dd$data <- c(dd$data, dl_normalized)
}


# set dd$current to FALSE for previous & TRUE for current uploads
dd$current <- c(rep(FALSE, length(dd$current)), rep(TRUE, length(data_list)))
Expand Down
Loading