From 3271d838cea1df5f7e0eec0ac4f5983591bcc6e4 Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Thu, 20 Apr 2023 13:43:15 -0700 Subject: [PATCH 01/38] remove dfamodules functions --- NAMESPACE | 28 -- R/api_wrappers.R | 107 ------ R/datatable_functions.R | 142 -------- R/manifest.R | 274 -------------- R/mod_dataset_selection.R | 116 ------ R/mod_datatable_dashboard.R | 42 --- R/mod_datatable_filters.R | 92 ----- R/mod_distribution.R | 75 ---- R/mod_file_selection.R | 95 ----- R/mod_highlight_datatable.R | 72 ---- R/mod_scheduler.R | 87 ----- R/mod_select_storage_project.R | 77 ---- R/mod_stacked_bar.R | 100 ------ R/mod_submit_model.R | 79 ----- R/mod_tabbed_dashboard.R | 126 ------- R/mod_update_data_flow_status.R | 99 ------ R/parse_config.R | 71 ---- R/schematic_rest_api.R | 373 -------------------- R/utility.R | 99 ------ R/utils-pipe.R | 14 - man/calculate_items_per_manifest.Rd | 20 -- man/convert_column_type.Rd | 18 - man/create_dashboard.Rd | 16 - man/dt_replace_na.Rd | 16 - man/generate_data_flow_manifest_skeleton.Rd | 27 -- man/get_all_manifests.Rd | 25 -- man/get_colname_by_type.Rd | 16 - man/get_na_replace_colnames.Rd | 14 - man/get_na_replace_defs.Rd | 16 - man/get_renamed_colnames.Rd | 14 - man/list_to_dataframe.Rd | 16 - man/manifest_download.Rd | 25 -- man/model_submit.Rd | 45 --- man/pipe.Rd | 20 -- man/prep_manifest_dash.Rd | 16 - man/prep_manifest_dfa.Rd | 16 - man/prep_manifest_submit.Rd | 16 - man/rearrange_dataframe.Rd | 16 - man/storage_project_datasets.Rd | 25 -- man/storage_project_manifests.Rd | 25 -- man/storage_projects.Rd | 22 -- man/style_dashboard.Rd | 16 - man/true_false_icon.Rd | 14 - man/update_data_flow_manifest.Rd | 25 -- man/update_dfs_manifest.Rd | 18 - 45 files changed, 2665 deletions(-) delete mode 100644 R/api_wrappers.R delete mode 100644 R/datatable_functions.R delete mode 100644 R/manifest.R delete mode 100644 R/mod_dataset_selection.R delete mode 100644 R/mod_datatable_dashboard.R delete mode 100644 R/mod_datatable_filters.R delete mode 100644 R/mod_distribution.R delete mode 100644 R/mod_file_selection.R delete mode 100644 R/mod_highlight_datatable.R delete mode 100644 R/mod_scheduler.R delete mode 100644 R/mod_select_storage_project.R delete mode 100644 R/mod_stacked_bar.R delete mode 100644 R/mod_submit_model.R delete mode 100644 R/mod_tabbed_dashboard.R delete mode 100644 R/mod_update_data_flow_status.R delete mode 100644 R/parse_config.R delete mode 100644 R/schematic_rest_api.R delete mode 100644 R/utility.R delete mode 100644 R/utils-pipe.R delete mode 100644 man/calculate_items_per_manifest.Rd delete mode 100644 man/convert_column_type.Rd delete mode 100644 man/create_dashboard.Rd delete mode 100644 man/dt_replace_na.Rd delete mode 100644 man/generate_data_flow_manifest_skeleton.Rd delete mode 100644 man/get_all_manifests.Rd delete mode 100644 man/get_colname_by_type.Rd delete mode 100644 man/get_na_replace_colnames.Rd delete mode 100644 man/get_na_replace_defs.Rd delete mode 100644 man/get_renamed_colnames.Rd delete mode 100644 man/list_to_dataframe.Rd delete mode 100644 man/manifest_download.Rd delete mode 100644 man/model_submit.Rd delete mode 100644 man/pipe.Rd delete mode 100644 man/prep_manifest_dash.Rd delete mode 100644 man/prep_manifest_dfa.Rd delete mode 100644 man/prep_manifest_submit.Rd delete mode 100644 man/rearrange_dataframe.Rd delete mode 100644 man/storage_project_datasets.Rd delete mode 100644 man/storage_project_manifests.Rd delete mode 100644 man/storage_projects.Rd delete mode 100644 man/style_dashboard.Rd delete mode 100644 man/true_false_icon.Rd delete mode 100644 man/update_data_flow_manifest.Rd delete mode 100644 man/update_dfs_manifest.Rd diff --git a/NAMESPACE b/NAMESPACE index 72b8502..2b8d54c 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,38 +1,10 @@ # Generated by roxygen2: do not edit by hand -export("%>%") -export(calculate_items_per_manifest) -export(convert_column_type) -export(create_dashboard) -export(dt_replace_na) -export(generate_data_flow_manifest_skeleton) -export(get_all_manifests) -export(get_colname_by_type) -export(get_na_replace_colnames) -export(get_na_replace_defs) -export(get_renamed_colnames) -export(list_to_dataframe) -export(manifest_download) -export(model_submit) -export(prep_manifest_dash) -export(prep_manifest_dfa) -export(prep_manifest_submit) -export(rearrange_dataframe) export(run_app) -export(storage_project_datasets) -export(storage_project_manifests) -export(storage_projects) -export(style_dashboard) -export(true_false_icon) -export(update_data_flow_manifest) -export(update_dfs_manifest) import(shiny) importFrom(golem,activate_js) importFrom(golem,add_resource_path) importFrom(golem,bundle_resources) importFrom(golem,favicon) importFrom(golem,with_golem_options) -importFrom(magrittr,"%>%") -importFrom(shiny,NS) importFrom(shiny,shinyApp) -importFrom(shiny,tagList) diff --git a/R/api_wrappers.R b/R/api_wrappers.R deleted file mode 100644 index 431d88d..0000000 --- a/R/api_wrappers.R +++ /dev/null @@ -1,107 +0,0 @@ -################################################################### -## Functions that build on those defined in schematic_rest_api.R ## -################################################################### - -#' Call `storage/project/manifests` Schematic endpoint for a given asset_view -#' -#' @param asset_view ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml) -#' @param input_token Synapse PAT -#' @param base_url Base URL of schematic API -#' @param verbose T/F for console messages -#' -#' @export - -get_all_manifests <- function(asset_view, - input_token, - base_url = "https://schematic-dev.api.sagebionetworks.org", - verbose = FALSE) { - if (verbose) { - message(paste0("Getting storage project list for ", asset_view)) - } - - # get all storage projects under asset view - sp_obj <- storage_projects(asset_view = asset_view, - input_token = input_token, - base_url = base_url) - - if (verbose) { - message(paste0("Getting manifests for ", nrow(sp_obj$content), " storage project(s)")) - } - - synapse_manifests_list <- lapply(1:nrow(sp_obj$content), function(i) { - - sp_id <- sp_obj$content[i, "id"] - sp_name <- sp_obj$content[i, "name"] - - if (verbose) { - message(paste0("Retrieving manifests for ", sp_name)) - } - - manifests <- storage_project_manifests(asset_view = asset_view, - project_id = sp_id, - input_token = input_token, - base_url = base_url) - - # if manifest has - if (nrow(manifests$content) > 0) { - - # pull together in a dataframe - return(data.frame(Component = rep("DataFlow", nrow(manifests$content)), - contributor = rep(sp_name, nrow(manifests$content)), - entityId = manifests$content$dataset_id, - dataset_name = manifests$content$folder_name, - dataset = manifests$content$data_type)) - } else { - return(NULL) - } - }) - - # return dataframe - return(do.call("rbind", synapse_manifests_list)) -} - - -#' Call `calculate_items_per_manifest` calculate the number of items per manifest synID in a given dataframe -#' -#' @param df A dataframe with `entityId` and `dataset` columns from data flow status manifest -#' @param asset_view ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml) -#' @param input_token Synapse PAT -#' @param base_url Base URL of schematic API -#' -#' @export - -calculate_items_per_manifest <- function(df, - asset_view, - input_token, - base_url) { - - sapply(1:nrow(df), function(i) { - - # dataset == "" indicates that there is no manifest - if (df$dataset[i] == "") { - - manifest_nrow <- "Not Applicable" - - } else { - - # download manifest - manifest <- tryCatch( - { - manifest_download(asset_view = asset_view, - dataset_id = df[i, "entityId"], - input_token = input_token, - base_url = base_url) - }, - error=function(e) { - return(NULL) - } - ) - - # if no manifest is downloaded, return NA - # otherwise count rows and return nrow - manifest_nrow <- ifelse(is.null(manifest$content), "Not Applicable", nrow(manifest$content)) - } - - return(manifest_nrow) - }) -} diff --git a/R/datatable_functions.R b/R/datatable_functions.R deleted file mode 100644 index 3c250f1..0000000 --- a/R/datatable_functions.R +++ /dev/null @@ -1,142 +0,0 @@ -######################################################### -## Functions that create stylized datatable dashboards ## -######################################################### - -#' Create a dashboard style datatable -#' -#' @param df A dataframe prepared by `prep_df_for_dash()` with the columns `Contributor`, `Dataset_Name`, `Dataset_Type`, `Num_Items`, `Release_Scheduled`, `Embargo`, `Standard_Compliance`, `QC_Compliance`,`PHI_Detection_Compliance`, `Access_Controls_Compliance`, `Data_Portal`, `Released`, `past_due` -#' @param config Config for datatable dashboard module in `inst/datatable_dashboard_config.json` -#' -#' @export -#' - -create_dashboard <- function(df, - past_due_col, - config) { - - prepped_df <- prep_manifest_dash(df, - past_due_col, - config) - - style_dashboard(prepped_df, config) -} - -#' Add custom styling to dashboard based on contents of config -#' -#' @param prepped_manifest A manifest prepped with `prep_manifest_dash()` -#' @param config `inst/datatable_dashboard_config.json` -#' -#' @export -#' - -style_dashboard <- function(prepped_manifest, - config) { - - # get icon col index - icon_idx <- match(get_colname_by_type("icon", config), names(prepped_manifest)) - - # define center styling for icon columns - center_list <- list(className = 'dt-center', targets = icon_idx) - - # hide columns that are not included in the config - hide_cols <- setdiff(names(prepped_manifest), names(config)) - hide_idx <- match(hide_cols, names(prepped_manifest)) - hide_list <- list(targets = hide_idx, visible = FALSE) - - # capture icon and center styling in single variable - defs <- list( - center_list, - hide_list) - - # define styling for na_replacement - na_replace_defs <- get_na_replace_defs(prepped_manifest, - config) - - - # combine the two lists - defs <- append(defs, na_replace_defs) - - # get column names for datatable display - colnames <- get_renamed_colnames(config) - # put empty string in front to account for rownum column - colnames <- c("", colnames) - - # create datatable - dt <- DT::datatable(prepped_manifest, - escape = FALSE, - selection = "none", - filter = "none", - colnames = colnames, - options = list(scrollX = TRUE, - scrollY = 500, - bPaginate = FALSE, - searching = FALSE, - columnDefs = defs)) - - # FIXME: this is still hardcoded - if (as.logical(toupper(config$release_scheduled$color_past_due))) { - - dt <- DT::formatStyle(table = dt, - config$release_scheduled$col_name, "past_due", - backgroundColor = DT::styleEqual("pd", "#FF9CA0")) - } - - dt -} - -#' Prepare a dataframe for a dashboard style datatable -#' -#' @param df A dataframe with the columns `Contributor`, `Dataset_Name`, `Dataset_Type`, `Num_Items`, `Release_Scheduled`, `Embargo`, `Standard_Compliance`, `QC_Compliance`,`PHI_Detection_Compliance`, `Access_Controls_Compliance`, `Data_Portal`, `Released`, `past_due` -#' @param config Config for datatable dashboard module in `inst/datatable_dashboard_config.json` -#' -#' @export -#' - -prep_manifest_dash <- function(df, - past_due_col, - config) { - - # create past_due column for highlighting release_scheduled - today <- Sys.Date() - df$past_due <- ifelse(df[[past_due_col]] < today, "pd", NA) - - # convert TRUE / FALSE to icon html - - df <- convert_column_type(df = df, - col_names = get_colname_by_type(config, type = "icon"), - type = "icon") - - # convert certain columns to factors - # enables drop down selection style filtering for column - df <- convert_column_type(df = df, - col_names = get_colname_by_type(config, type = "drop_down_filter"), - type = "factor") - - # rearrange dataframe based on config order (any columns not in config are moved to end of dataframe) - expected_colnames <- names(config) - df <- rearrange_dataframe(df, expected_colnames) - - return(df) -} - - -## HELPERS ############################################################################## - -#' NA replacement - datatable custom JS -#' -#' @param col_index target columns index -#' @param na_replacement text to replace NA -#' -#' @export -#' - -dt_replace_na <- function(col_index, - na_replacement) { - - list(targets = col_index, - render = DT::JS( - "function(data, type, row, meta) {", - glue::glue("return data === null ? '{na_replacement}' : data;"), - "}" - )) -} \ No newline at end of file diff --git a/R/manifest.R b/R/manifest.R deleted file mode 100644 index 077420f..0000000 --- a/R/manifest.R +++ /dev/null @@ -1,274 +0,0 @@ -#' Prepare a dataframe that has been downloaded from Synapse for the Data Flow App -#' -#' @param manifest A manifest that has been downloaded from using manifest_download_to_df() -#' @param config `datatable_dashboard_config.json` read in as a dataframe -#' -#' @export - -prep_manifest_dfa <- function(manifest, - config) { - - # convert "Not Applicable" to NA - manifest[ manifest == "Not Applicable" ] <- NA - - # convert contribute and dataset to factor - manifest <- convert_column_type(df = manifest, - col_names = get_colname_by_type("drop_down_filter", config), - type = "factor") - - # num_items to integer column - manifest <- convert_column_type(df = manifest, - col_names = get_colname_by_type("integer", config), - type = "integer") - - # release_scheduled and embargo to date columns - manifest <- convert_column_type(df = manifest, - col_names = get_colname_by_type("date", config), - type = "date") - - return(manifest) -} - -#' Prepare a dataframe for Synapse submission -#' -#' @param manifest A manifest that has been downloaded from using manifest_download_to_df() -#' @param config `datatable_dashboard_config.json` read in as a dataframe -#' -#' @export - -prep_manifest_submit <- function(manifest, - config) { - - # convert columns back to string - col_names <- c(get_colname_by_type("date", config), - get_colname_by_type("drop_down_filter", config), - get_colname_by_type("integer", config)) - - manifest <- convert_column_type(df = manifest, - col_names = col_names, - type = "character") - - # convert NA to "Not Applicable" - manifest[ is.na(manifest) ] <- "Not Applicable" - - return(manifest) -} - -#' Convert a list to a dataframe -#' -#' @param dfs_status_manifest A data flow status manifest -#' @param dfs_updates Output from mod_update_data_flow_status.R -#' @param selected_datasets_df Output from mod_dataset_selection.R -#' -#' @export - -update_dfs_manifest <- function(dfs_manifest, - dfs_updates, - selected_datasets_df) { - - # remove unchanged attributes from selections - dfs_updates <- dfs_updates[!unlist(lapply(dfs_updates, is.null))] - - # capture column names to update - col_names <- names(dfs_updates) - - # loop over the list of changed attributes - # for each attribute: - # - pull out the original vector - # - get the updated entry from the list of attributes - # - apply the entry to the selected datasets in dfs manifest - dfs_manifest[col_names] <- lapply(col_names, function(x) { - - # pull out column into a vector - vec <- dfs_manifest[[x]] - - # get entry from updated data flow status attributes list - entry <- dfs_updates[[x]] - - # update vector by index - manifest_selected_idx <- match(selected_datasets_df$id, dfs_manifest$entityId) - vec[manifest_selected_idx] <- entry - - return(vec) - - }) - - return(dfs_manifest) -} - -#' Generate a data flow status manifest skeleton. Fills in the component, contributor, data type, number of items, and dataset name columns. -#' -#' @param storage_project_list List output from `storage_projects` schematic endpoint -#' @param asset_view ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml) -#' @param dataset_id Synapse ID of existing manifest -#' @param calc_num_items TRUE/FALSE. Calculate the number of items in each manifest. -#' @param base_url Base URL of schematic API -#' -#' @export - -generate_data_flow_manifest_skeleton <- function(asset_view, - input_token, - calc_num_items, - base_url = "https://schematic-dev.api.sagebionetworks.org") { - - # get manifests for each storage project - dfs_manifest <- get_all_manifests(asset_view = asset_view, - input_token = input_token, - base_url = base_url, - verbose = TRUE) - - # count rows in each manifest listed - if (calc_num_items) { - - num_items <- calculate_items_per_manifest(get_all_manifests_out = dfs_manifest, - asset_view = asset_view, - input_token = input_token, - base_url = base_url) - - # if calc_num_itmes = false, just fill in the column with Not Applicable - } else { - num_items <- rep("Not Applicable", nrow(dfs_manifest)) - } - - # add to manifest - dfs_manifest$num_items <- num_items - - # add missing columns - # FIXME: Remove hardcoded column names - # This function will break if dataflow schema changes - # Source column names from schema? - dfs_manifest$release_scheduled <- rep("Not Applicable", nrow(dfs_manifest)) - dfs_manifest$embargo <- rep("Not Applicable", nrow(dfs_manifest)) - dfs_manifest$standard_compliance <- rep(FALSE, nrow(dfs_manifest)) - dfs_manifest$data_portal <- rep(FALSE, nrow(dfs_manifest)) - dfs_manifest$released <- rep(FALSE, nrow(dfs_manifest)) - - # update empty cells to "Not Applicable" - dfs_manifest[ dfs_manifest == "" ] <- "Not Applicable" - - return(dfs_manifest) -} - -#' Check synapse for updates to data flow status manifest -#' -#' @param asset_view ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml) -#' @param manifest_dataset_id Dataset ID for data flow status manifest to be updated -#' @param input_token Synapse PAT -#' @param base_url Base URL of schematic API (Defaults to AWS version) -#' -#' @export - -update_data_flow_manifest <- function(asset_view, - manifest_dataset_id, - input_token, - base_url) { - - print(paste0("Checking asset view ", asset_view, " for updates")) - print(paste0("Getting data flow status manifest")) - # get current data flow manifest - dfs_manifest <- tryCatch( - { - manifest_download(asset_view = asset_view, - dataset_id = manifest_dataset_id, - base_url = base_url, - input_token = input_token) - }, - error = function(e) { - message("manifest_download failed") - message(e) - } - ) - - # get all manifests for each storage project - print("Getting all manifests") - synapse_manifests <- tryCatch( - { - get_all_manifests(asset_view = asset_view, - input_token = input_token, - base_url = base_url, - verbose = FALSE) - }, - error = function(e) { - message("get_all_manifests failed") - message(e) - } - ) - - print("Comparing data flow status manifest to current manifest list") - - # compare recent pull of all manifests to data flow manifest - missing_datasets_idx <- !synapse_manifests$entityId %in% dfs_manifest$content$entityId - missing_datasets <- synapse_manifests[missing_datasets_idx,] - - # if there are missing datasets calculate number of items for each dataset and add in missing information - if (nrow(missing_datasets) > 0) { - - print(paste0(nrow(missing_datasets), " new dataset(s) found. Updating data flow status manifest")) - - # calculate number of items in each manifest - num_items <- tryCatch( - { - calculate_items_per_manifest(df = missing_datasets, - asset_view = asset_view, - input_token = input_token, - base_url = base_url) - }, - error = function(e) { - message("get_all_manifests failed") - message(e) - } - ) - - # fill dfs manifest rows for missing datasets - # FIXME: Remove hardcoded column names - # This function will break if dataflow schema changes - # Source column names from schema? - missing_datasets$release_scheduled <- rep("Not Applicable", nrow(missing_datasets)) - missing_datasets$embargo <- rep("Not Applicable", nrow(missing_datasets)) - missing_datasets$standard_compliance <- rep(FALSE, nrow(missing_datasets)) - missing_datasets$data_portal <- rep(FALSE, nrow(missing_datasets)) - missing_datasets$released <- rep(FALSE, nrow(missing_datasets)) - missing_datasets$num_items <- num_items - - # remove uuid if present - if (any(names(dfs_manifest$content) == "Uuid")) { - uuid_idx <- grep("Uuid", names(dfs_manifest$content)) - dfs_manifest$content <- dfs_manifest$content[,-uuid_idx] - } - - # tack on missing datasets to end of dfs_status_manifest - updated_dfs_manifest <- rbind(dfs_manifest$content, missing_datasets) - - # sort dataframe so that contributor is grouped - updated_dfs_manifest <- updated_dfs_manifest %>% - dplyr::group_by(contributor) %>% - dplyr::arrange(contributor) - - # submit to synapse - # data_type = NULL until LP can fix model/submit endpoint for large manifests - # If no datatype indicated no validation will be done - message("submitting manifest to Synapse") - - # create manifest directory if it doesn't exist yet - if (!file.exists("./manifest/")) { - dir.create("./manifest/") - } - - # write to csv for submission - file_path <- "./manifest/synapse_storage_manifest_dataflow.csv" - write.csv(updated_dfs_manifest, file_path, row.names = FALSE) - - # submit to synapse - model_submit(data_type = NULL, - asset_view = asset_view, - dataset_id = manifest_dataset_id, - file_name = file_path, - restrict_rules = TRUE, - input_token = input_token, - manifest_record_type = "table_and_file", - base_url = base_url, - schema_url = "https://raw.githubusercontent.com/Sage-Bionetworks/data_flow/main/inst/data_flow_component.jsonld") - } else { - print("No updates to manifest required at this time") - } -} \ No newline at end of file diff --git a/R/mod_dataset_selection.R b/R/mod_dataset_selection.R deleted file mode 100644 index 7d9121a..0000000 --- a/R/mod_dataset_selection.R +++ /dev/null @@ -1,116 +0,0 @@ -#' dataset_selection2 UI Function -#' -#' @description A shiny Module. -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_dataset_selection_ui <- function(id){ - ns <- NS(id) - tagList( - - ## SELECT DATASET BOX #################################################### - - fluidRow( - waiter::useWaiter(), - column(width = 12, - div( - id = ns("select_dataset_wrapper"), - - shinydashboard::box( - title = "Select Dataset", - width = NULL, - - # Table of storage project datasets - DT::DTOutput(ns("dataset_tbl")), - - br(), - - # Button to initiate dataset selection - actionButton(ns("submit_btn"), "Select Dataset(s)"), - - br() - ) - ) - ) - ) - ) - } - -#' dataset_selection2 Server Functions -#' -#' @noRd -mod_dataset_selection_server <- function(id, - storage_project_df, - asset_view, - input_token, - hidden_datasets = NULL, - base_url) { - - moduleServer( id, function(input, output, session) { - - ns <- session$ns - - ## DISPLAY STORAGE PROJECT DATASETS ########################################################### - # call schematic API - get datasets for selected storage project - - datasets <- reactive({ - - # show waiter - waiter::waiter_show(id = ns("select_dataset_wrapper"), - html = div( - style="color:#424874;", - waiter::spin_3(), - h4("Retrieving datasets..."))) - - # on exit - hide waiter - on.exit(waiter::waiter_hide()) - - storage_project_datasets_obj <- storage_project_datasets(asset_view = asset_view, - project_id = storage_project_df()$id, - input_token = input_token, - base_url = base_url) - - storage_project_datasets_obj$content - }) - - - # render data table with scroll bar, no pagination, and filtering - output$dataset_tbl <- DT::renderDataTable({ - DT::datatable(datasets(), - selection = "multiple", - option = list(scrollY = 500, - scrollCollapse = TRUE, - bPaginate = FALSE, - dom = "t"), - filter = list(position = 'top', clear = TRUE)) - }) - - # SUBSET DATAFRAME - selected_datasets <- reactive({ - - # get selected rows from datatable - selected <- input$dataset_tbl_rows_selected - - # subset - df <- datasets() - df[selected,] - }) - - # RETURN DATA ON CLICK - eventReactive(input$submit_btn, { - - return(selected_datasets()) - - }) - }) -} - - -## To be copied in the UI -# mod_dataset_selection2_ui("dataset_selection2_1") - -## To be copied in the server -# mod_dataset_selection2_server("dataset_selection2_1") diff --git a/R/mod_datatable_dashboard.R b/R/mod_datatable_dashboard.R deleted file mode 100644 index 4ab0102..0000000 --- a/R/mod_datatable_dashboard.R +++ /dev/null @@ -1,42 +0,0 @@ -#' datatable_dashboard UI Function -#' -#' @description A shiny Module. -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_datatable_dashboard_ui <- function(id){ - ns <- NS(id) - tagList( - DT::DTOutput(ns("datatable_out")) - ) -} - -#' datatable_dashboard Server Functions -#' -#' @param df dataframe containing data to be displayed in dashboard -#' @param config config in `inst/datatable_dashboard_config.json` -#' -#' @noRd -mod_datatable_dashboard_server <- function(id, df, config){ - moduleServer( id, function(input, output, session){ - ns <- session$ns - - # render datatable - - output$datatable_out <- DT::renderDataTable({ - create_dashboard(df(), - "release_scheduled", - config) - }) - - }) -} - -## To be copied in the UI -# mod_datatable_dashboard_ui("datatable_dashboard_1") - -## To be copied in the server -# mod_datatable_dashboard_server("datatable_dashboard_1") diff --git a/R/mod_datatable_filters.R b/R/mod_datatable_filters.R deleted file mode 100644 index 6b8b51e..0000000 --- a/R/mod_datatable_filters.R +++ /dev/null @@ -1,92 +0,0 @@ -#' datatable_filters UI Function -#' -#' @description A shiny Module. -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_datatable_filters_ui <- function(id, - width = NULL, - contributor_choices = c("Contributor 1", "Contributor 2"), - dataset_choices = c("dataset 1", "dataset 2"), - release_daterange = c(Sys.Date(), (Sys.Date() + 365)), - status_choices = c("status 1", "status 2")){ - ns <- NS(id) - tagList( - shinydashboard::box(title = "Filter Datasets", - collapsible = TRUE, - collapsed = TRUE, - width = width, - status = "primary", - - shiny::selectInput(ns("contributor_select"), - label = "Filter by contributor(s)", - choices = contributor_choices, - selected = contributor_choices, - multiple = TRUE), - - shiny::selectInput(ns("dataset_select"), - label = "Filter by dataset type(s)", - choices = dataset_choices, - selected = dataset_choices, - multiple = TRUE), - - shiny::dateRangeInput(ns("release_scheduled_daterange"), - label = "Filter by release scheduled date range", - start = release_daterange[1], - end = release_daterange[2]), - - shiny::checkboxGroupInput(ns("choose_status_checkbox"), - label = "Filter by status", - choices = status_choices, - selected = status_choices) - ) - ) -} - -#' datatable_filters Server Functions -#' -#' @noRd -mod_datatable_filters_server <- function(id, - manifest){ - - moduleServer(id, function(input, output, session) { - ns <- session$ns - - # CHANGE "NA" TO NA -------- - selected_datasets_modified <- reactive({ - # replace string "NA" with true NA - datasets <- input$dataset_select - datasets[datasets == "NA"] <- NA - datasets - }) - - - # FILTER INPUTS --------- - manifest_filtered <- reactive({ - manifest <- manifest() - - # FIXME: For some reason line 75 cause a warning - # Problem while computing `..3 = ... | is.na(release_scheduled)`. Input `..3` must be of size 19 or 1, not size 0. - # No error seems to be introduced so I will keep this line of code for now - filtered <- manifest %>% - dplyr::filter(contributor %in% input$contributor_select, - dataset %in% selected_datasets_modified(), - release_scheduled >= input$release_scheduled_daterange[1] & release_scheduled <= input$release_scheduled_daterange[2] | is.na(release_scheduled), - data_flow_status %in% input$choose_status_checkbox) - - - return(filtered) - }) - - return(manifest_filtered) - }) -} - -## To be copied in the UI -# mod_datatable_filters_ui("datatable_filters_1") - -## To be copied in the server -# mod_datatable_filters_server("datatable_filters_1") diff --git a/R/mod_distribution.R b/R/mod_distribution.R deleted file mode 100644 index 1c42072..0000000 --- a/R/mod_distribution.R +++ /dev/null @@ -1,75 +0,0 @@ -#' Distribution Plot UI Function -#' -#' @description A Shiny module that takes a dataframe and displays a distribution bar plot -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_distribution_ui <- function(id){ - ns <- NS(id) - tagList( - shiny::plotOutput(ns("distribution_plot")) - ) -} - -#' Distribution Plot Server Functions -#' -#' @param id Shiny ID to call server module -#' @param df A data frame containing data to plot -#' @param group_by_var Column variable to group data by (x axis variable) -#' @param title Title of plot -#' @param x_lab X axis label -#' @param y_lab Y axis label -#' @param fill Fill color -#' -#' @noRd -mod_distribution_server <- function(id, - df, - group_by_var, - title = NULL, - x_lab = NULL, - y_lab = NULL, - fill = "#0d1c38"){ - moduleServer( id, function(input, output, session){ - ns <- session$ns - - grouped_data <- reactive({ - df <- df() - - # group and tally data - df %>% - dplyr::group_by(.data[[group_by_var]]) %>% - dplyr::tally() - }) - - - - # create distribution plot - dist <- reactive({ - plot_df <- grouped_data() - ggplot2::ggplot(plot_df, - ggplot2::aes(x = reorder(.data[[group_by_var]], -n, ), y = n)) + - - ggplot2::geom_bar(stat = "identity", fill = fill) + - - ggplot2::labs(title = title, x = x_lab, y = y_lab) + - - ggplot2::theme_minimal() + - - ggplot2::theme(axis.text.x = ggplot2::element_text(angle=90,hjust=1)) - }) - - # render plot - output$distribution_plot <- shiny::renderPlot({ - dist() - }) - }) -} - -## To be copied in the UI -# mod_distribution_ui("distribution_1") - -## To be copied in the server -# mod_distribution_server("distribution_1") diff --git a/R/mod_file_selection.R b/R/mod_file_selection.R deleted file mode 100644 index 865bf95..0000000 --- a/R/mod_file_selection.R +++ /dev/null @@ -1,95 +0,0 @@ -#' file_selection UI Function -#' -#' @description A shiny Module. -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_file_selection_ui <- function(id){ - ns <- NS(id) - tagList( - - fluidRow( - waiter::use_waiter(), - column(width = 12, - # Action button that opens file selector - # TODO: eventually this will become a toggle similar to data_curator dashboard - div( - id = ns("select_files_wrapper"), - shinydashboard::box( - width = NULL, - title = "Select Files", - - actionButton(ns("getfiles_btn"), "Get Files"), - - DT::DTOutput(ns("manifest_tbl")) - ) - ) - ) - ) - ) - } - -#' file_selection Server Functions -#' -#' @noRd -mod_file_selection_server <- function(id, dataset, asset_view, input_token) { - - moduleServer( id, function(input, output, session) { - - ns <- session$ns - - w <- Waiter$new(id = ns("select_files_wrapper"), - html = div( - style="color:#424874;", - waiter::spin_3(), - h4("Retrieving manifest...")), - color = transparent(.8)) - - - # ON CLICK GET MANIFEST FOR SELECTED DATASET ############################################################ - # FIXME: Button click data flow is not ideal - # Click of show file level view must happen AFTER dataset is selected - # If you have clicked show file level view and displayed a dataset, but want to - # change that dataset you need to click "Show file level view" again - - manifest <- eventReactive(input$getfiles_btn, { - - # show waiter - w$show() - - # on exit - hide waiter - on.exit({ - w$hide() - }) - - ds <- dataset() - manifest_download_to_df(asset_view = asset_view, - dataset_id = ds$id, - input_token = input_token) - - }) - - # DISPLAY MANIFEST AS TABLE ############################################################################# - - output$manifest_tbl <- DT::renderDataTable({ - DT::datatable(manifest(), - option = list(scrollY = 500, - scrollX = TRUE, - scrollCollapse = TRUE, - bPaginate = FALSE, - dom = "t"), - filter = list(position = 'top', clear = TRUE)) - }) - - # return a list containing the downloaded manifest and rows selected - - return(list( - manifest = reactive({ manifest() }), - selected_rows = reactive({ input$manifest_tbl_rows_selected }) - )) - - }) -} \ No newline at end of file diff --git a/R/mod_highlight_datatable.R b/R/mod_highlight_datatable.R deleted file mode 100644 index 1efea13..0000000 --- a/R/mod_highlight_datatable.R +++ /dev/null @@ -1,72 +0,0 @@ -#' highlight_datatable UI Function -#' -#' @description A shiny Module. -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_highlight_datatable_ui <- function(id){ - ns <- NS(id) - tagList( - - DT::DTOutput(ns("highlight_tbl")), - ) -} - -#' highlight_datatable Server Functions -#' -#' @noRd -mod_highlight_datatable_server <- function(id, - df, - selection, - df_match_colname){ - moduleServer( id, function(input, output, session){ - ns <- session$ns - - # create selected TRUE/FALSE idx - selection_idx <- reactive({ - df()[[df_match_colname]] %in% selection() - }) - - # add selection_idx to datatable - manifest_w_idx <- reactive({ - selection_idx_df <- data.frame(selection_idx = selection_idx()) - dplyr::bind_cols(df(), selection_idx_df) - }) - - hide_idx <- reactive({ - # hide selection index column - hide_idx <- match("selection_idx", names(manifest_w_idx())) - }) - - output$highlight_tbl <- DT::renderDataTable({ - - # datatable with x and y scrollbar, no pagination - # hiding the selection index column - dt <- DT::datatable(manifest_w_idx(), - escape = FALSE, - selection = "none", - filter = "top", - options = list(scrollX = TRUE, - scrollY = 800, - bPaginate = FALSE, - columnDefs = list(list(targets = hide_idx(), - visible = FALSE)))) - - # add conditional styling based on hidden column - dt <- DT::formatStyle(table = dt, - "selection_idx", target = "row", - backgroundColor = DT::styleEqual(TRUE, "#ffe2ad")) - - dt - }) - }) -} - -## To be copied in the UI -# mod_highlight_datatable_ui("highlight_datatable_1") - -## To be copied in the server -# mod_highlight_datatable_server("highlight_datatable_1") diff --git a/R/mod_scheduler.R b/R/mod_scheduler.R deleted file mode 100644 index 6510f20..0000000 --- a/R/mod_scheduler.R +++ /dev/null @@ -1,87 +0,0 @@ -#' scheduler UI Function -#' -#' @description A shiny Module. -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' @param dateInput_label label for dateInput -#' @param checkboxInput_label date for checkboxInput -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_scheduler_ui <- function(id, - dateInput_label, - checkboxInput_label) { - ns <- NS(id) - tagList( - - # initialize shinyjs - shinyjs::useShinyjs(), - - # release scheduled input - dateInput(ns("date"), label = dateInput_label, value = NA), - checkboxInput(ns("unschedule_chk"), label = checkboxInput_label, value = FALSE)) -} - -#' scheduler Server Functions -#' -#' @noRd -mod_scheduler_server <- function(id, - reset_btn){ - moduleServer( id, function(input, output, session){ - ns <- session$ns - - # on checkbox click - observeEvent(input$unschedule_chk, { - - # if the checkbox is clicked: - if(input$unschedule_chk == TRUE){ - - # update the date input to blank out the date - updateDateInput(session = session, inputId = "date", value = NA) - - # use shinyjs to disable the date ui widget - shinyjs::disable("date") - - } else { - - # when checkbox is not clicked enable the date box to be used - shinyjs::enable("date") - } - }) - - observeEvent(reset_btn(), { - updateDateInput(session = session, inputId = "date", value = NA) - }) - - date_out <- reactive({ - - # if there is no date selected AND checkbox is not clicked return NULL - if (length(input$date) == 0 & input$unschedule_chk == FALSE) { - return(NULL) - - # if there is no date selected AND checkbox is clicked return NA (unschedule) - } else if (length(input$date) == 0 & input$unschedule_chk == TRUE) { - return(NA) - - # if there is a selected AND checkbox is clicked return NA (unschedule) - } else if (length(input$date) != 0 & input$unschedule_chk == TRUE) { - return(NA) - - # if there is a selected date and checkbox is not clicked return date - } else { - return(input$date) - } - - }) - - return(reactive({ date_out() })) - - }) -} - -## To be copied in the UI -# mod_scheduler_ui("scheduler_1") - -## To be copied in the server -# mod_scheduler_server("scheduler_1") \ No newline at end of file diff --git a/R/mod_select_storage_project.R b/R/mod_select_storage_project.R deleted file mode 100644 index 3e63a9b..0000000 --- a/R/mod_select_storage_project.R +++ /dev/null @@ -1,77 +0,0 @@ -# Storage Project Selection Module UI - -#' @title select_storage_project_ui and select_storage_project_server -#' @description A shiny module. Outputs a selectInput dropdown of Synapse storage project names to the UI. -#' @return To the server: A list information from the module. `selected_df` - a dataframe with a single row containing the `name` and `id` of the selected storage project. `action_btn` - TRUE/FALSE output from button click. -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_select_storage_project_ui <- function(id){ - ns <- NS(id) - tagList( - shinydashboard::box( - title = "Select Project", - width = NULL, - - # Project dropdown - uiOutput(ns("project_selector")), - - # Button to initiate project selection - actionButton(ns("submit_btn"), - "Select Project"), - ) - ) -} - -# Storage Project Selection Module Server -#' -#' @noRd -mod_select_storage_project_server <- function(id, asset_view, input_token, base_url) { - - moduleServer( id, function(input, output, session){ - - ns <- session$ns - - # API CALL : GET STORAGE PROJECTS ####################################################################### - - storage_project_obj <- storage_projects(asset_view = asset_view, - input_token = input_token, - base_url = base_url) - - # DROP DOWN LISTING STORAGE PROJECTS #################################################################### - - # render ui for storage project drop down - output$project_selector <- shiny::renderUI({ - - selectInput(inputId = ns("selected_project"), - label = NULL, - choices = storage_project_obj$content[,"name"], - selectize = FALSE) # must be false or for some reason cannot reference `input$selected_project` - - }) - - # SUBSET STORAGE PROJECT DATAFRAME BY SELECTED PROJECT ############################################################## - - selected_project_df <- reactive({ - - req(input$selected_project) - - storage_project_obj$content[ match(input$selected_project, storage_project_obj$content[,"name"]), ] - }) - - # RETURN SELECTED PROJECT ############################################################## - - eventReactive(input$submit_btn, { - return(selected_project_df()) - }) - }) - } - -## To be copied in the UI -# mod_select_storage_project_ui("select_storage_project_1") - -## To be copied in the server -# mod_select_storage_project_server("select_storage_project_1") \ No newline at end of file diff --git a/R/mod_stacked_bar.R b/R/mod_stacked_bar.R deleted file mode 100644 index 493e6b3..0000000 --- a/R/mod_stacked_bar.R +++ /dev/null @@ -1,100 +0,0 @@ -#' Stacked Bar Plot UI Function -#' -#' @description A Shiny module that takes in a datafame and outputs a stacked bar plot. -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_stacked_bar_ui <- function(id){ - ns <- NS(id) - tagList( - shiny::plotOutput(ns("stacked_bar")) - ) -} - -#' Stacked Bar Plot Server Functions -#' -#' @param id Shiny ID to call server module -#' @param df A data frame containing data to plot -#' @param x_var Column name of X variable -#' @param y_var Column name of Y variable -#' @param fill_var Column name of fill variable -#' @param title Title of plot -#' @param x_lab X axis label -#' @param y_lab Y axis label -#' @param colors Fill colors -#' @param x_line Add a line across x axis -#' @param width Width of stacked bars -#' @param date_breaks X axis date breaks -#' @param coord_flip Flip coordinates 90 degrees - -#' @noRd -mod_stacked_bar_server <- function(id, - df, - x_var, - y_var, - fill_var, - title = NULL, - x_lab = NULL, - y_lab = NULL, - colors = NULL, - x_line = NULL, - width = NULL, - date_breaks = NULL, - coord_flip = FALSE) { - - moduleServer( id, function(input, output, session){ - ns <- session$ns - - # render stacked bar - output$stacked_bar <- shiny::renderPlot({ - df <- df() - - # base plot - bar <- ggplot2::ggplot(df, ggplot2::aes(x = .data[[x_var]], y = .data[[y_var]], fill = .data[[fill_var]])) + - - ggplot2::geom_col(position = "fill", width = width) - - # add x intercept - if (!is.null(x_line)) { - bar <- bar + - ggplot2::geom_vline(xintercept = x_line, linetype = 2, colour = "black") - } - - # scale x axis with date breaks - if (!is.null(date_breaks)) { - bar <- bar + - ggplot2::scale_x_date(date_breaks = date_breaks) - } - - # add styling/labs - bar <- bar + - ggplot2::labs(title = title, x = x_lab, y = y_lab) + - ggplot2::theme_minimal() + - ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 90, hjust = 1)) - - # add custom color - if (!is.null(colors)) { - bar <- bar + - ggplot2::scale_fill_manual(values = colors) - } - - # flip coordinates - if (coord_flip) { - bar <- bar + - ggplot2::coord_flip() - } - - bar - }) - - }) -} - -## To be copied in the UI -# mod_stacked_bar_ui("stacked_bar_1") - -## To be copied in the server -# mod_stacked_bar_server("stacked_bar_1") diff --git a/R/mod_submit_model.R b/R/mod_submit_model.R deleted file mode 100644 index 6626696..0000000 --- a/R/mod_submit_model.R +++ /dev/null @@ -1,79 +0,0 @@ -#' submit_model UI Function -#' -#' @description A shiny Module. -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_submit_model_ui <- function(id){ - ns <- NS(id) - tagList( - waiter::useWaiter(), - actionButton(ns("submit"), "Submit to Synapse") - - ) -} - -#' submit_model Server Functions -#' -#' @noRd -mod_submit_model_server <- function(id, - dfs_manifest, - data_type, - asset_view, - dataset_id, - manifest_dir = "./manifest", - input_token, - schema_url, - base_url) { - moduleServer( id, function(input, output, session) { - ns <- session$ns - - # FIXME: Stop writing csv, use json instead - # Blocked due to schematic api limitations - - # create manifest directory if it doesn't exist yet - if (!file.exists(manifest_dir)) { - dir.create(manifest_dir) - } - - # on button click submit model to synapse - observeEvent(input$submit, { - - # write manifest csv - path <- file.path(manifest_dir, "synapse_storage_manifest_dataflow.csv") - write.table(dfs_manifest(), - path, - sep = ",", - row.names = FALSE) - - waiter::waiter_show(html = div( - style="color:#424874;", - waiter::spin_3(), - h4("Submitting updated manifest to Synapse..."))) - - # submit model to synapse - model_submit(data_type = data_type, - asset_view = asset_view, - dataset_id = dataset_id, - file_name = path, - restrict_rules = TRUE, - input_token = input_token, - manifest_record_type = "table_and_file", - schema_url = schema_url, - base_url = base_url) - - waiter::waiter_hide() - }) - - - }) -} - -## To be copied in the UI -# mod_submit_model_ui("submit_model_1") - -## To be copied in the server -# mod_submit_model_server("submit_model_1") diff --git a/R/mod_tabbed_dashboard.R b/R/mod_tabbed_dashboard.R deleted file mode 100644 index 69c244c..0000000 --- a/R/mod_tabbed_dashboard.R +++ /dev/null @@ -1,126 +0,0 @@ -#' tabbed_dashboard UI Function -#' -#' @description A shiny Module. -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_tabbed_dashboard_ui <- function(id){ - ns <- NS(id) - tagList( - - # tabbox - shinydashboard::tabBox( - title = "Dataset Dashboard", - width = NULL, - side = "right", - - # show different views of dataset on different tab panels - - # all unreleased data - tabPanel("Unreleased", - mod_datatable_dashboard_ui(ns("datatable_dashboard_unreleased"))), - - # unreleased, no embargo, passing all checks - # aka ready for release - tabPanel("Ready for release", - mod_datatable_dashboard_ui(ns("datatable_dashboard_ready"))), - - # released_scheduled = NA - tabPanel("Not scheduled", - mod_datatable_dashboard_ui(ns("datatable_dashboard_not_scheduled"))), - - # all - tabPanel("All", - mod_datatable_dashboard_ui(ns("datatable_dashboard_all"))), - - # released = TRUE - tabPanel("Previously released", - mod_datatable_dashboard_ui(ns("datatable_dashboard_archive"))) - ) - ) -} - -#' tabbed_dashboard Server Functions -#' -#' @noRd -mod_tabbed_dashboard_server <- function(id, df, config){ - moduleServer( id, function(input, output, session){ - ns <- session$ns - - # TODO: Remove hard coded column names - # I think column names will come from data flow component - - # subset dataframe into various views - unreleased_datasets <- reactive({ - data <- df() - data[ data$released == FALSE, ] - }) - - # not scheduled - not_scheduled_datasets <- reactive({ - data <- df() - data[ is.na(data$release_scheduled), ] - }) - - # all checks passing / no embargo / unreleased (i.e. ready for release) - all_checks_passed_datasets <- reactive({ - - qc_cols <- "standard_compliance" - - data <- df() - - # which rows have all qc_cols == TRUE - passing <- apply(data[qc_cols], 1, all) - - # which rows have passed their embargo date or are NA - no_embargo <- data$embargo <= Sys.Date() | is.na(data$embargo) - - # which rows are unreleased - unreleased <- data$released == FALSE - - # which rows are passing qc, past/have no embargo, and are unreleased - ready <- passing & no_embargo - - - # subset - data[ ready, ] - }) - - # previously released - released_datasets <- reactive({ - data <- df() - data[ data$released == TRUE, ] - }) - - # render datatables - - mod_datatable_dashboard_server("datatable_dashboard_all", - df, - config) - - mod_datatable_dashboard_server("datatable_dashboard_unreleased", - unreleased_datasets, - config) - - mod_datatable_dashboard_server("datatable_dashboard_not_scheduled", - not_scheduled_datasets, - config) - - mod_datatable_dashboard_server("datatable_dashboard_ready", - all_checks_passed_datasets, - config) - - mod_datatable_dashboard_server("datatable_dashboard_archive", - released_datasets, - config) - }) -} - -## To be copied in the UI -# mod_tabbed_dashboard_ui("tabbed_dashboard_1") - -## To be copied in the server -# mod_tabbed_dashboard_server("tabbed_dashboard_1") diff --git a/R/mod_update_data_flow_status.R b/R/mod_update_data_flow_status.R deleted file mode 100644 index 57d0e17..0000000 --- a/R/mod_update_data_flow_status.R +++ /dev/null @@ -1,99 +0,0 @@ -#' update_data_flow_status UI Function -#' -#' @description A shiny Module. -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_update_data_flow_status_ui <- function(id){ - ns <- NS(id) - tagList( - shinydashboard::box( - title = "Update Data Flow Status", - width = NULL, - - # release scheduled input - mod_scheduler_ui(ns("release_date"), - dateInput_label = h4("Schedule Release"), - checkboxInput_label = "Unschedule Release"), - # embargo input - mod_scheduler_ui(ns("embargo"), - dateInput_label = h4("Schedule Embargo"), - checkboxInput_label = "Unschedule Embargo"), - - # standard compliance input - radioButtons(ns("standard_compliance"), - label = h4("Standard Compliance"), - list("TRUE" = TRUE, "FALSE" = FALSE), - selected = NA), - - # data portal input - radioButtons(ns("data_portal"), - label = h4("Data Portal"), - choices = list("TRUE" = TRUE, "FALSE" = FALSE), - selected = NA), - - # released input - radioButtons(ns("released"), - label = h4("Released"), - choices = list("TRUE" = TRUE, "FALSE" = FALSE), - selected = NA), - - br(), - - # reset button - actionButton(ns("reset_btn"), "Reset Button") - ) - ) -} - - -#' update_data_flow_status Server Functions -#' -#' @noRd -mod_update_data_flow_status_server <- function(id){ - moduleServer( id, function(input, output, session){ - ns <- session$ns - - release_scheduled <- mod_scheduler_server("release_date", - reactive({input$reset_btn})) - - embargo <- mod_scheduler_server("embargo", - reactive({input$reset_btn})) - - observeEvent(input$reset_btn, { - updateRadioButtons(session = session, - inputId = "standard_compliance", - selected = character(0)) - - updateRadioButtons(session = session, - inputId = "data_portal", - selected = character(0)) - - updateRadioButtons(session = session, - inputId = "released", - selected = character(0)) - }) - - res <- reactive({ - list(release_scheduled = release_scheduled(), - embargo = embargo(), - standard_compliance = input$standard_compliance, - data_portal = input$data_portal, - released = input$released) - }) - - - return(reactive({ res() })) - - - }) -} - -## To be copied in the UI -# mod_update_data_flow_status_ui("update_data_flow_status_1") - -## To be copied in the server -# mod_update_data_flow_status_server("update_data_flow_status_1") diff --git a/R/parse_config.R b/R/parse_config.R deleted file mode 100644 index b39ac09..0000000 --- a/R/parse_config.R +++ /dev/null @@ -1,71 +0,0 @@ -#' Parse config to get columns types -#' -#' @param config datatable_dashboard_config.json as a datatable (`jsonlite::read_json("inst/datatable_dashboard_config.json")`) -#' @param type column type as described in datatable_dashboard_config.json -#' -#' @export - -get_colname_by_type <- function(type = c("icon", "drop_down_fliter"), - config) { - - # get all elements with 'type' - type_list <- purrr::map(config, "type") - types <- unlist(type_list) - - #subset types (a names list) where the entry == type - col_names <- names(types[types == type]) - - return(col_names) - -} - -#' Parse config to get display column names for dashboard -#' -#' @param config datatable_dashboard_config.json as a datatable (`jsonlite::read_json("inst/datatable_dashboard_config.json")`) -#' -#' @export - -get_renamed_colnames <- function(config) { - # create a vector of display column names - new_col_names <- purrr::map(config, "col_name") - - purrr::flatten_chr(new_col_names) -} - -#' Parse config to get columns with na_replace specified -#' -#' @param config datatable_dashboard_config.json as a datatable (`jsonlite::read_json("inst/datatable_dashboard_config.json")`) -#' -#' @export - -get_na_replace_colnames <- function(config) { - # create a vector of display column names - col_names <- purrr::map(config, "na_replace") - names(purrr::flatten(col_names)) -} - -#' Parse config to get na replacement definitions with custom javascript. Outputs a list. -#' -#' @param config datatable_dashboard_config.json as a datatable (`jsonlite::read_json("inst/datatable_dashboard_config.json")`) -#' @param prepped_dataframe dataframe output by `prep_df_for_dash()` -#' -#' @export - -get_na_replace_defs <- function(prepped_dataframe, - config) { - - # get na_replace columns - na_replace_cols <- get_na_replace_colnames(config) - - # get colname index in prepped dataframe - na_replace_idx <- match(na_replace_cols, names(prepped_dataframe)) - - defs <- lapply(seq_along(na_replace_cols), function(i) { - colname <- na_replace_cols[i] - replacement <- config[[colname]]$na_replace - dt_replace_na(na_replace_idx[i], - replacement) - }) - - return(defs) -} diff --git a/R/schematic_rest_api.R b/R/schematic_rest_api.R deleted file mode 100644 index 6fd4a57..0000000 --- a/R/schematic_rest_api.R +++ /dev/null @@ -1,373 +0,0 @@ -############################# -## Schematic API Functions ## -############################# - -# Functions follow best practice convention laid out in httr vingette -# https://httr.r-lib.org/articles/api-packages.html - -#' Download a manifest -#' -#' @param asset_view ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml) -#' @param dataset_id Synapse ID of existing manifest -#' @param input_token Synapse login cookie, PAT, or API key. -#' @param base_url URL to schematic API endpoint - -#' @export - -manifest_download <- function(asset_view, - dataset_id, - input_token, - base_url = "https://schematic-dev.api.sagebionetworks.org") { - - # create api url - url <- paste0(base_url, "/v1/manifest/download") - - # set up parameters for httr::get call - params = list( - `input_token` = input_token, - `asset_view` = asset_view, - `dataset_id` = dataset_id, - `as_json` = TRUE, - `new_manifest_name` = NULL - ) - - # run GET - res <- httr::GET(url = url, query = params) - - # check that application returns json - # even when json = TRUE, http_type = "text/csv" - # if (httr::http_type(res) != "application/json") { - # stop("API did not return json", call. = FALSE) - # } - - # pull out content from request - parsed <- suppressMessages(jsonlite::fromJSON(httr::content(res, as = "text"))) - - # if the api call returns an error - # surface error to user - if (httr::http_error(res)) { - stop( - sprintf( - "Schematic API request failed [%s]\n%s", - httr::status_code(res), - parsed$detail - ), - call. = FALSE - ) - } - - # return a helpful object - structure( - list( - content = parsed, - response = res - ), - class = "schematic_api" - ) -} - -#' schematic rest api to submit metadata -#' -#' @param data_type Type of dataset. Set to None for no validation check -#' @param asset_view ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml) -#' @param dataset_id Synapse ID of existing manifest -#' @param file_name Filepath of csv to validate -#' @param input_token Synapse login cookie, PAT, or API key -#' @param restrict_rules If True, validation suite will only run with in-house validation rule. If False, the Great Expectations suite will be utilized and all rules will be available. -#' @param manifest_record_type Manifest storage type. Options: "--", "table" (default), "entity", "both". -#' @param base_url URL to schematic API endpoint -#' @param schema_url URL to a schema jsonld -#' -#' @returns TRUE if successful upload or validate errors if not. -#' @export - -model_submit <- function(data_type = NULL, - asset_view, - dataset_id, - file_name, - input_token, - restrict_rules = TRUE, - manifest_record_type = "table_and_file", - base_url = "https://schematic-dev.api.sagebionetworks.org", - schema_url="https://raw.githubusercontent.com/Sage-Bionetworks/data_flow/main/inst/data_flow_component.jsonld", - use_schema_label = TRUE) { - - # create url - url <- paste0(base_url, "/v1/model/submit") - - # set up parameters for httr::get call - params = list( - `schema_url` = schema_url, - `data_type` = data_type, - `dataset_id` = dataset_id, - `manifest_record_type` = manifest_record_type, - `restrict_rules` = restrict_rules, - `asset_view` = asset_view, - `input_token` = input_token, - `use_schema_label` = use_schema_label - ) - - files = list( - `file_name` = httr::upload_file(file_name) - ) - - # POST - res <- httr::POST(url = url, - query = params, - body = files) - - # parse response for content - parsed <- httr::content(res) - - # if the api call returns an error - # surface error to user - if (httr::http_error(res)) { - stop( - sprintf( - "Schematic API request failed [%s]", - httr::status_code(res) - ), - call. = FALSE - ) - } - - # return a helpful object - structure( - list( - content = parsed, - response = res - ), - class = "schematic_api" - ) -} - -#' Gets all datasets in folder under a given storage project that the current user has access to. -#' -#' @param asset_view synapse ID of master file view. -#' @param project_id synapse ID of a storage project. -#' @param input_token synapse PAT -#' @param base_url URL to schematic API endpoint -#' -#'@export - -storage_project_datasets <- function(asset_view, - project_id, - input_token, - base_url = "https://schematic-dev.api.sagebionetworks.org") { - - # create url - url <- paste0(base_url, "/v1/storage/project/datasets") - - # set up parameters for httr::get call - params <- list( - asset_view = asset_view, - project_id = project_id, - input_token = input_token) - - # GET - res <- httr::GET(url, query = params) - - # pull out content from request - parsed <- suppressMessages(jsonlite::fromJSON(httr::content(res, as = "text"))) - - # if the api call returns an error - # surface error to user - if (httr::http_error(res)) { - stop( - sprintf( - "Schematic API request failed [%s]\n%s", - httr::status_code(res), - parsed$detail - ), - call. = FALSE - ) - } - - # return parsed matrix as dataframe - parsed_df <-data.frame(parsed) - names(parsed_df) <- c("id", "name") - - # return a helpful object - structure( - list( - content = parsed_df, - response = res - ), - class = "schematic_api" - ) -} - -#' Get all storage projects the current user has access to -#' -#' @param asset_view synapse ID of master file view. -#' @param input_token synapse PAT -#' @param base_url URL to schematic API endpoint -#' -#' @export - -storage_projects <- function(asset_view, - input_token, - base_url = "https://schematic-dev.api.sagebionetworks.org") { - - # create url - url <- paste0(base_url, "/v1/storage/projects") - - # set up parameters for httr::get call - params <- list( - asset_view = asset_view, - input_token = input_token - ) - - # GET - res <- httr::GET(url, query = params) - - # pull out content from request - parsed <- suppressMessages(jsonlite::fromJSON(httr::content(res, as = "text"))) - - # if the api call returns an error - # surface error to user - if (httr::http_error(res)) { - stop( - sprintf( - "Schematic API request failed [%s]\n%s", - httr::status_code(res), - parsed$detail - ), - call. = FALSE - ) - } - - # return parsed matrix as dataframe - parsed_df <- data.frame(parsed) - names(parsed_df) <- c("id", "name") - - # return a helpful object - structure( - list( - content = parsed_df, - response = res - ), - class = "schematic_api" - ) -} - -#' /storage/project/manifests -#' -#' @param asset_view synapse ID of master file view. -#' @param dataset_id synapse ID of a storage dataset. -#' @param input_token synapse PAT -#' @param base_url URL to schematic API endpoint -#' -#' @export - -storage_project_manifests <- function(asset_view, - project_id, - input_token, - base_url = "https://schematic-dev.api.sagebionetworks.org") { - - # write URL - url <- paste0(base_url, "/v1/storage/project/manifests") - - # set up parameters for httr::get call - params = list( - `input_token` = input_token, - `project_id` = project_id, - `asset_view` = asset_view - ) - - #GET - res <- httr::GET(url = url, query = params) - - # pull out content from request - parsed <- suppressMessages(jsonlite::fromJSON(httr::content(res, as = "text"))) - - # if the api call returns an error - # surface error to user - if (httr::http_error(res)) { - stop( - sprintf( - "Schematic API request failed [%s]\n%s", - httr::status_code(res), - parsed$detail - ), - call. = FALSE - ) - } - - # return parsed matrix as dataframe - parsed_df <- data.frame(parsed) - - # if dataframe has content, name columns - if (nrow(parsed_df) > 0) { - names(parsed_df) <- c("dataset_id", "manifest_id", "data_type", "folder_name", "file_name") - # drop redundant data type column - parsed_df <- parsed_df[,-6] - } - - # return a helpful object - structure( - list( - content = parsed_df, - response = res - ), - class = "schematic_api" - ) -} - - -# print method for schematic_api class of functions -print.schematic_api <- function(x, ...) { - str(x$content) - invisible(x) -} - -## ARCHIVE #################################################################### -# -# THIS FUNCTION IS UNTESTED AND NOT USED ANYMORE -# -# storage_dataset_files <- function(asset_view, -# dataset_id, -# input_token, -# file_names=list(), -# full_path=FALSE, -# base_url = "https://schematic-dev.api.sagebionetworks.org") { -# -# # create url -# url <- paste0(base_url, "/v1/storage/dataset/files") -# -# # set up parameters for httr::get call -# params <- list( -# asset_view = asset_view, -# dataset_id = dataset_id, -# file_names = file_names, -# full_path = full_path, -# input_token = input_token) -# -# # GET -# res <- httr::GET(url, query = params) -# -# # pull out content from request -# parsed <- jsonlite::fromJSON(httr::content(res, as = "text")) -# -# # if the api call returns an error -# # surface error to user -# if (httr::http_error(res)) { -# stop( -# sprintf( -# "Schematic API request failed [%s]\n%s", -# httr::status_code(res), -# parsed$detail -# ), -# call. = FALSE -# ) -# } -# -# # return a helpful object -# structure( -# list( -# content = parsed, -# response = res -# ), -# class = "schematic_api" -# ) -# } diff --git a/R/utility.R b/R/utility.R deleted file mode 100644 index cb1ea93..0000000 --- a/R/utility.R +++ /dev/null @@ -1,99 +0,0 @@ -############################### -## Generic Utility Functions ## -############################### - -#' Convert a list to a dataframe -#' -#' @param list A list of items. Only works where list entries all follow the same pattern. -#' @param col_names Desired column names. Ex: `c("id", "name")` -#' -#' @export - -list_to_dataframe <- function(list, - col_names = NULL) { - - # convert list to dataframe - df <- data.frame(do.call(rbind, list)) - - if (length(list) != 1){ - # for some reason the columns of this df are class = list - # this hasn't really caused a problem, but I want class = char - df <- data.frame(apply(df, 2, unlist)) - } - - # if colnames are specified, add them - if (!is.null(col_names)) { - names(df) <- col_names - } - - return(df) -} - -#' Convert date columns from date to string -#' -#' @param df a data flow status manifest. -#' @param col_names columns to update -#' @param type date, character, integer, logical, icon, or factor -#' -#' @export - -convert_column_type <- function(df, - col_names, - type) { - if (type == "date") { - df[col_names] <- lapply(df[,col_names], as.Date) - } else if (type == "character") { - df[col_names] <- sapply(df[,col_names], as.character) - } else if (type == "factor") { - df[col_names] <- lapply(df[,col_names], as.factor) - } else if (type == "logical") { - df[col_names] <- sapply(df[,col_names], as.logical) - } else if (type == "integer") { - df[col_names] <- sapply(df[,col_names], as.integer) - } else if (type == "icon") { - df[col_names] <- sapply(df[,col_names], true_false_icon) - } else { - stop(paste0(type, " is not a supported date type")) - } - - return(df) -} - -#' Convert a vector of TRUE/FALSE to icon html -#' -#' @param vec A vector of TRUE/FALSE -#' -#' @export - -true_false_icon <- function(vec) { - - # if true assign checkmark icon - # if false assign x icon - true_icon <- as.character(icon("check", lib = "font-awesome")) - false_icon <- as.character(icon("xmark", lib = "font-awesome")) - - ifelse(vec == TRUE, true_icon, false_icon) -} - -#' Rearrange a dataframe. Expected columns are ordered to match `expected_col_names` and moved to the front of the dataframe. Unexpected columns are moved to the back of the dataframe. -#' -#' @param df a dataframe -#' @param expected_col_names a vector of expected column names in the order you would like them to appear. -#' -#' @export - -rearrange_dataframe <- function(df, - expected_col_names) { - - # capture column names of unexpected columns - other_column_names <- setdiff(names(df), expected_col_names) - - # create separate dataframes - # order expected columns to match expected_col_names - exected_df <- df[expected_col_names] - other_df <- df[other_column_names] - - # bind back together - dplyr::bind_cols(exected_df, other_df) - -} \ No newline at end of file diff --git a/R/utils-pipe.R b/R/utils-pipe.R deleted file mode 100644 index fd0b1d1..0000000 --- a/R/utils-pipe.R +++ /dev/null @@ -1,14 +0,0 @@ -#' Pipe operator -#' -#' See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details. -#' -#' @name %>% -#' @rdname pipe -#' @keywords internal -#' @export -#' @importFrom magrittr %>% -#' @usage lhs \%>\% rhs -#' @param lhs A value or the magrittr placeholder. -#' @param rhs A function call using the magrittr semantics. -#' @return The result of calling `rhs(lhs)`. -NULL diff --git a/man/calculate_items_per_manifest.Rd b/man/calculate_items_per_manifest.Rd deleted file mode 100644 index c28fdb0..0000000 --- a/man/calculate_items_per_manifest.Rd +++ /dev/null @@ -1,20 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/api_wrappers.R -\name{calculate_items_per_manifest} -\alias{calculate_items_per_manifest} -\title{Call `calculate_items_per_manifest` calculate the number of items per manifest synID in a given dataframe} -\usage{ -calculate_items_per_manifest(df, asset_view, input_token, base_url) -} -\arguments{ -\item{df}{A dataframe with `entityId` and `dataset` columns from data flow status manifest} - -\item{asset_view}{ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml)} - -\item{input_token}{Synapse PAT} - -\item{base_url}{Base URL of schematic API} -} -\description{ -Call `calculate_items_per_manifest` calculate the number of items per manifest synID in a given dataframe -} diff --git a/man/convert_column_type.Rd b/man/convert_column_type.Rd deleted file mode 100644 index 969a2ac..0000000 --- a/man/convert_column_type.Rd +++ /dev/null @@ -1,18 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utility.R -\name{convert_column_type} -\alias{convert_column_type} -\title{Convert date columns from date to string} -\usage{ -convert_column_type(df, col_names, type) -} -\arguments{ -\item{df}{a data flow status manifest.} - -\item{col_names}{columns to update} - -\item{type}{date, character, integer, logical, icon, or factor} -} -\description{ -Convert date columns from date to string -} diff --git a/man/create_dashboard.Rd b/man/create_dashboard.Rd deleted file mode 100644 index 425f1ec..0000000 --- a/man/create_dashboard.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/datatable_functions.R -\name{create_dashboard} -\alias{create_dashboard} -\title{Create a dashboard style datatable} -\usage{ -create_dashboard(df, past_due_col, config) -} -\arguments{ -\item{df}{A dataframe prepared by `prep_df_for_dash()` with the columns `Contributor`, `Dataset_Name`, `Dataset_Type`, `Num_Items`, `Release_Scheduled`, `Embargo`, `Standard_Compliance`, `QC_Compliance`,`PHI_Detection_Compliance`, `Access_Controls_Compliance`, `Data_Portal`, `Released`, `past_due`} - -\item{config}{Config for datatable dashboard module in `inst/datatable_dashboard_config.json`} -} -\description{ -Create a dashboard style datatable -} diff --git a/man/dt_replace_na.Rd b/man/dt_replace_na.Rd deleted file mode 100644 index 64d7c13..0000000 --- a/man/dt_replace_na.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/datatable_functions.R -\name{dt_replace_na} -\alias{dt_replace_na} -\title{NA replacement - datatable custom JS} -\usage{ -dt_replace_na(col_index, na_replacement) -} -\arguments{ -\item{col_index}{target columns index} - -\item{na_replacement}{text to replace NA} -} -\description{ -NA replacement - datatable custom JS -} diff --git a/man/generate_data_flow_manifest_skeleton.Rd b/man/generate_data_flow_manifest_skeleton.Rd deleted file mode 100644 index 7796b74..0000000 --- a/man/generate_data_flow_manifest_skeleton.Rd +++ /dev/null @@ -1,27 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/manifest.R -\name{generate_data_flow_manifest_skeleton} -\alias{generate_data_flow_manifest_skeleton} -\title{Generate a data flow status manifest skeleton. Fills in the component, contributor, data type, number of items, and dataset name columns.} -\usage{ -generate_data_flow_manifest_skeleton( - asset_view, - input_token, - calc_num_items, - base_url = "https://schematic-dev.api.sagebionetworks.org" -) -} -\arguments{ -\item{asset_view}{ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml)} - -\item{calc_num_items}{TRUE/FALSE. Calculate the number of items in each manifest.} - -\item{base_url}{Base URL of schematic API} - -\item{storage_project_list}{List output from `storage_projects` schematic endpoint} - -\item{dataset_id}{Synapse ID of existing manifest} -} -\description{ -Generate a data flow status manifest skeleton. Fills in the component, contributor, data type, number of items, and dataset name columns. -} diff --git a/man/get_all_manifests.Rd b/man/get_all_manifests.Rd deleted file mode 100644 index d349076..0000000 --- a/man/get_all_manifests.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/api_wrappers.R -\name{get_all_manifests} -\alias{get_all_manifests} -\title{Call `storage/project/manifests` Schematic endpoint for a given asset_view} -\usage{ -get_all_manifests( - asset_view, - input_token, - base_url = "https://schematic-dev.api.sagebionetworks.org", - verbose = FALSE -) -} -\arguments{ -\item{asset_view}{ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml)} - -\item{input_token}{Synapse PAT} - -\item{base_url}{Base URL of schematic API} - -\item{verbose}{T/F for console messages} -} -\description{ -Call `storage/project/manifests` Schematic endpoint for a given asset_view -} diff --git a/man/get_colname_by_type.Rd b/man/get_colname_by_type.Rd deleted file mode 100644 index 1dddc1b..0000000 --- a/man/get_colname_by_type.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/parse_config.R -\name{get_colname_by_type} -\alias{get_colname_by_type} -\title{Parse config to get columns types} -\usage{ -get_colname_by_type(type = c("icon", "drop_down_fliter"), config) -} -\arguments{ -\item{type}{column type as described in datatable_dashboard_config.json} - -\item{config}{datatable_dashboard_config.json as a datatable (`jsonlite::read_json("inst/datatable_dashboard_config.json")`)} -} -\description{ -Parse config to get columns types -} diff --git a/man/get_na_replace_colnames.Rd b/man/get_na_replace_colnames.Rd deleted file mode 100644 index fc33f4a..0000000 --- a/man/get_na_replace_colnames.Rd +++ /dev/null @@ -1,14 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/parse_config.R -\name{get_na_replace_colnames} -\alias{get_na_replace_colnames} -\title{Parse config to get columns with na_replace specified} -\usage{ -get_na_replace_colnames(config) -} -\arguments{ -\item{config}{datatable_dashboard_config.json as a datatable (`jsonlite::read_json("inst/datatable_dashboard_config.json")`)} -} -\description{ -Parse config to get columns with na_replace specified -} diff --git a/man/get_na_replace_defs.Rd b/man/get_na_replace_defs.Rd deleted file mode 100644 index 204c444..0000000 --- a/man/get_na_replace_defs.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/parse_config.R -\name{get_na_replace_defs} -\alias{get_na_replace_defs} -\title{Parse config to get na replacement definitions with custom javascript. Outputs a list.} -\usage{ -get_na_replace_defs(prepped_dataframe, config) -} -\arguments{ -\item{prepped_dataframe}{dataframe output by `prep_df_for_dash()`} - -\item{config}{datatable_dashboard_config.json as a datatable (`jsonlite::read_json("inst/datatable_dashboard_config.json")`)} -} -\description{ -Parse config to get na replacement definitions with custom javascript. Outputs a list. -} diff --git a/man/get_renamed_colnames.Rd b/man/get_renamed_colnames.Rd deleted file mode 100644 index e7afd01..0000000 --- a/man/get_renamed_colnames.Rd +++ /dev/null @@ -1,14 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/parse_config.R -\name{get_renamed_colnames} -\alias{get_renamed_colnames} -\title{Parse config to get display column names for dashboard} -\usage{ -get_renamed_colnames(config) -} -\arguments{ -\item{config}{datatable_dashboard_config.json as a datatable (`jsonlite::read_json("inst/datatable_dashboard_config.json")`)} -} -\description{ -Parse config to get display column names for dashboard -} diff --git a/man/list_to_dataframe.Rd b/man/list_to_dataframe.Rd deleted file mode 100644 index a620756..0000000 --- a/man/list_to_dataframe.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utility.R -\name{list_to_dataframe} -\alias{list_to_dataframe} -\title{Convert a list to a dataframe} -\usage{ -list_to_dataframe(list, col_names = NULL) -} -\arguments{ -\item{list}{A list of items. Only works where list entries all follow the same pattern.} - -\item{col_names}{Desired column names. Ex: `c("id", "name")`} -} -\description{ -Convert a list to a dataframe -} diff --git a/man/manifest_download.Rd b/man/manifest_download.Rd deleted file mode 100644 index 643bc67..0000000 --- a/man/manifest_download.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/schematic_rest_api.R -\name{manifest_download} -\alias{manifest_download} -\title{Download a manifest} -\usage{ -manifest_download( - asset_view, - dataset_id, - input_token, - base_url = "https://schematic-dev.api.sagebionetworks.org" -) -} -\arguments{ -\item{asset_view}{ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml)} - -\item{dataset_id}{Synapse ID of existing manifest} - -\item{input_token}{Synapse login cookie, PAT, or API key.} - -\item{base_url}{URL to schematic API endpoint} -} -\description{ -Download a manifest -} diff --git a/man/model_submit.Rd b/man/model_submit.Rd deleted file mode 100644 index 03b80c3..0000000 --- a/man/model_submit.Rd +++ /dev/null @@ -1,45 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/schematic_rest_api.R -\name{model_submit} -\alias{model_submit} -\title{schematic rest api to submit metadata} -\usage{ -model_submit( - data_type = NULL, - asset_view, - dataset_id, - file_name, - input_token, - restrict_rules = TRUE, - manifest_record_type = "table", - base_url = "https://schematic-dev.api.sagebionetworks.org", - schema_url = - "https://raw.githubusercontent.com/Sage-Bionetworks/data_flow/main/inst/data_flow_component.jsonld", - use_schema_label = TRUE -) -} -\arguments{ -\item{data_type}{Type of dataset. Set to None for no validation check} - -\item{asset_view}{ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml)} - -\item{dataset_id}{Synapse ID of existing manifest} - -\item{file_name}{Filepath of csv to validate} - -\item{input_token}{Synapse login cookie, PAT, or API key} - -\item{restrict_rules}{If True, validation suite will only run with in-house validation rule. If False, the Great Expectations suite will be utilized and all rules will be available.} - -\item{manifest_record_type}{Manifest storage type. Options: "--", "table" (default), "entity", "both".} - -\item{base_url}{URL to schematic API endpoint} - -\item{schema_url}{URL to a schema jsonld} -} -\value{ -TRUE if successful upload or validate errors if not. -} -\description{ -schematic rest api to submit metadata -} diff --git a/man/pipe.Rd b/man/pipe.Rd deleted file mode 100644 index 1f8f237..0000000 --- a/man/pipe.Rd +++ /dev/null @@ -1,20 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utils-pipe.R -\name{\%>\%} -\alias{\%>\%} -\title{Pipe operator} -\usage{ -lhs \%>\% rhs -} -\arguments{ -\item{lhs}{A value or the magrittr placeholder.} - -\item{rhs}{A function call using the magrittr semantics.} -} -\value{ -The result of calling `rhs(lhs)`. -} -\description{ -See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details. -} -\keyword{internal} diff --git a/man/prep_manifest_dash.Rd b/man/prep_manifest_dash.Rd deleted file mode 100644 index ddeb0b6..0000000 --- a/man/prep_manifest_dash.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/datatable_functions.R -\name{prep_manifest_dash} -\alias{prep_manifest_dash} -\title{Prepare a dataframe for a dashboard style datatable} -\usage{ -prep_manifest_dash(df, past_due_col, config) -} -\arguments{ -\item{df}{A dataframe with the columns `Contributor`, `Dataset_Name`, `Dataset_Type`, `Num_Items`, `Release_Scheduled`, `Embargo`, `Standard_Compliance`, `QC_Compliance`,`PHI_Detection_Compliance`, `Access_Controls_Compliance`, `Data_Portal`, `Released`, `past_due`} - -\item{config}{Config for datatable dashboard module in `inst/datatable_dashboard_config.json`} -} -\description{ -Prepare a dataframe for a dashboard style datatable -} diff --git a/man/prep_manifest_dfa.Rd b/man/prep_manifest_dfa.Rd deleted file mode 100644 index ecf9ac2..0000000 --- a/man/prep_manifest_dfa.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/manifest.R -\name{prep_manifest_dfa} -\alias{prep_manifest_dfa} -\title{Prepare a dataframe that has been downloaded from Synapse for the Data Flow App} -\usage{ -prep_manifest_dfa(manifest, config) -} -\arguments{ -\item{manifest}{A manifest that has been downloaded from using manifest_download_to_df()} - -\item{config}{`datatable_dashboard_config.json` read in as a dataframe} -} -\description{ -Prepare a dataframe that has been downloaded from Synapse for the Data Flow App -} diff --git a/man/prep_manifest_submit.Rd b/man/prep_manifest_submit.Rd deleted file mode 100644 index 8b936c1..0000000 --- a/man/prep_manifest_submit.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/manifest.R -\name{prep_manifest_submit} -\alias{prep_manifest_submit} -\title{Prepare a dataframe for Synapse submission} -\usage{ -prep_manifest_submit(manifest, config) -} -\arguments{ -\item{manifest}{A manifest that has been downloaded from using manifest_download_to_df()} - -\item{config}{`datatable_dashboard_config.json` read in as a dataframe} -} -\description{ -Prepare a dataframe for Synapse submission -} diff --git a/man/rearrange_dataframe.Rd b/man/rearrange_dataframe.Rd deleted file mode 100644 index eaa49fe..0000000 --- a/man/rearrange_dataframe.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utility.R -\name{rearrange_dataframe} -\alias{rearrange_dataframe} -\title{Rearrange a dataframe. Expected columns are ordered to match `expected_col_names` and moved to the front of the dataframe. Unexpected columns are moved to the back of the dataframe.} -\usage{ -rearrange_dataframe(df, expected_col_names) -} -\arguments{ -\item{df}{a dataframe} - -\item{expected_col_names}{a vector of expected column names in the order you would like them to appear.} -} -\description{ -Rearrange a dataframe. Expected columns are ordered to match `expected_col_names` and moved to the front of the dataframe. Unexpected columns are moved to the back of the dataframe. -} diff --git a/man/storage_project_datasets.Rd b/man/storage_project_datasets.Rd deleted file mode 100644 index e42b87b..0000000 --- a/man/storage_project_datasets.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/schematic_rest_api.R -\name{storage_project_datasets} -\alias{storage_project_datasets} -\title{Gets all datasets in folder under a given storage project that the current user has access to.} -\usage{ -storage_project_datasets( - asset_view, - project_id, - input_token, - base_url = "https://schematic-dev.api.sagebionetworks.org" -) -} -\arguments{ -\item{asset_view}{synapse ID of master file view.} - -\item{project_id}{synapse ID of a storage project.} - -\item{input_token}{synapse PAT} - -\item{base_url}{URL to schematic API endpoint} -} -\description{ -Gets all datasets in folder under a given storage project that the current user has access to. -} diff --git a/man/storage_project_manifests.Rd b/man/storage_project_manifests.Rd deleted file mode 100644 index 998ee53..0000000 --- a/man/storage_project_manifests.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/schematic_rest_api.R -\name{storage_project_manifests} -\alias{storage_project_manifests} -\title{/storage/project/manifests} -\usage{ -storage_project_manifests( - asset_view, - project_id, - input_token, - base_url = "https://schematic-dev.api.sagebionetworks.org" -) -} -\arguments{ -\item{asset_view}{synapse ID of master file view.} - -\item{input_token}{synapse PAT} - -\item{base_url}{URL to schematic API endpoint} - -\item{dataset_id}{synapse ID of a storage dataset.} -} -\description{ -/storage/project/manifests -} diff --git a/man/storage_projects.Rd b/man/storage_projects.Rd deleted file mode 100644 index 7cd6ff5..0000000 --- a/man/storage_projects.Rd +++ /dev/null @@ -1,22 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/schematic_rest_api.R -\name{storage_projects} -\alias{storage_projects} -\title{Get all storage projects the current user has access to} -\usage{ -storage_projects( - asset_view, - input_token, - base_url = "https://schematic-dev.api.sagebionetworks.org" -) -} -\arguments{ -\item{asset_view}{synapse ID of master file view.} - -\item{input_token}{synapse PAT} - -\item{base_url}{URL to schematic API endpoint} -} -\description{ -Get all storage projects the current user has access to -} diff --git a/man/style_dashboard.Rd b/man/style_dashboard.Rd deleted file mode 100644 index 9ba6b24..0000000 --- a/man/style_dashboard.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/datatable_functions.R -\name{style_dashboard} -\alias{style_dashboard} -\title{Add custom styling to dashboard based on contents of config} -\usage{ -style_dashboard(prepped_manifest, config) -} -\arguments{ -\item{prepped_manifest}{A manifest prepped with `prep_manifest_dash()`} - -\item{config}{`inst/datatable_dashboard_config.json`} -} -\description{ -Add custom styling to dashboard based on contents of config -} diff --git a/man/true_false_icon.Rd b/man/true_false_icon.Rd deleted file mode 100644 index 17e3c7f..0000000 --- a/man/true_false_icon.Rd +++ /dev/null @@ -1,14 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utility.R -\name{true_false_icon} -\alias{true_false_icon} -\title{Convert a vector of TRUE/FALSE to icon html} -\usage{ -true_false_icon(vec) -} -\arguments{ -\item{vec}{A vector of TRUE/FALSE} -} -\description{ -Convert a vector of TRUE/FALSE to icon html -} diff --git a/man/update_data_flow_manifest.Rd b/man/update_data_flow_manifest.Rd deleted file mode 100644 index 346a785..0000000 --- a/man/update_data_flow_manifest.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/manifest.R -\name{update_data_flow_manifest} -\alias{update_data_flow_manifest} -\title{Check synapse for updates to data flow status manifest} -\usage{ -update_data_flow_manifest( - asset_view, - manifest_dataset_id, - input_token, - base_url -) -} -\arguments{ -\item{asset_view}{ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml)} - -\item{manifest_dataset_id}{Dataset ID for data flow status manifest to be updated} - -\item{input_token}{Synapse PAT} - -\item{base_url}{Base URL of schematic API (Defaults to AWS version)} -} -\description{ -Check synapse for updates to data flow status manifest -} diff --git a/man/update_dfs_manifest.Rd b/man/update_dfs_manifest.Rd deleted file mode 100644 index ef23f5a..0000000 --- a/man/update_dfs_manifest.Rd +++ /dev/null @@ -1,18 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/manifest.R -\name{update_dfs_manifest} -\alias{update_dfs_manifest} -\title{Convert a list to a dataframe} -\usage{ -update_dfs_manifest(dfs_manifest, dfs_updates, selected_datasets_df) -} -\arguments{ -\item{dfs_updates}{Output from mod_update_data_flow_status.R} - -\item{selected_datasets_df}{Output from mod_dataset_selection.R} - -\item{dfs_status_manifest}{A data flow status manifest} -} -\description{ -Convert a list to a dataframe -} From d37a01d4568a00bc013bec59ebf69b960c9abe23 Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Thu, 20 Apr 2023 13:44:00 -0700 Subject: [PATCH 02/38] remove dfamodules tests --- tests/testthat/test-datatable.R | 15 ------ tests/testthat/test-manifest.R | 73 ----------------------------- tests/testthat/test-parse_config.R | 46 ------------------ tests/testthat/test-schematic-api.R | 70 --------------------------- tests/testthat/test-utility.R | 59 ----------------------- 5 files changed, 263 deletions(-) delete mode 100644 tests/testthat/test-datatable.R delete mode 100644 tests/testthat/test-manifest.R delete mode 100644 tests/testthat/test-parse_config.R delete mode 100644 tests/testthat/test-schematic-api.R delete mode 100644 tests/testthat/test-utility.R diff --git a/tests/testthat/test-datatable.R b/tests/testthat/test-datatable.R deleted file mode 100644 index e2e4066..0000000 --- a/tests/testthat/test-datatable.R +++ /dev/null @@ -1,15 +0,0 @@ -test_that("dt_replace_na", { - - expected_output <- list(targets = 1, - render = DT::JS( - "function(data, type, row, meta) {", - "return data === null ? 'Not Applicable' : data;", - "}" - )) - - expect_equal(dt_replace_na(col_index = 1, - na_replacement = "Not Applicable"), - expected_output) -}) - -# FIXME how to test DT::datatable output? \ No newline at end of file diff --git a/tests/testthat/test-manifest.R b/tests/testthat/test-manifest.R deleted file mode 100644 index f85159d..0000000 --- a/tests/testthat/test-manifest.R +++ /dev/null @@ -1,73 +0,0 @@ -# read in test config -config <- jsonlite::read_json("../../inst/testing/datatable_dashboard_config.json") - -# make mock synapse / submission ready manifest -manifest_synapse <- data.frame(Component = rep("DataFlow", 4), - contributor = rep("schematic - main", 4), - entityId = paste0("syn", 1:4), - dataset_name = paste0("dataset_name", 1:4), - dataset = rep("Biospecimen", 4), - num_items = c(rep("Not Applicable", 3), "1"), - release_scheduled = c(rep("Not Applicable", 2), - rep("2050-01-01", 2)), - embargo = c(rep("Not Applicable", 2), - rep("2050-01-01", 2)), - standard_compliance = rep(FALSE, 4), - data_portal = rep(FALSE, 4), - released = rep(FALSE, 4)) - -# make mock dfa ready manifest -manifest_dfa <- data.frame(Component = rep("DataFlow", 4), - contributor = rep(as.factor("schematic - main"), 4), - entityId = paste0("syn", 1:4), - dataset_name = paste0("dataset_name", 1:4), - dataset = rep(as.factor("Biospecimen"), 4), - num_items = c(rep(NA, 3), 1), - release_scheduled = c(rep(as.Date(NA), 2), - rep(as.Date("2050-01-01"), 2)), - embargo = c(rep(as.Date(NA), 2), - rep(as.Date("2050-01-01"), 2)), - standard_compliance = rep(FALSE, 4), - data_portal = rep(FALSE, 4), - released = rep(FALSE, 4)) - -# tests - -test_that("update_dfs_manifest", { - - dfs_updates <- list(release_scheduled = as.Date("2022-01-01"), - embargo = as.Date("2022-01-01"), - standard_compliance = TRUE, - data_portal = TRUE, - released = TRUE) - - selected_datasets_df <- data.frame(id = c("syn1"), name = "dataset_name1") - - expected_updated_row <- data.frame(Component = "DataFlow", - contributor = as.factor("schematic - main"), - entityId = "syn1", - dataset_name = paste0("dataset_name", 1), - dataset = as.factor("Biospecimen"), - num_items = as.numeric(NA), - release_scheduled = as.Date("2022-01-01"), - embargo = as.Date("2022-01-01"), - standard_compliance = TRUE, - data_portal = TRUE, - released = TRUE) - expected_df <- rbind(expected_updated_row, manifest_dfa[-1,]) - - expect_equal(update_dfs_manifest(dfs_manifest = manifest_dfa, - dfs_updates = dfs_updates, - selected_datasets_df = selected_datasets_df), - expected_df) -}) - -test_that("prep_manifest_dfa", { - expect_equal(prep_manifest_dfa(manifest_synapse, config), - manifest_dfa) -}) - -test_that("prep_manifest_submit", { - expect_equal(prep_manifest_submit(manifest_dfa, config), - manifest_synapse) -}) diff --git a/tests/testthat/test-parse_config.R b/tests/testthat/test-parse_config.R deleted file mode 100644 index bc3dd82..0000000 --- a/tests/testthat/test-parse_config.R +++ /dev/null @@ -1,46 +0,0 @@ -test_that("get_colname_by_type", { - tst_json <- '{"contributor": {"type": "type_1"}, "release_scheduled": {"type": "type_2"}, "entityId": {"type": "type_3"}}' - - expected_output <- c("contributor", "entityId") - - expect_equal(c(get_colname_by_type(type = "type_1", config = jsonlite::fromJSON(tst_json)), - get_colname_by_type(type = "type_3", config = jsonlite::fromJSON(tst_json))), - expected_output) -}) - -test_that("get_renamed_colnames", { - tst_json <- '{"contributor": {"col_name": "Contributor"}, "release_scheduled": {"col_name": "RELEASE DATE"}, "entityId": {"col_name": "Synapse ID"}}' - - expected_output <- c("Contributor", "RELEASE DATE", "Synapse ID") - - expect_equal(get_renamed_colnames(config = jsonlite::fromJSON(tst_json)), - expected_output) -}) - -test_that("get_na_replace_colnames", { - tst_json <- '{"contributor": {"na_replace": "Unknown"}, "release_scheduled": {"type": "type_1"}, "entityId": {"na_replace": "NO ID"}}' - - expected_output <- c("contributor", "entityId") - - expect_equal(get_na_replace_colnames(config = jsonlite::fromJSON(tst_json)), - expected_output) -}) - -test_that("get_na_replace_defs", { - tst_json <- '{"contributor": {"na_replace": "Unknown"}, "release_scheduled": {"type": "type_1"}}' - tst_manifest <- data.frame(contributor = c("Center A", NA, "Center B"), - entityId = c("syn123", "syn987", NA), - release_scheduled = c(as.Date("2050-01-01"), as.Date("2050-01-01"), NA)) - - - expected_output <- list(list(targets = 1, - render = DT::JS( - "function(data, type, row, meta) {", - "return data === null ? 'Unknown' : data;", - "}" - ))) - - expect_equal(get_na_replace_defs(prepped_dataframe = tst_manifest, - config = jsonlite::fromJSON(tst_json)), - expected_output) -}) \ No newline at end of file diff --git a/tests/testthat/test-schematic-api.R b/tests/testthat/test-schematic-api.R deleted file mode 100644 index 539b41a..0000000 --- a/tests/testthat/test-schematic-api.R +++ /dev/null @@ -1,70 +0,0 @@ -# adapted from afwillia's work on data_curator -# (https://github.com/Sage-Bionetworks/data_curator/blob/schematic-rest-api/tests/testthat/test_schematic_rest_api.R) - -# VARIABLES ############################################################################# -# FAIR DEMO DATA PROJECT A -asset_view <- "syn50896957" -project_id <- "syn50896931" -dataset_id <- "syn51219090" -input_token <- Sys.getenv("SYNAPSE_PAT") -base_url <- Sys.getenv("SCHEMATIC_BASE_URL_AWS") -testing_manifest_path <- "../../inst/testing/synapse_storage_manifest_dataflow.csv" -schema_url <- "https://raw.githubusercontent.com/Sage-Bionetworks/data_flow/main/inst/data_flow_component.jsonld" - -# TEST API ############################################################################## - -test_that("storage_projects successfully returns a schematic_api object", { - sp <- try(storage_projects(asset_view = asset_view, - input_token = input_token), - silent = FALSE) - - expect_true(class(sp) == "schematic_api") -}) - -test_that("storage_project_datasets successfully returns a schematic_api object", { - spd <- try(storage_project_datasets(asset_view = asset_view, - project_id = project_id, - input_token = input_token, - base_url = base_url), - silent = FALSE) - - expect_true(class(spd) == "schematic_api") -}) - -test_that("manifest_download successfully returns a schematic_api object", { - md <- try(manifest_download(input_token = input_token, - asset_view = asset_view, - dataset_id = dataset_id, - base_url = base_url), - silent = FALSE) - - expect_true(class(md) == "schematic_api") - -}) - -test_that("model_submit successfully returns a schematic_api object", { - s <- try(model_submit(data_type = NULL, - asset_view = asset_view, - dataset_id = dataset_id, - file_name = testing_manifest_path, - input_token = input_token, - restrict_rules = TRUE, - manifest_record_type = "table_and_file", - base_url = base_url, - schema_url = schema_url, - use_schema_label = TRUE), - silent = FALSE) - - expect_true(class(s) == "schematic_api") -}) - -test_that("storage_project_manifests successfully returns a schematic_api object", { - spm <- try(storage_project_manifests(asset_view, - project_id, - input_token, - base_url), - silent = FALSE) - - expect_true(class(spm) == "schematic_api") - -}) \ No newline at end of file diff --git a/tests/testthat/test-utility.R b/tests/testthat/test-utility.R deleted file mode 100644 index 2d07be4..0000000 --- a/tests/testthat/test-utility.R +++ /dev/null @@ -1,59 +0,0 @@ -test_that("list_to_dataframe", { - mock_storage_projects_output <- list(list("syn123", "project 1"), - list("syn345", "project 2")) - - expected_output <- data.frame(X1 = c("syn123", "syn345"), - X2 = c("project 1", "project 2")) - - expect_equal(list_to_dataframe(mock_storage_projects_output), - expected_output) -}) - -test_that("convert_column_type", { - testing_df <- data.frame(int = "1", factor = "dog", logic = "TRUE", char = 1, date = "2020-01-01") - - testing_df <- convert_column_type(df = testing_df, - col_names = "factor", - type = "factor") - - testing_df <- convert_column_type(df = testing_df, - col_names = "int", - type = "integer") - - testing_df <- convert_column_type(df = testing_df, - col_names = "date", - type = "date") - - testing_df <- convert_column_type(df = testing_df, - col_names = "char", - type = "character") - - testing_df <- convert_column_type(df = testing_df, - col_names = "logic", - type = "logical") - - expected_output <- data.frame(int = as.integer(1), factor = as.factor("dog"), logic = TRUE, char = "1", date = as.Date("2020-01-01")) - - expect_identical(testing_df, - expected_output) -}) - -test_that("true_false_icon", { - testing_vec <- c("TRUE", "FALSE") - - expected_output <- c(as.character(icon("check", lib = "font-awesome")), as.character(icon("times", lib = "font-awesome"))) - - expect_equal(true_false_icon(testing_vec), - expected_output) -}) - -test_that("rearrange_dataframe", { - testing_df <- data.frame(a = c(1,2,3), b = c(1,2,3), c = c(1,2,3), d = c(1,2,3)) - - expected_output <- data.frame(b = c(1,2,3), a = c(1,2,3), d = c(1,2,3), c = c(1,2,3)) - - - expect_equal(rearrange_dataframe(testing_df, - expected_col_names = c("b", "a", "d")), - expected_output) -}) \ No newline at end of file From 5adac2e1e6625b753f38162c33df6bb1aed52450 Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Thu, 20 Apr 2023 15:38:55 -0700 Subject: [PATCH 03/38] add dfamodules, update renv snapshot --- DESCRIPTION | 1 + renv.lock | 483 ++++++++++++++-------------------------------------- 2 files changed, 126 insertions(+), 358 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5dfdb9f..1f103ac 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -8,6 +8,7 @@ Imports: attempt, config (>= 0.3.1), dcamodules, + dfamodules, dplyr, DT, ggplot2, diff --git a/renv.lock b/renv.lock index 35f9d73..75f20a8 100644 --- a/renv.lock +++ b/renv.lock @@ -11,10 +11,10 @@ "Packages": { "DT": { "Package": "DT", - "Version": "0.26", + "Version": "0.27", "Source": "Repository", "Repository": "CRAN", - "Hash": "c66a72c4d3499e14ae179ccb742e740a", + "Hash": "3444e6ed78763f9f13aaa39f2481eb34", "Requirements": [ "crosstalk", "htmltools", @@ -61,18 +61,18 @@ }, "Rcpp": { "Package": "Rcpp", - "Version": "1.0.9", + "Version": "1.0.10", "Source": "Repository", "Repository": "CRAN", - "Hash": "e9c08b94391e9f3f97355841229124f2", + "Hash": "e749cae40fa9ef469b6050959517453c", "Requirements": [] }, "RcppTOML": { "Package": "RcppTOML", - "Version": "0.1.7", + "Version": "0.2.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "f8a578aa91321ecec1292f1e2ffadeda", + "Hash": "c232938949fcd8126034419cc529333a", "Requirements": [ "Rcpp" ] @@ -121,24 +121,6 @@ "Hash": "543776ae6848fde2f48ff3816d0628bc", "Requirements": [] }, - "bit": { - "Package": "bit", - "Version": "4.0.4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "f36715f14d94678eea9933af927bc15d", - "Requirements": [] - }, - "bit64": { - "Package": "bit64", - "Version": "4.0.5", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "9fe98599ca456d6552421db0d6772d8f", - "Requirements": [ - "bit" - ] - }, "brew": { "Package": "brew", "Version": "1.0-8", @@ -175,10 +157,10 @@ }, "cachem": { "Package": "cachem", - "Version": "1.0.6", + "Version": "1.0.7", "Source": "Repository", "Repository": "CRAN", - "Hash": "648c5b3d71e6a37e3043617489a0a0e9", + "Hash": "cda74447c42f529de601fe4d4050daef", "Requirements": [ "fastmap", "rlang" @@ -197,10 +179,10 @@ }, "cli": { "Package": "cli", - "Version": "3.5.0", + "Version": "3.6.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "eb9fc121ad9a1075c471107ef185be46", + "Hash": "89e6d8219950eac806ae0c489052048a", "Requirements": [] }, "clipr": { @@ -213,10 +195,10 @@ }, "colorspace": { "Package": "colorspace", - "Version": "2.0-3", + "Version": "2.1-0", "Source": "Repository", "Repository": "CRAN", - "Hash": "bb4341986bc8b914f0f0acf2e4a3f2f7", + "Hash": "f20c47fd52fae58b4e377c37bb8c335b", "Requirements": [] }, "colourpicker": { @@ -237,10 +219,10 @@ }, "commonmark": { "Package": "commonmark", - "Version": "1.8.1", + "Version": "1.9.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "b6e3e947d1d7ebf3d2bdcea1bde63fe7", + "Hash": "d691c61bff84bd63c383874d2d0c3307", "Requirements": [] }, "config": { @@ -298,18 +280,10 @@ }, "curl": { "Package": "curl", - "Version": "4.3.3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "0eb86baa62f06e8855258fa5a8048667", - "Requirements": [] - }, - "data.table": { - "Package": "data.table", - "Version": "1.14.2", + "Version": "5.0.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "36b67b5adf57b292923f5659f5f0c853", + "Hash": "e4f97056611e8e6b8b852d13b7400cf1", "Requirements": [] }, "dcamodules": { @@ -322,8 +296,8 @@ "RemoteRepo": "dcamodules", "RemoteUsername": "Sage-Bionetworks", "RemoteRef": "HEAD", - "RemoteSha": "3c7765f4b21ef898d1794fc3a58b356ba3721822", - "Hash": "a55df0a1785e77ba98d2800e1f4cf531", + "RemoteSha": "1e14dcfbdaa2913eeeacc12acaac1c8264bac1f7", + "Hash": "c27efc5d7a84072f43c242d6ffd13964", "Requirements": [ "base64enc", "colourpicker", @@ -380,6 +354,19 @@ "withr" ] }, + "dfamodules": { + "Package": "dfamodules", + "Version": "0.0.0.9000", + "Source": "GitHub", + "RemoteType": "github", + "RemoteHost": "api.github.com", + "RemoteUsername": "Sage-Bionetworks", + "RemoteRepo": "dfamodules", + "RemoteRef": "main", + "RemoteSha": "2a1ff254ae5ad2fce96c4bbcddef3abf43891131", + "Hash": "218f2e10ad7c6c01b17baa2af2361a17", + "Requirements": [] + }, "diffobj": { "Package": "diffobj", "Version": "0.3.5", @@ -419,12 +406,13 @@ }, "dplyr": { "Package": "dplyr", - "Version": "1.0.10", + "Version": "1.1.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "539412282059f7f0c07295723d23f987", + "Hash": "dea6970ff715ca541c387de363ff405e", "Requirements": [ "R6", + "cli", "generics", "glue", "lifecycle", @@ -448,10 +436,10 @@ }, "evaluate": { "Package": "evaluate", - "Version": "0.19", + "Version": "0.20", "Source": "Repository", "Repository": "CRAN", - "Hash": "5aac3cd0a3ccb1a738941796b28c26fe", + "Hash": "4b68aa51edd89a0e044a66e75ae3cc6c", "Requirements": [] }, "extrafont": { @@ -475,10 +463,10 @@ }, "fansi": { "Package": "fansi", - "Version": "1.0.3", + "Version": "1.0.4", "Source": "Repository", "Repository": "CRAN", - "Hash": "83a8afdbe71839506baa9f90eebad7ec", + "Hash": "1d9e7ad3c8312a192dea7d3db0274fde", "Requirements": [] }, "farver": { @@ -491,36 +479,23 @@ }, "fastmap": { "Package": "fastmap", - "Version": "1.1.0", + "Version": "1.1.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "77bd60a6157420d4ffa93b27cf6a58b8", + "Hash": "f7736a18de97dea803bde0a2daaafb27", "Requirements": [] }, "fontawesome": { "Package": "fontawesome", - "Version": "0.4.0", + "Version": "0.5.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "c5a628c2570aa86a96cc6ef739d8bfda", + "Hash": "1e22b8cabbad1eae951a75e9f8b52378", "Requirements": [ "htmltools", "rlang" ] }, - "forcats": { - "Package": "forcats", - "Version": "0.5.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "81c3244cab67468aac4c60550832655d", - "Requirements": [ - "ellipsis", - "magrittr", - "rlang", - "tibble" - ] - }, "fresh": { "Package": "fresh", "Version": "0.2.0", @@ -536,10 +511,10 @@ }, "fs": { "Package": "fs", - "Version": "1.5.2", + "Version": "1.6.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "7c89603d81793f0d5486d91ab1fc6f1d", + "Hash": "f4dcd23b67e33d851d2079f703e8b985", "Requirements": [] }, "generics": { @@ -567,10 +542,10 @@ }, "ggplot2": { "Package": "ggplot2", - "Version": "3.4.0", + "Version": "3.4.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "fd2aab12f54400c6bca43687231e246b", + "Hash": "3a147ee02e85a8941aad9909f1b43b7b", "Requirements": [ "MASS", "cli", @@ -588,16 +563,17 @@ }, "gh": { "Package": "gh", - "Version": "1.3.1", + "Version": "1.4.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "b6a12054ee13dce0f6696c019c10e539", + "Hash": "03533b1c875028233598f848fda44c4c", "Requirements": [ "cli", "gitcreds", - "httr", + "httr2", "ini", - "jsonlite" + "jsonlite", + "rlang" ] }, "gitcreds": { @@ -618,34 +594,32 @@ }, "golem": { "Package": "golem", - "Version": "0.3.5", + "Version": "0.4.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "c4fbd853653f38cccdd009d75abb344c", + "Hash": "4275a95781526a472cff3e39f957c8be", "Requirements": [ "attempt", - "cli", "config", - "crayon", - "desc", - "fs", "here", "htmltools", - "pkgload", - "roxygen2", - "rstudioapi", + "rlang", "shiny", - "usethis", "yaml" ] }, "gtable": { "Package": "gtable", - "Version": "0.3.1", + "Version": "0.3.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "36b4265fb818f6a342bed217549cd896", - "Requirements": [] + "Hash": "b44addadb528a0d227794121c00572a0", + "Requirements": [ + "cli", + "glue", + "lifecycle", + "rlang" + ] }, "here": { "Package": "here", @@ -667,26 +641,12 @@ "xfun" ] }, - "hms": { - "Package": "hms", - "Version": "1.1.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "5b8a2dd0fdbe2ab4f6081e6c7be6dfca", - "Requirements": [ - "ellipsis", - "lifecycle", - "pkgconfig", - "rlang", - "vctrs" - ] - }, "htmltools": { "Package": "htmltools", - "Version": "0.5.4", + "Version": "0.5.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "9d27e99cc90bd701c0a7a63e5923f9b7", + "Hash": "ba0240784ad50a62165058a27459304a", "Requirements": [ "base64enc", "digest", @@ -697,10 +657,10 @@ }, "htmlwidgets": { "Package": "htmlwidgets", - "Version": "1.6.0", + "Version": "1.6.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "f894e7b76e36258a483c602a786d7270", + "Hash": "a865aa85bcb2697f47505bfd70422471", "Requirements": [ "htmltools", "jsonlite", @@ -711,10 +671,10 @@ }, "httpuv": { "Package": "httpuv", - "Version": "1.6.7", + "Version": "1.6.9", "Source": "Repository", "Repository": "CRAN", - "Hash": "13fdc650c853fffbffee66b2a5b9fdbf", + "Hash": "1046aa31a57eae8b357267a56a0b6d8b", "Requirements": [ "R6", "Rcpp", @@ -736,6 +696,24 @@ "openssl" ] }, + "httr2": { + "Package": "httr2", + "Version": "0.2.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "5c09fe33064978ede54de42309c8b532", + "Requirements": [ + "R6", + "cli", + "curl", + "glue", + "magrittr", + "openssl", + "rappdirs", + "rlang", + "withr" + ] + }, "hunspell": { "Package": "hunspell", "Version": "3.0.1", @@ -781,39 +759,15 @@ "Hash": "a4269a09a9b865579b2635c77e572374", "Requirements": [] }, - "kableExtra": { - "Package": "kableExtra", - "Version": "1.3.4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "49b625e6aabe4c5f091f5850aba8ff78", - "Requirements": [ - "digest", - "glue", - "htmltools", - "knitr", - "magrittr", - "rmarkdown", - "rstudioapi", - "rvest", - "scales", - "stringr", - "svglite", - "viridisLite", - "webshot", - "xml2" - ] - }, "knitr": { "Package": "knitr", - "Version": "1.41", + "Version": "1.42", "Source": "Repository", "Repository": "CRAN", - "Hash": "6d4971f3610e75220534a1befe81bc92", + "Hash": "8329a9bcc82943c8069104d4be3ee22d", "Requirements": [ "evaluate", "highr", - "stringr", "xfun", "yaml" ] @@ -867,10 +821,10 @@ }, "lubridate": { "Package": "lubridate", - "Version": "1.9.0", + "Version": "1.9.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "2af4550c2f0f7fbe7cbbf3dbf4ea3902", + "Hash": "e25f18436e3efd42c7c590a1c4c15390", "Requirements": [ "generics", "timechange" @@ -976,10 +930,10 @@ }, "pillar": { "Package": "pillar", - "Version": "1.8.1", + "Version": "1.9.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "f2316df30902c81729ae9de95ad5a608", + "Hash": "15da5a8412f317beeee6175fbc76f4bb", "Requirements": [ "cli", "fansi", @@ -1061,36 +1015,6 @@ "withr" ] }, - "plotly": { - "Package": "plotly", - "Version": "4.10.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "3781cf6971c6467fa842a63725bbee9e", - "Requirements": [ - "RColorBrewer", - "base64enc", - "crosstalk", - "data.table", - "digest", - "dplyr", - "ggplot2", - "htmltools", - "htmlwidgets", - "httr", - "jsonlite", - "lazyeval", - "magrittr", - "promises", - "purrr", - "rlang", - "scales", - "tibble", - "tidyr", - "vctrs", - "viridisLite" - ] - }, "png": { "Package": "png", "Version": "0.1-8", @@ -1117,10 +1041,10 @@ }, "processx": { "Package": "processx", - "Version": "3.8.0", + "Version": "3.8.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "a33ee2d9bf07564efb888ad98410da84", + "Hash": "d75b4059d781336efba24021915902b4", "Requirements": [ "R6", "ps" @@ -1137,19 +1061,6 @@ "stringr" ] }, - "progress": { - "Package": "progress", - "Version": "1.2.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "14dc9f7a3c91ebb14ec5bb9208a07061", - "Requirements": [ - "R6", - "crayon", - "hms", - "prettyunits" - ] - }, "promises": { "Package": "promises", "Version": "1.2.0.1", @@ -1166,18 +1077,18 @@ }, "ps": { "Package": "ps", - "Version": "1.7.2", + "Version": "1.7.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "68dd03d98a5efd1eb3012436de45ba83", + "Hash": "709d852d33178db54b17c722e5b1e594", "Requirements": [] }, "purrr": { "Package": "purrr", - "Version": "1.0.0", + "Version": "1.0.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "1ad491d27989ec6c26a2918ad6df116b", + "Hash": "d71c815267c640f17ddbf7f16144b4bb", "Requirements": [ "cli", "lifecycle", @@ -1197,17 +1108,6 @@ "textshaping" ] }, - "ragg": { - "Package": "ragg", - "Version": "1.2.4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "0db17bd5a1d4abfec76487b6f5dd957b", - "Requirements": [ - "systemfonts", - "textshaping" - ] - }, "rappdirs": { "Package": "rappdirs", "Version": "0.3.3", @@ -1237,26 +1137,6 @@ "xopen" ] }, - "readr": { - "Package": "readr", - "Version": "2.1.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "9c59de1357dc209868b5feb5c9f0fe2f", - "Requirements": [ - "R6", - "cli", - "clipr", - "cpp11", - "crayon", - "hms", - "lifecycle", - "rlang", - "tibble", - "tzdb", - "vroom" - ] - }, "rematch": { "Package": "rematch", "Version": "1.0.1", @@ -1293,10 +1173,10 @@ }, "reticulate": { "Package": "reticulate", - "Version": "1.26", + "Version": "1.28", "Source": "Repository", "Repository": "CRAN", - "Hash": "91c176c84a2e3558572d2cbaddc08bd4", + "Hash": "86c441bf33e1d608db773cb94b848458", "Requirements": [ "Matrix", "Rcpp", @@ -1339,21 +1219,22 @@ }, "rlang": { "Package": "rlang", - "Version": "1.0.6", + "Version": "1.1.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "4ed1f8336c8d52c3e750adcdc57228a7", + "Hash": "dc079ccd156cde8647360f473c1fa718", "Requirements": [] }, "rmarkdown": { "Package": "rmarkdown", - "Version": "2.19", + "Version": "2.21", "Source": "Repository", "Repository": "CRAN", - "Hash": "4e29299e1f4c7eabb0b8365b338adf3c", + "Hash": "493df4ae51e2e984952ea4d5c75786a3", "Requirements": [ "bslib", "evaluate", + "fontawesome", "htmltools", "jquerylib", "jsonlite", @@ -1414,22 +1295,6 @@ "xml2" ] }, - "rvest": { - "Package": "rvest", - "Version": "1.0.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "bb099886deffecd6f9b298b7d4492943", - "Requirements": [ - "httr", - "lifecycle", - "magrittr", - "rlang", - "selectr", - "tibble", - "xml2" - ] - }, "sagethemes": { "Package": "sagethemes", "Version": "0.0.0.9003", @@ -1452,10 +1317,10 @@ }, "sass": { "Package": "sass", - "Version": "0.4.4", + "Version": "0.4.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "c76cbac7ca04ce82d8c38e29729987a3", + "Hash": "2bb4371a4c80115518261866eab6ab11", "Requirements": [ "R6", "fs", @@ -1481,17 +1346,6 @@ "viridisLite" ] }, - "selectr": { - "Package": "selectr", - "Version": "0.4-2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "3838071b66e0c566d55cc26bd6e27bf4", - "Requirements": [ - "R6", - "stringr" - ] - }, "sessioninfo": { "Package": "sessioninfo", "Version": "1.2.2", @@ -1572,10 +1426,10 @@ }, "sourcetools": { "Package": "sourcetools", - "Version": "0.1.7", + "Version": "0.1.7-1", "Source": "Repository", "Repository": "CRAN", - "Hash": "947e4e02a79effa5d512473e10f41797", + "Hash": "5f5a7629f956619d519205ec475fe647", "Requirements": [] }, "spelling": { @@ -1593,10 +1447,10 @@ }, "stringi": { "Package": "stringi", - "Version": "1.7.8", + "Version": "1.7.12", "Source": "Repository", "Repository": "CRAN", - "Hash": "a68b980681bcbc84c7a67003fa796bfb", + "Hash": "ca8bd84263c77310739d2cf64d84d7c9", "Requirements": [] }, "stringr": { @@ -1615,28 +1469,6 @@ "vctrs" ] }, - "svglite": { - "Package": "svglite", - "Version": "2.1.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "68dfdf211af6aa4e5f050f064f64d401", - "Requirements": [ - "cpp11", - "systemfonts" - ] - }, - "svglite": { - "Package": "svglite", - "Version": "2.1.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "68dfdf211af6aa4e5f050f064f64d401", - "Requirements": [ - "cpp11", - "systemfonts" - ] - }, "sys": { "Package": "sys", "Version": "3.4.1", @@ -1695,10 +1527,10 @@ }, "tibble": { "Package": "tibble", - "Version": "3.1.8", + "Version": "3.2.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "56b6934ef0f8c68225949a8672fe1a8f", + "Hash": "a84e2cc86d07289b3b6f5069df7a004c", "Requirements": [ "fansi", "lifecycle", @@ -1709,26 +1541,6 @@ "vctrs" ] }, - "tidyr": { - "Package": "tidyr", - "Version": "1.2.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "d8b95b7fee945d7da6888cf7eb71a49c", - "Requirements": [ - "cpp11", - "dplyr", - "ellipsis", - "glue", - "lifecycle", - "magrittr", - "purrr", - "rlang", - "tibble", - "tidyselect", - "vctrs" - ] - }, "tidyselect": { "Package": "tidyselect", "Version": "1.2.0", @@ -1746,34 +1558,24 @@ }, "timechange": { "Package": "timechange", - "Version": "0.1.1", + "Version": "0.2.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "4657195cc632097bb8d140d626b519fb", + "Hash": "8548b44f79a35ba1791308b61e6012d7", "Requirements": [ "cpp11" ] }, "tinytex": { "Package": "tinytex", - "Version": "0.43", + "Version": "0.45", "Source": "Repository", "Repository": "CRAN", - "Hash": "facc02f3d63ed7dd765513c004c394ce", + "Hash": "e4e357f28c2edff493936b6cb30c3d65", "Requirements": [ "xfun" ] }, - "tzdb": { - "Package": "tzdb", - "Version": "0.3.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "b2e1cbce7c903eaf23ec05c58e59fb5e", - "Requirements": [ - "cpp11" - ] - }, "urlchecker": { "Package": "urlchecker", "Version": "1.0.1", @@ -1816,10 +1618,10 @@ }, "utf8": { "Package": "utf8", - "Version": "1.2.2", + "Version": "1.2.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "c9c462b759a5cc844ae25b5942654d13", + "Hash": "1fe17157424bb09c48a8b3b550c753bc", "Requirements": [] }, "uuid": { @@ -1832,10 +1634,10 @@ }, "vctrs": { "Package": "vctrs", - "Version": "0.5.1", + "Version": "0.6.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "970324f6572b4fd81db507b5d4062cb0", + "Hash": "a745bda7aff4734c17294bb41d4e4607", "Requirements": [ "cli", "glue", @@ -1851,29 +1653,6 @@ "Hash": "62f4b5da3e08d8e5bcba6cac15603f70", "Requirements": [] }, - "vroom": { - "Package": "vroom", - "Version": "1.5.7", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "976507b5a105bc3bdf6a5a5f29e0684f", - "Requirements": [ - "bit64", - "cli", - "cpp11", - "crayon", - "glue", - "hms", - "lifecycle", - "progress", - "rlang", - "tibble", - "tidyselect", - "tzdb", - "vctrs", - "withr" - ] - }, "waiter": { "Package": "waiter", "Version": "0.2.5", @@ -1902,18 +1681,6 @@ "tibble" ] }, - "webshot": { - "Package": "webshot", - "Version": "0.5.4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "cfd9342c76693ae53108a474aafa1641", - "Requirements": [ - "callr", - "jsonlite", - "magrittr" - ] - }, "whisker": { "Package": "whisker", "Version": "0.4.1", @@ -1943,10 +1710,10 @@ }, "xfun": { "Package": "xfun", - "Version": "0.36", + "Version": "0.39", "Source": "Repository", "Repository": "CRAN", - "Hash": "f5baec54606751aa53ac9c0e05848ed6", + "Hash": "8f56e9acb54fb525e66464d57ab58bcb", "Requirements": [] }, "xml2": { @@ -1977,10 +1744,10 @@ }, "yaml": { "Package": "yaml", - "Version": "2.3.6", + "Version": "2.3.7", "Source": "Repository", "Repository": "CRAN", - "Hash": "9b570515751dcbae610f29885e025b41", + "Hash": "0d0056cc5383fbc240ccd0cb584bf436", "Requirements": [] }, "zip": { From bcbaa59437c05ab739035220c1f24d71d34677c3 Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Fri, 21 Apr 2023 12:28:11 -0700 Subject: [PATCH 04/38] add dfamodules to depends --- DESCRIPTION | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1f103ac..40036fa 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -4,11 +4,12 @@ Version: 0.0.0.9000 Authors@R: person('L', 'Wolfe', email = 'loren.wolfe@sagebase.org', role = c('cre', 'aut')) Description: A data flow package. License: What license is it under? +Depends: + dfamodules Imports: attempt, config (>= 0.3.1), dcamodules, - dfamodules, dplyr, DT, ggplot2, From 6a45b422c6c1ed703035cba0e978825431bddc7b Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Fri, 21 Apr 2023 13:53:15 -0700 Subject: [PATCH 05/38] remove testing action, tests will be done in dfamodules repo --- .github/workflows/shinyapps_deploy.yml | 94 -------------------------- 1 file changed, 94 deletions(-) delete mode 100644 .github/workflows/shinyapps_deploy.yml diff --git a/.github/workflows/shinyapps_deploy.yml b/.github/workflows/shinyapps_deploy.yml deleted file mode 100644 index 814c400..0000000 --- a/.github/workflows/shinyapps_deploy.yml +++ /dev/null @@ -1,94 +0,0 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/master/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help - -name: shiny-deploy - -on: - # on push to branches labeled main and dev* or commits tagged as VYY.MM.n deploy - push: - branches: - - main - - dev* - tags: - - v[0-9]+.[0-9]+.[0-9]+ - - paths-ignore: - - '.github/ISSUE_TEMPLATE/**' - - '**/*.md' - - '**/.gitignore' - -jobs: - shiny-deploy: - runs-on: ubuntu-latest - # This image seems to be based on rocker/r-ver which in turn is based on debian - container: rocker/rstudio:4.1.2 - env: - # This should not be necessary for installing from public repo's however remotes::install_github() fails without it. - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - steps: - - name: Install System Dependencies - run: | - sudo apt-get update - sudo apt-get install -y pip python3.8-venv libcurl4-openssl-dev libpng-dev libfontconfig1-dev libharfbuzz-dev libfribidi-dev libtiff-dev libxml2-dev - # this action checks out the $GITHUB_WORKSPACE repository so that the workflow can access it - - uses: actions/checkout@v3 - # this action sets up pandoc - - uses: r-lib/actions/setup-pandoc@v2 - # this action activates renv - - uses: r-lib/actions/setup-renv@v2 - # Write synapse config (not sure if I even need this??) - - name: Set Configurations - shell: bash - run: | - echo "${{ secrets.SCHEMATIC_SYNAPSE_CONFIG }}" > .synapseConfig - # deploy app using rsconnect - - name: Authorize and deploy app - run: | - install.packages("rsconnect") - refName <- Sys.getenv("GITHUB_REF_NAME") - repo <- Sys.getenv("GITHUB_REPOSITORY") - appName <- strsplit(repo, "/")[[1]][2] - - # if tag is v*.*.*, deploy to prod, if main to staging, otherwise to test - if (grepl("v[0-9]+.[0-9]+.[0-9]+", refName)) { - message("Deploying release version of app") - } else if (refName == "main") { - appName <- paste(appName, "staging", sep = "-") - message("Deploying staging version of app") - } else { - appName <- paste(appName, "testing", sep = "-") - message("Deploying testing version of app") - } - - message(sprintf("Deploying to %s instance.", appName)) - - rsConnectUser <-"${{ secrets.RSCONNECT_USER }}" - rsConnectToken <- "${{ secrets.RSCONNECT_TOKEN }}" - rsConnectSecret <- "${{ secrets.RSCONNECT_SECRET }}" - - # create config file - config <- "client_id: ${{ secrets.OAUTH_CLIENT_ID }}" - config <- c(config, "client_secret: ${{ secrets.OAUTH_CLIENT_SECRET }}") - appUrl<- sprintf("https://%s.shinyapps.io/%s", rsConnectUser, appName) - config <- c(config, sprintf("app_url: %s", appUrl)) - - configFileConn<-file("oauth_config.yml") - tryCatch( - writeLines(config, configFileConn), - finally=close(configFileConn) - ) - # FIXME ADD size parameter - rsconnect::setAccountInfo(rsConnectUser, rsConnectToken, rsConnectSecret) - - # Get app names. If app exists, configure then deploy. Otherwise - # deploy then configure. - apps <- rsconnect::applications()$name - if (appName %in% apps) { - rsconnect::configureApp(appName = appName, size = "xxxlarge", logLevel = "verbose") - rsconnect::deployApp(appName = appName) - } else { - rsconnect::deployApp(appName = appName) - rsconnect::configureApp(appName = appName, size = "xxxlarge", logLevel = "verbose") - } - shell: Rscript {0} \ No newline at end of file From 6ea9da575fd1d81791363b406937405f8e854779 Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Thu, 20 Apr 2023 13:43:15 -0700 Subject: [PATCH 06/38] remove dfamodules functions --- NAMESPACE | 29 -- R/api_wrappers.R | 114 ------ R/datatable_functions.R | 142 ------- R/manifest.R | 416 ------------------- R/mod_dataset_selection.R | 116 ------ R/mod_datatable_dashboard.R | 42 -- R/mod_datatable_filters.R | 92 ----- R/mod_distribution.R | 75 ---- R/mod_file_selection.R | 95 ----- R/mod_highlight_datatable.R | 72 ---- R/mod_scheduler.R | 87 ---- R/mod_select_storage_project.R | 77 ---- R/mod_stacked_bar.R | 100 ----- R/mod_submit_model.R | 79 ---- R/mod_tabbed_dashboard.R | 126 ------ R/mod_update_data_flow_status.R | 99 ----- R/parse_config.R | 71 ---- R/schematic_rest_api.R | 428 -------------------- R/utility.R | 99 ----- R/utils-pipe.R | 14 - man/calculate_items_per_manifest.Rd | 20 - man/convert_column_type.Rd | 18 - man/create_dashboard.Rd | 16 - man/dt_replace_na.Rd | 16 - man/generate_data_flow_manifest_skeleton.Rd | 27 -- man/get_all_manifests.Rd | 25 -- man/get_colname_by_type.Rd | 16 - man/get_na_replace_colnames.Rd | 14 - man/get_na_replace_defs.Rd | 16 - man/get_renamed_colnames.Rd | 14 - man/list_to_dataframe.Rd | 16 - man/manifest_download.Rd | 25 -- man/model_submit.Rd | 45 -- man/pipe.Rd | 20 - man/prep_manifest_dash.Rd | 16 - man/prep_manifest_dfa.Rd | 16 - man/prep_manifest_submit.Rd | 16 - man/rearrange_dataframe.Rd | 16 - man/storage_project_datasets.Rd | 25 -- man/storage_project_manifests.Rd | 25 -- man/storage_projects.Rd | 22 - man/style_dashboard.Rd | 16 - man/true_false_icon.Rd | 14 - man/update_data_flow_manifest.Rd | 25 -- man/update_dfs_manifest.Rd | 18 - 45 files changed, 2870 deletions(-) delete mode 100644 R/api_wrappers.R delete mode 100644 R/datatable_functions.R delete mode 100644 R/manifest.R delete mode 100644 R/mod_dataset_selection.R delete mode 100644 R/mod_datatable_dashboard.R delete mode 100644 R/mod_datatable_filters.R delete mode 100644 R/mod_distribution.R delete mode 100644 R/mod_file_selection.R delete mode 100644 R/mod_highlight_datatable.R delete mode 100644 R/mod_scheduler.R delete mode 100644 R/mod_select_storage_project.R delete mode 100644 R/mod_stacked_bar.R delete mode 100644 R/mod_submit_model.R delete mode 100644 R/mod_tabbed_dashboard.R delete mode 100644 R/mod_update_data_flow_status.R delete mode 100644 R/parse_config.R delete mode 100644 R/schematic_rest_api.R delete mode 100644 R/utility.R delete mode 100644 R/utils-pipe.R delete mode 100644 man/calculate_items_per_manifest.Rd delete mode 100644 man/convert_column_type.Rd delete mode 100644 man/create_dashboard.Rd delete mode 100644 man/dt_replace_na.Rd delete mode 100644 man/generate_data_flow_manifest_skeleton.Rd delete mode 100644 man/get_all_manifests.Rd delete mode 100644 man/get_colname_by_type.Rd delete mode 100644 man/get_na_replace_colnames.Rd delete mode 100644 man/get_na_replace_defs.Rd delete mode 100644 man/get_renamed_colnames.Rd delete mode 100644 man/list_to_dataframe.Rd delete mode 100644 man/manifest_download.Rd delete mode 100644 man/model_submit.Rd delete mode 100644 man/pipe.Rd delete mode 100644 man/prep_manifest_dash.Rd delete mode 100644 man/prep_manifest_dfa.Rd delete mode 100644 man/prep_manifest_submit.Rd delete mode 100644 man/rearrange_dataframe.Rd delete mode 100644 man/storage_project_datasets.Rd delete mode 100644 man/storage_project_manifests.Rd delete mode 100644 man/storage_projects.Rd delete mode 100644 man/style_dashboard.Rd delete mode 100644 man/true_false_icon.Rd delete mode 100644 man/update_data_flow_manifest.Rd delete mode 100644 man/update_dfs_manifest.Rd diff --git a/NAMESPACE b/NAMESPACE index 5d9c9fc..2b8d54c 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,39 +1,10 @@ # Generated by roxygen2: do not edit by hand -export("%>%") -export(calculate_items_per_manifest) -export(convert_column_type) -export(create_dashboard) -export(dt_replace_na) -export(generate_data_flow_manifest_skeleton) -export(get_all_manifests) -export(get_colname_by_type) -export(get_na_replace_colnames) -export(get_na_replace_defs) -export(get_renamed_colnames) -export(list_to_dataframe) -export(manifest_download) -export(model_submit) -export(prep_manifest_dash) -export(prep_manifest_dfa) -export(prep_manifest_submit) -export(rearrange_dataframe) export(run_app) -export(storage_project_datasets) -export(storage_project_manifests) -export(storage_projects) -export(style_dashboard) -export(true_false_icon) -export(update_data_flow_manifest) -export(update_dfs_manifest) -export(visualize_component) import(shiny) importFrom(golem,activate_js) importFrom(golem,add_resource_path) importFrom(golem,bundle_resources) importFrom(golem,favicon) importFrom(golem,with_golem_options) -importFrom(magrittr,"%>%") -importFrom(shiny,NS) importFrom(shiny,shinyApp) -importFrom(shiny,tagList) diff --git a/R/api_wrappers.R b/R/api_wrappers.R deleted file mode 100644 index 9496e90..0000000 --- a/R/api_wrappers.R +++ /dev/null @@ -1,114 +0,0 @@ -################################################################### -## Functions that build on those defined in schematic_rest_api.R ## -################################################################### - -#' Call `storage/project/manifests` Schematic endpoint for a given asset_view -#' -#' @param asset_view ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml) -#' @param input_token Synapse PAT -#' @param base_url Base URL of schematic API -#' @param verbose T/F for console messages -#' -#' @export - -get_all_manifests <- function(asset_view, - input_token, - base_url = "https://schematic-dev.api.sagebionetworks.org", - verbose = FALSE) { - if (verbose) { - message(paste0("Getting storage project list for ", asset_view)) - } - - # get all storage projects under asset view - sp_obj <- storage_projects(asset_view = asset_view, - input_token = input_token, - base_url = base_url) - - if (verbose) { - message(paste0("Getting manifests for ", nrow(sp_obj$content), " storage project(s)")) - } - - synapse_manifests_list <- lapply(1:nrow(sp_obj$content), function(i) { - - sp_id <- sp_obj$content[i, "id"] - sp_name <- sp_obj$content[i, "name"] - - if (verbose) { - message(paste0("Retrieving manifests for ", sp_name)) - } - - manifests <- storage_project_manifests(asset_view = asset_view, - project_id = sp_id, - input_token = input_token, - base_url = base_url) - - # if manifest has - if (nrow(manifests$content) > 0) { - - # pull together in a dataframe - df <- data.frame(Component = rep("DataFlow", nrow(manifests$content)), - contributor = rep(sp_name, nrow(manifests$content)), - entityId = manifests$content$dataset_id, - dataset_name = manifests$content$folder_name, - dataset = manifests$content$data_type) - - # update empty cells to "Not Applicable" - df[ df == "" ] <- "Not Applicable" - - return(df) - - } else { - return(NULL) - } - }) - - # return dataframe - return(do.call("rbind", synapse_manifests_list)) -} - - -#' Call `calculate_items_per_manifest` calculate the number of items per manifest synID in a given dataframe -#' -#' @param df A dataframe with `entityId` and `dataset` columns from data flow status manifest -#' @param asset_view ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml) -#' @param input_token Synapse PAT -#' @param base_url Base URL of schematic API -#' -#' @export - -calculate_items_per_manifest <- function(df, - asset_view, - input_token, - base_url) { - - sapply(1:nrow(df), function(i) { - - # dataset == "" indicates that there is no manifest - if (df$dataset[i] == "Not Applicable"| df$dataset[i] == "" | is.na(df$dataset[i])) { - - manifest_nrow <- "Not Applicable" - - } else { - - # download manifest - manifest <- tryCatch( - { - manifest_download(asset_view = asset_view, - dataset_id = df[i, "entityId"], - input_token = input_token, - base_url = base_url) - }, - error=function(e) { - message(e) - return(NULL) - } - ) - - # if no manifest is downloaded, return NA - # otherwise count rows and return nrow - manifest_nrow <- ifelse(is.null(manifest$content), "Not Applicable", nrow(manifest$content)) - } - - return(manifest_nrow) - }) -} diff --git a/R/datatable_functions.R b/R/datatable_functions.R deleted file mode 100644 index 3c250f1..0000000 --- a/R/datatable_functions.R +++ /dev/null @@ -1,142 +0,0 @@ -######################################################### -## Functions that create stylized datatable dashboards ## -######################################################### - -#' Create a dashboard style datatable -#' -#' @param df A dataframe prepared by `prep_df_for_dash()` with the columns `Contributor`, `Dataset_Name`, `Dataset_Type`, `Num_Items`, `Release_Scheduled`, `Embargo`, `Standard_Compliance`, `QC_Compliance`,`PHI_Detection_Compliance`, `Access_Controls_Compliance`, `Data_Portal`, `Released`, `past_due` -#' @param config Config for datatable dashboard module in `inst/datatable_dashboard_config.json` -#' -#' @export -#' - -create_dashboard <- function(df, - past_due_col, - config) { - - prepped_df <- prep_manifest_dash(df, - past_due_col, - config) - - style_dashboard(prepped_df, config) -} - -#' Add custom styling to dashboard based on contents of config -#' -#' @param prepped_manifest A manifest prepped with `prep_manifest_dash()` -#' @param config `inst/datatable_dashboard_config.json` -#' -#' @export -#' - -style_dashboard <- function(prepped_manifest, - config) { - - # get icon col index - icon_idx <- match(get_colname_by_type("icon", config), names(prepped_manifest)) - - # define center styling for icon columns - center_list <- list(className = 'dt-center', targets = icon_idx) - - # hide columns that are not included in the config - hide_cols <- setdiff(names(prepped_manifest), names(config)) - hide_idx <- match(hide_cols, names(prepped_manifest)) - hide_list <- list(targets = hide_idx, visible = FALSE) - - # capture icon and center styling in single variable - defs <- list( - center_list, - hide_list) - - # define styling for na_replacement - na_replace_defs <- get_na_replace_defs(prepped_manifest, - config) - - - # combine the two lists - defs <- append(defs, na_replace_defs) - - # get column names for datatable display - colnames <- get_renamed_colnames(config) - # put empty string in front to account for rownum column - colnames <- c("", colnames) - - # create datatable - dt <- DT::datatable(prepped_manifest, - escape = FALSE, - selection = "none", - filter = "none", - colnames = colnames, - options = list(scrollX = TRUE, - scrollY = 500, - bPaginate = FALSE, - searching = FALSE, - columnDefs = defs)) - - # FIXME: this is still hardcoded - if (as.logical(toupper(config$release_scheduled$color_past_due))) { - - dt <- DT::formatStyle(table = dt, - config$release_scheduled$col_name, "past_due", - backgroundColor = DT::styleEqual("pd", "#FF9CA0")) - } - - dt -} - -#' Prepare a dataframe for a dashboard style datatable -#' -#' @param df A dataframe with the columns `Contributor`, `Dataset_Name`, `Dataset_Type`, `Num_Items`, `Release_Scheduled`, `Embargo`, `Standard_Compliance`, `QC_Compliance`,`PHI_Detection_Compliance`, `Access_Controls_Compliance`, `Data_Portal`, `Released`, `past_due` -#' @param config Config for datatable dashboard module in `inst/datatable_dashboard_config.json` -#' -#' @export -#' - -prep_manifest_dash <- function(df, - past_due_col, - config) { - - # create past_due column for highlighting release_scheduled - today <- Sys.Date() - df$past_due <- ifelse(df[[past_due_col]] < today, "pd", NA) - - # convert TRUE / FALSE to icon html - - df <- convert_column_type(df = df, - col_names = get_colname_by_type(config, type = "icon"), - type = "icon") - - # convert certain columns to factors - # enables drop down selection style filtering for column - df <- convert_column_type(df = df, - col_names = get_colname_by_type(config, type = "drop_down_filter"), - type = "factor") - - # rearrange dataframe based on config order (any columns not in config are moved to end of dataframe) - expected_colnames <- names(config) - df <- rearrange_dataframe(df, expected_colnames) - - return(df) -} - - -## HELPERS ############################################################################## - -#' NA replacement - datatable custom JS -#' -#' @param col_index target columns index -#' @param na_replacement text to replace NA -#' -#' @export -#' - -dt_replace_na <- function(col_index, - na_replacement) { - - list(targets = col_index, - render = DT::JS( - "function(data, type, row, meta) {", - glue::glue("return data === null ? '{na_replacement}' : data;"), - "}" - )) -} \ No newline at end of file diff --git a/R/manifest.R b/R/manifest.R deleted file mode 100644 index e1ffd79..0000000 --- a/R/manifest.R +++ /dev/null @@ -1,416 +0,0 @@ -#' Prepare a dataframe that has been downloaded from Synapse for the Data Flow App -#' -#' @param manifest A manifest that has been downloaded from using manifest_download_to_df() -#' @param config `datatable_dashboard_config.json` read in as a dataframe -#' -#' @export - -prep_manifest_dfa <- function(manifest, - config) { - - # convert "Not Applicable" to NA - manifest[ manifest == "Not Applicable" ] <- NA - - # convert contribute and dataset to factor - manifest <- convert_column_type(df = manifest, - col_names = get_colname_by_type("drop_down_filter", config), - type = "factor") - - # num_items to integer column - manifest <- convert_column_type(df = manifest, - col_names = get_colname_by_type("integer", config), - type = "integer") - - # release_scheduled and embargo to date columns - manifest <- convert_column_type(df = manifest, - col_names = get_colname_by_type("date", config), - type = "date") - - return(manifest) -} - -#' Prepare a dataframe for Synapse submission -#' -#' @param manifest A manifest that has been downloaded from using manifest_download_to_df() -#' @param config `datatable_dashboard_config.json` read in as a dataframe -#' -#' @export - -prep_manifest_submit <- function(manifest, - config) { - - # convert columns back to string - col_names <- c(get_colname_by_type("date", config), - get_colname_by_type("drop_down_filter", config), - get_colname_by_type("integer", config)) - - manifest <- convert_column_type(df = manifest, - col_names = col_names, - type = "character") - - # convert NA to "Not Applicable" - manifest[ is.na(manifest) ] <- "Not Applicable" - - return(manifest) -} - -#' Convert a list to a dataframe -#' -#' @param dfs_status_manifest A data flow status manifest -#' @param dfs_updates Output from mod_update_data_flow_status.R -#' @param selected_datasets_df Output from mod_dataset_selection.R -#' -#' @export - -update_dfs_manifest <- function(dfs_manifest, - dfs_updates, - selected_datasets_df) { - - # remove unchanged attributes from selections - dfs_updates <- dfs_updates[!unlist(lapply(dfs_updates, is.null))] - - # capture column names to update - col_names <- names(dfs_updates) - - # loop over the list of changed attributes - # for each attribute: - # - pull out the original vector - # - get the updated entry from the list of attributes - # - apply the entry to the selected datasets in dfs manifest - dfs_manifest[col_names] <- lapply(col_names, function(x) { - - # pull out column into a vector - vec <- dfs_manifest[[x]] - - # get entry from updated data flow status attributes list - entry <- dfs_updates[[x]] - - # update vector by index - manifest_selected_idx <- match(selected_datasets_df$id, dfs_manifest$entityId) - vec[manifest_selected_idx] <- entry - - return(vec) - - }) - - return(dfs_manifest) -} - -#' Generate a data flow status manifest skeleton. Fills in the component, contributor, data type, number of items, and dataset name columns. -#' -#' @param storage_project_list List output from `storage_projects` schematic endpoint -#' @param asset_view ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml) -#' @param dataset_id Synapse ID of existing manifest -#' @param calc_num_items TRUE/FALSE. Calculate the number of items in each manifest. -#' @param base_url Base URL of schematic API -#' -#' @export - -generate_data_flow_manifest_skeleton <- function(asset_view, - input_token, - calc_num_items, - base_url = "https://schematic-dev.api.sagebionetworks.org") { - - # get manifests for each storage project - dfs_manifest <- get_all_manifests(asset_view = asset_view, - input_token = input_token, - base_url = base_url, - verbose = TRUE) - - # count rows in each manifest listed - if (calc_num_items) { - - num_items <- calculate_items_per_manifest(df = dfs_manifest, - asset_view = asset_view, - input_token = input_token, - base_url = base_url) - - # if calc_num_itmes = false, just fill in the column with Not Applicable - } else { - num_items <- rep("Not Applicable", nrow(dfs_manifest)) - } - - # add to manifest - dfs_manifest$num_items <- num_items - - # add missing columns - # FIXME: Remove hardcoded column names - # This function will break if dataflow schema changes - # Source column names from schema? - dfs_manifest$release_scheduled <- rep("Not Applicable", nrow(dfs_manifest)) - dfs_manifest$embargo <- rep("Not Applicable", nrow(dfs_manifest)) - dfs_manifest$standard_compliance <- rep(FALSE, nrow(dfs_manifest)) - dfs_manifest$data_portal <- rep(FALSE, nrow(dfs_manifest)) - dfs_manifest$released <- rep(FALSE, nrow(dfs_manifest)) - - # update empty cells to "Not Applicable" - dfs_manifest[ dfs_manifest == "" ] <- "Not Applicable" - - return(dfs_manifest) -} - -#' Check synapse for updates to data flow status manifest -#' -#' @param asset_view ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml) -#' @param manifest_dataset_id Dataset ID for data flow status manifest to be updated -#' @param input_token Synapse PAT -#' @param base_url Base URL of schematic API (Defaults to AWS version) -#' -#' @export - -update_data_flow_manifest <- function(asset_view, - manifest_dataset_id, - input_token, - base_url) { - - print(paste0("Checking asset view ", asset_view, " for updates")) - print(paste0("Getting data flow status manifest")) - - # get current data flow manifest - dataflow_manifest_obj <- tryCatch( - { - manifest_download(asset_view = asset_view, - dataset_id = manifest_dataset_id, - base_url = base_url, - input_token = input_token) - }, - error = function(e) { - message("manifest_download failed") - message(e) - } - ) - - dataflow_manifest <- dataflow_manifest_obj$content - - # if uuid remove - if(any(grepl("Uuid", names(dataflow_manifest)))) { - idx <- grep("Uuid", names(dataflow_manifest)) - dataflow_manifest <- dataflow_manifest[,-idx] - } - - # get all manifests for each storage project - print(paste0("Getting all manifests under asset view ", asset_view, " from Synapse")) - synapse_manifests <- tryCatch( - { - get_all_manifests(asset_view = asset_view, - input_token = input_token, - base_url = base_url, - verbose = FALSE) - }, - error = function(e) { - message("get_all_manifests failed") - message(e) - } - ) - - print("Checking data flow manifest for updates") - - # check synapse for new datasets - dataflow_manifest_updated <- update_manifest_add_datasets(dataflow_manifest = dataflow_manifest, - get_all_manifests_out = synapse_manifests, - asset_view = asset_view, - input_token = input_token, - base_url = base_url) - - # check synapse for removed datasets - dataflow_manifest_updated <- update_manifest_remove_datasets(dataflow_manifest = dataflow_manifest_updated, - get_all_manifests_out = synapse_manifests, - asset_view = asset_view, - input_token = input_token, - base_url = base_url) - - # check synapse for updates to dataset_name column - dataflow_manifest_updated <- update_manifest_column(dataflow_manifest = dataflow_manifest_updated, - get_all_manifests_out = synapse_manifests, - update_column = "dataset_name", - asset_view = asset_view, - recalc_num_items = FALSE, - input_token = input_token, - base_url = base_url) - - # check synapse for updates to dataset column - dataflow_manifest_updated <- update_manifest_column(dataflow_manifest = dataflow_manifest_updated, - get_all_manifests_out = synapse_manifests, - update_column = "dataset", - asset_view = asset_view, - recalc_num_items = TRUE, - input_token = input_token, - base_url = base_url) - - # compare updated dataflow manifest to initial manifest - - changes_made <- !identical(dataflow_manifest, dataflow_manifest_updated) - - # if changes have been made submit to synapse - if (changes_made) { - # submit to synapse - # data_type = NULL until LP can fix model/submit endpoint for large manifests - # If no datatype indicated no validation will be done - message("submitting manifest to Synapse") - - # create manifest directory if it doesn't exist yet - if (!file.exists("./manifest/")) { - dir.create("./manifest/") - } - - # write to csv for submission - file_path <- "./manifest/synapse_storage_manifest_dataflow.csv" - write.csv(dataflow_manifest_updated, file_path, row.names = FALSE) - - # submit to synapse - model_submit(data_type = NULL, - asset_view = asset_view, - dataset_id = manifest_dataset_id, - file_name = file_path, - restrict_rules = TRUE, - input_token = input_token, - manifest_record_type = "table_and_file", - base_url = base_url, - schema_url = "https://raw.githubusercontent.com/Sage-Bionetworks/data_flow/main/inst/data_flow_component.jsonld") - } else { - print("No updates to manifest required at this time") - } - -} - -#' Update manifest with new datasets found in Synapse -#' -#' @param dataflow_manifest A dataFlow manifest -#' @param get_all_manifests_out The output of get_all_manifests. Also can be a dataframe that includes Component, contributor, entityId, dataset_name, and dataset. -#' @param asset_view ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml) -#' @param input_token Synapse PAT -#' @param base_url Base URL of schematic API (Defaults to AWS version) - -update_manifest_add_datasets <- function(dataflow_manifest, - get_all_manifests_out, - asset_view, - input_token, - base_url) { - - # check for new datasets by entityId - new_datasets <- get_all_manifests_out[!get_all_manifests_out$entityId %in% dataflow_manifest$entityId,] - - # if there are new datasets... - if (nrow(new_datasets) > 0) { - - print(paste0(nrow(new_datasets), " new dataset(s) found on Synapse")) - - # calculate number of items in each manifest - num_items <- tryCatch( - { - calculate_items_per_manifest(df = new_datasets, - asset_view = asset_view, - input_token = input_token, - base_url = base_url) - }, - error = function(e) { - message("num_items calculation failed") - message(e) - } - ) - - # fill data flow manifest rows for missing datasets - # FIXME: Remove hardcoded column names - # This function will break if dataflow schema changes - # Source column names from schema? - new_datasets$release_scheduled <- rep("Not Applicable", nrow(new_datasets)) - new_datasets$embargo <- rep("Not Applicable", nrow(new_datasets)) - new_datasets$standard_compliance <- rep(FALSE, nrow(new_datasets)) - new_datasets$data_portal <- rep(FALSE, nrow(new_datasets)) - new_datasets$released <- rep(FALSE, nrow(new_datasets)) - new_datasets$num_items <- num_items - - # remove uuid col (prep for rbind) - if (any(grepl("Uuid", names(dataflow_manifest)))) { - uuid_idx <- grep("Uuid", names(dataflow_manifest)) - dataflow_manifest <- dataflow_manifest[, -uuid_idx] - } - - # bind together new dataset rows and data flow manifest - dataflow_manifest <- rbind(dataflow_manifest, new_datasets) - - # rearrange data flow manifest - dataflow_manifest <- dataflow_manifest %>% - dplyr::group_by(contributor) %>% - dplyr::arrange(contributor) - } - - return(data.frame(dataflow_manifest)) - -} - -#' Remove datasets that are no longer found in Synapse -#' -#' @param dataflow_manifest A dataFlow manifest -#' @param get_all_manifests_out The output of get_all_manifests. Also can be a dataframe that includes Component, contributor, entityId, dataset_name, and dataset. -#' @param asset_view ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml) -#' @param input_token Synapse PAT -#' @param base_url Base URL of schematic API (Defaults to AWS version) - -update_manifest_remove_datasets <- function(dataflow_manifest, - get_all_manifests_out, - asset_view, - input_token, - base_url) { - - # check for removed datasets - remove_idx <- dataflow_manifest$entityId %in% get_all_manifests_out$entityId - - # if any of the rows are flagged for removal print a message and remove from manifest - if (any(!remove_idx)) { - n_remove <- sum(!remove_idx) - print(paste0(n_remove, " dataset(s) removed from Synapse")) - - dataflow_manifest <- dataflow_manifest[remove_idx,] - } - - return(dataflow_manifest) -} - -#' Update dataFlow manifest when dataset folder name changes -#' -#' @param dataflow_manifest A dataFlow manifest -#' @param get_all_manifests_out The output of get_all_manifests. Also can be a dataframe that includes Component, contributor, entityId, dataset_name, and dataset. -#' @param asset_view ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml) -#' @param update_column Column name of the column to be updated -#' @param recalc_num_items TRUE/FALSE if there is an item to be updated, should the manifest -#' @param input_token Synapse PAT -#' @param base_url Base URL of schematic API (Defaults to AWS version) - -update_manifest_column <- function(dataflow_manifest, - get_all_manifests_out, - update_column, - asset_view, - recalc_num_items = FALSE, - input_token, - base_url) { - - # arrange by entityId - dataflow_manifest <- dplyr::arrange(dataflow_manifest, entityId) - get_all_manifests_out <- dplyr::arrange(get_all_manifests_out, entityId) - - # get logical index of which items have changed - idx <- dataflow_manifest[,update_column] != get_all_manifests_out[, update_column] - - # if any items have changed update dataset type column - if (any(idx)) { - n_changed <- sum(idx) - print(paste0("Making ", n_changed, " update(s) to ", update_column, " column")) - dataflow_manifest[idx, update_column] <- get_all_manifests_out[idx, update_column] - - # if recalc_num_items = TRUE recalculate number of items in the manifest for updated items - if (recalc_num_items) { - dataflow_manifest$num_items[idx] <- calculate_items_per_manifest(df = dataflow_manifest[idx,], - asset_view = asset_view, - input_token = input_token, - base_url = base_url) - } - } - - # rearrange data flow manifest - dataflow_manifest <- dataflow_manifest %>% - dplyr::group_by(contributor) %>% - dplyr::arrange(contributor) - - return(data.frame(dataflow_manifest)) -} diff --git a/R/mod_dataset_selection.R b/R/mod_dataset_selection.R deleted file mode 100644 index 7d9121a..0000000 --- a/R/mod_dataset_selection.R +++ /dev/null @@ -1,116 +0,0 @@ -#' dataset_selection2 UI Function -#' -#' @description A shiny Module. -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_dataset_selection_ui <- function(id){ - ns <- NS(id) - tagList( - - ## SELECT DATASET BOX #################################################### - - fluidRow( - waiter::useWaiter(), - column(width = 12, - div( - id = ns("select_dataset_wrapper"), - - shinydashboard::box( - title = "Select Dataset", - width = NULL, - - # Table of storage project datasets - DT::DTOutput(ns("dataset_tbl")), - - br(), - - # Button to initiate dataset selection - actionButton(ns("submit_btn"), "Select Dataset(s)"), - - br() - ) - ) - ) - ) - ) - } - -#' dataset_selection2 Server Functions -#' -#' @noRd -mod_dataset_selection_server <- function(id, - storage_project_df, - asset_view, - input_token, - hidden_datasets = NULL, - base_url) { - - moduleServer( id, function(input, output, session) { - - ns <- session$ns - - ## DISPLAY STORAGE PROJECT DATASETS ########################################################### - # call schematic API - get datasets for selected storage project - - datasets <- reactive({ - - # show waiter - waiter::waiter_show(id = ns("select_dataset_wrapper"), - html = div( - style="color:#424874;", - waiter::spin_3(), - h4("Retrieving datasets..."))) - - # on exit - hide waiter - on.exit(waiter::waiter_hide()) - - storage_project_datasets_obj <- storage_project_datasets(asset_view = asset_view, - project_id = storage_project_df()$id, - input_token = input_token, - base_url = base_url) - - storage_project_datasets_obj$content - }) - - - # render data table with scroll bar, no pagination, and filtering - output$dataset_tbl <- DT::renderDataTable({ - DT::datatable(datasets(), - selection = "multiple", - option = list(scrollY = 500, - scrollCollapse = TRUE, - bPaginate = FALSE, - dom = "t"), - filter = list(position = 'top', clear = TRUE)) - }) - - # SUBSET DATAFRAME - selected_datasets <- reactive({ - - # get selected rows from datatable - selected <- input$dataset_tbl_rows_selected - - # subset - df <- datasets() - df[selected,] - }) - - # RETURN DATA ON CLICK - eventReactive(input$submit_btn, { - - return(selected_datasets()) - - }) - }) -} - - -## To be copied in the UI -# mod_dataset_selection2_ui("dataset_selection2_1") - -## To be copied in the server -# mod_dataset_selection2_server("dataset_selection2_1") diff --git a/R/mod_datatable_dashboard.R b/R/mod_datatable_dashboard.R deleted file mode 100644 index 4ab0102..0000000 --- a/R/mod_datatable_dashboard.R +++ /dev/null @@ -1,42 +0,0 @@ -#' datatable_dashboard UI Function -#' -#' @description A shiny Module. -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_datatable_dashboard_ui <- function(id){ - ns <- NS(id) - tagList( - DT::DTOutput(ns("datatable_out")) - ) -} - -#' datatable_dashboard Server Functions -#' -#' @param df dataframe containing data to be displayed in dashboard -#' @param config config in `inst/datatable_dashboard_config.json` -#' -#' @noRd -mod_datatable_dashboard_server <- function(id, df, config){ - moduleServer( id, function(input, output, session){ - ns <- session$ns - - # render datatable - - output$datatable_out <- DT::renderDataTable({ - create_dashboard(df(), - "release_scheduled", - config) - }) - - }) -} - -## To be copied in the UI -# mod_datatable_dashboard_ui("datatable_dashboard_1") - -## To be copied in the server -# mod_datatable_dashboard_server("datatable_dashboard_1") diff --git a/R/mod_datatable_filters.R b/R/mod_datatable_filters.R deleted file mode 100644 index 6b8b51e..0000000 --- a/R/mod_datatable_filters.R +++ /dev/null @@ -1,92 +0,0 @@ -#' datatable_filters UI Function -#' -#' @description A shiny Module. -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_datatable_filters_ui <- function(id, - width = NULL, - contributor_choices = c("Contributor 1", "Contributor 2"), - dataset_choices = c("dataset 1", "dataset 2"), - release_daterange = c(Sys.Date(), (Sys.Date() + 365)), - status_choices = c("status 1", "status 2")){ - ns <- NS(id) - tagList( - shinydashboard::box(title = "Filter Datasets", - collapsible = TRUE, - collapsed = TRUE, - width = width, - status = "primary", - - shiny::selectInput(ns("contributor_select"), - label = "Filter by contributor(s)", - choices = contributor_choices, - selected = contributor_choices, - multiple = TRUE), - - shiny::selectInput(ns("dataset_select"), - label = "Filter by dataset type(s)", - choices = dataset_choices, - selected = dataset_choices, - multiple = TRUE), - - shiny::dateRangeInput(ns("release_scheduled_daterange"), - label = "Filter by release scheduled date range", - start = release_daterange[1], - end = release_daterange[2]), - - shiny::checkboxGroupInput(ns("choose_status_checkbox"), - label = "Filter by status", - choices = status_choices, - selected = status_choices) - ) - ) -} - -#' datatable_filters Server Functions -#' -#' @noRd -mod_datatable_filters_server <- function(id, - manifest){ - - moduleServer(id, function(input, output, session) { - ns <- session$ns - - # CHANGE "NA" TO NA -------- - selected_datasets_modified <- reactive({ - # replace string "NA" with true NA - datasets <- input$dataset_select - datasets[datasets == "NA"] <- NA - datasets - }) - - - # FILTER INPUTS --------- - manifest_filtered <- reactive({ - manifest <- manifest() - - # FIXME: For some reason line 75 cause a warning - # Problem while computing `..3 = ... | is.na(release_scheduled)`. Input `..3` must be of size 19 or 1, not size 0. - # No error seems to be introduced so I will keep this line of code for now - filtered <- manifest %>% - dplyr::filter(contributor %in% input$contributor_select, - dataset %in% selected_datasets_modified(), - release_scheduled >= input$release_scheduled_daterange[1] & release_scheduled <= input$release_scheduled_daterange[2] | is.na(release_scheduled), - data_flow_status %in% input$choose_status_checkbox) - - - return(filtered) - }) - - return(manifest_filtered) - }) -} - -## To be copied in the UI -# mod_datatable_filters_ui("datatable_filters_1") - -## To be copied in the server -# mod_datatable_filters_server("datatable_filters_1") diff --git a/R/mod_distribution.R b/R/mod_distribution.R deleted file mode 100644 index 1c42072..0000000 --- a/R/mod_distribution.R +++ /dev/null @@ -1,75 +0,0 @@ -#' Distribution Plot UI Function -#' -#' @description A Shiny module that takes a dataframe and displays a distribution bar plot -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_distribution_ui <- function(id){ - ns <- NS(id) - tagList( - shiny::plotOutput(ns("distribution_plot")) - ) -} - -#' Distribution Plot Server Functions -#' -#' @param id Shiny ID to call server module -#' @param df A data frame containing data to plot -#' @param group_by_var Column variable to group data by (x axis variable) -#' @param title Title of plot -#' @param x_lab X axis label -#' @param y_lab Y axis label -#' @param fill Fill color -#' -#' @noRd -mod_distribution_server <- function(id, - df, - group_by_var, - title = NULL, - x_lab = NULL, - y_lab = NULL, - fill = "#0d1c38"){ - moduleServer( id, function(input, output, session){ - ns <- session$ns - - grouped_data <- reactive({ - df <- df() - - # group and tally data - df %>% - dplyr::group_by(.data[[group_by_var]]) %>% - dplyr::tally() - }) - - - - # create distribution plot - dist <- reactive({ - plot_df <- grouped_data() - ggplot2::ggplot(plot_df, - ggplot2::aes(x = reorder(.data[[group_by_var]], -n, ), y = n)) + - - ggplot2::geom_bar(stat = "identity", fill = fill) + - - ggplot2::labs(title = title, x = x_lab, y = y_lab) + - - ggplot2::theme_minimal() + - - ggplot2::theme(axis.text.x = ggplot2::element_text(angle=90,hjust=1)) - }) - - # render plot - output$distribution_plot <- shiny::renderPlot({ - dist() - }) - }) -} - -## To be copied in the UI -# mod_distribution_ui("distribution_1") - -## To be copied in the server -# mod_distribution_server("distribution_1") diff --git a/R/mod_file_selection.R b/R/mod_file_selection.R deleted file mode 100644 index 865bf95..0000000 --- a/R/mod_file_selection.R +++ /dev/null @@ -1,95 +0,0 @@ -#' file_selection UI Function -#' -#' @description A shiny Module. -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_file_selection_ui <- function(id){ - ns <- NS(id) - tagList( - - fluidRow( - waiter::use_waiter(), - column(width = 12, - # Action button that opens file selector - # TODO: eventually this will become a toggle similar to data_curator dashboard - div( - id = ns("select_files_wrapper"), - shinydashboard::box( - width = NULL, - title = "Select Files", - - actionButton(ns("getfiles_btn"), "Get Files"), - - DT::DTOutput(ns("manifest_tbl")) - ) - ) - ) - ) - ) - } - -#' file_selection Server Functions -#' -#' @noRd -mod_file_selection_server <- function(id, dataset, asset_view, input_token) { - - moduleServer( id, function(input, output, session) { - - ns <- session$ns - - w <- Waiter$new(id = ns("select_files_wrapper"), - html = div( - style="color:#424874;", - waiter::spin_3(), - h4("Retrieving manifest...")), - color = transparent(.8)) - - - # ON CLICK GET MANIFEST FOR SELECTED DATASET ############################################################ - # FIXME: Button click data flow is not ideal - # Click of show file level view must happen AFTER dataset is selected - # If you have clicked show file level view and displayed a dataset, but want to - # change that dataset you need to click "Show file level view" again - - manifest <- eventReactive(input$getfiles_btn, { - - # show waiter - w$show() - - # on exit - hide waiter - on.exit({ - w$hide() - }) - - ds <- dataset() - manifest_download_to_df(asset_view = asset_view, - dataset_id = ds$id, - input_token = input_token) - - }) - - # DISPLAY MANIFEST AS TABLE ############################################################################# - - output$manifest_tbl <- DT::renderDataTable({ - DT::datatable(manifest(), - option = list(scrollY = 500, - scrollX = TRUE, - scrollCollapse = TRUE, - bPaginate = FALSE, - dom = "t"), - filter = list(position = 'top', clear = TRUE)) - }) - - # return a list containing the downloaded manifest and rows selected - - return(list( - manifest = reactive({ manifest() }), - selected_rows = reactive({ input$manifest_tbl_rows_selected }) - )) - - }) -} \ No newline at end of file diff --git a/R/mod_highlight_datatable.R b/R/mod_highlight_datatable.R deleted file mode 100644 index 1efea13..0000000 --- a/R/mod_highlight_datatable.R +++ /dev/null @@ -1,72 +0,0 @@ -#' highlight_datatable UI Function -#' -#' @description A shiny Module. -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_highlight_datatable_ui <- function(id){ - ns <- NS(id) - tagList( - - DT::DTOutput(ns("highlight_tbl")), - ) -} - -#' highlight_datatable Server Functions -#' -#' @noRd -mod_highlight_datatable_server <- function(id, - df, - selection, - df_match_colname){ - moduleServer( id, function(input, output, session){ - ns <- session$ns - - # create selected TRUE/FALSE idx - selection_idx <- reactive({ - df()[[df_match_colname]] %in% selection() - }) - - # add selection_idx to datatable - manifest_w_idx <- reactive({ - selection_idx_df <- data.frame(selection_idx = selection_idx()) - dplyr::bind_cols(df(), selection_idx_df) - }) - - hide_idx <- reactive({ - # hide selection index column - hide_idx <- match("selection_idx", names(manifest_w_idx())) - }) - - output$highlight_tbl <- DT::renderDataTable({ - - # datatable with x and y scrollbar, no pagination - # hiding the selection index column - dt <- DT::datatable(manifest_w_idx(), - escape = FALSE, - selection = "none", - filter = "top", - options = list(scrollX = TRUE, - scrollY = 800, - bPaginate = FALSE, - columnDefs = list(list(targets = hide_idx(), - visible = FALSE)))) - - # add conditional styling based on hidden column - dt <- DT::formatStyle(table = dt, - "selection_idx", target = "row", - backgroundColor = DT::styleEqual(TRUE, "#ffe2ad")) - - dt - }) - }) -} - -## To be copied in the UI -# mod_highlight_datatable_ui("highlight_datatable_1") - -## To be copied in the server -# mod_highlight_datatable_server("highlight_datatable_1") diff --git a/R/mod_scheduler.R b/R/mod_scheduler.R deleted file mode 100644 index 6510f20..0000000 --- a/R/mod_scheduler.R +++ /dev/null @@ -1,87 +0,0 @@ -#' scheduler UI Function -#' -#' @description A shiny Module. -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' @param dateInput_label label for dateInput -#' @param checkboxInput_label date for checkboxInput -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_scheduler_ui <- function(id, - dateInput_label, - checkboxInput_label) { - ns <- NS(id) - tagList( - - # initialize shinyjs - shinyjs::useShinyjs(), - - # release scheduled input - dateInput(ns("date"), label = dateInput_label, value = NA), - checkboxInput(ns("unschedule_chk"), label = checkboxInput_label, value = FALSE)) -} - -#' scheduler Server Functions -#' -#' @noRd -mod_scheduler_server <- function(id, - reset_btn){ - moduleServer( id, function(input, output, session){ - ns <- session$ns - - # on checkbox click - observeEvent(input$unschedule_chk, { - - # if the checkbox is clicked: - if(input$unschedule_chk == TRUE){ - - # update the date input to blank out the date - updateDateInput(session = session, inputId = "date", value = NA) - - # use shinyjs to disable the date ui widget - shinyjs::disable("date") - - } else { - - # when checkbox is not clicked enable the date box to be used - shinyjs::enable("date") - } - }) - - observeEvent(reset_btn(), { - updateDateInput(session = session, inputId = "date", value = NA) - }) - - date_out <- reactive({ - - # if there is no date selected AND checkbox is not clicked return NULL - if (length(input$date) == 0 & input$unschedule_chk == FALSE) { - return(NULL) - - # if there is no date selected AND checkbox is clicked return NA (unschedule) - } else if (length(input$date) == 0 & input$unschedule_chk == TRUE) { - return(NA) - - # if there is a selected AND checkbox is clicked return NA (unschedule) - } else if (length(input$date) != 0 & input$unschedule_chk == TRUE) { - return(NA) - - # if there is a selected date and checkbox is not clicked return date - } else { - return(input$date) - } - - }) - - return(reactive({ date_out() })) - - }) -} - -## To be copied in the UI -# mod_scheduler_ui("scheduler_1") - -## To be copied in the server -# mod_scheduler_server("scheduler_1") \ No newline at end of file diff --git a/R/mod_select_storage_project.R b/R/mod_select_storage_project.R deleted file mode 100644 index 3e63a9b..0000000 --- a/R/mod_select_storage_project.R +++ /dev/null @@ -1,77 +0,0 @@ -# Storage Project Selection Module UI - -#' @title select_storage_project_ui and select_storage_project_server -#' @description A shiny module. Outputs a selectInput dropdown of Synapse storage project names to the UI. -#' @return To the server: A list information from the module. `selected_df` - a dataframe with a single row containing the `name` and `id` of the selected storage project. `action_btn` - TRUE/FALSE output from button click. -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_select_storage_project_ui <- function(id){ - ns <- NS(id) - tagList( - shinydashboard::box( - title = "Select Project", - width = NULL, - - # Project dropdown - uiOutput(ns("project_selector")), - - # Button to initiate project selection - actionButton(ns("submit_btn"), - "Select Project"), - ) - ) -} - -# Storage Project Selection Module Server -#' -#' @noRd -mod_select_storage_project_server <- function(id, asset_view, input_token, base_url) { - - moduleServer( id, function(input, output, session){ - - ns <- session$ns - - # API CALL : GET STORAGE PROJECTS ####################################################################### - - storage_project_obj <- storage_projects(asset_view = asset_view, - input_token = input_token, - base_url = base_url) - - # DROP DOWN LISTING STORAGE PROJECTS #################################################################### - - # render ui for storage project drop down - output$project_selector <- shiny::renderUI({ - - selectInput(inputId = ns("selected_project"), - label = NULL, - choices = storage_project_obj$content[,"name"], - selectize = FALSE) # must be false or for some reason cannot reference `input$selected_project` - - }) - - # SUBSET STORAGE PROJECT DATAFRAME BY SELECTED PROJECT ############################################################## - - selected_project_df <- reactive({ - - req(input$selected_project) - - storage_project_obj$content[ match(input$selected_project, storage_project_obj$content[,"name"]), ] - }) - - # RETURN SELECTED PROJECT ############################################################## - - eventReactive(input$submit_btn, { - return(selected_project_df()) - }) - }) - } - -## To be copied in the UI -# mod_select_storage_project_ui("select_storage_project_1") - -## To be copied in the server -# mod_select_storage_project_server("select_storage_project_1") \ No newline at end of file diff --git a/R/mod_stacked_bar.R b/R/mod_stacked_bar.R deleted file mode 100644 index 493e6b3..0000000 --- a/R/mod_stacked_bar.R +++ /dev/null @@ -1,100 +0,0 @@ -#' Stacked Bar Plot UI Function -#' -#' @description A Shiny module that takes in a datafame and outputs a stacked bar plot. -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_stacked_bar_ui <- function(id){ - ns <- NS(id) - tagList( - shiny::plotOutput(ns("stacked_bar")) - ) -} - -#' Stacked Bar Plot Server Functions -#' -#' @param id Shiny ID to call server module -#' @param df A data frame containing data to plot -#' @param x_var Column name of X variable -#' @param y_var Column name of Y variable -#' @param fill_var Column name of fill variable -#' @param title Title of plot -#' @param x_lab X axis label -#' @param y_lab Y axis label -#' @param colors Fill colors -#' @param x_line Add a line across x axis -#' @param width Width of stacked bars -#' @param date_breaks X axis date breaks -#' @param coord_flip Flip coordinates 90 degrees - -#' @noRd -mod_stacked_bar_server <- function(id, - df, - x_var, - y_var, - fill_var, - title = NULL, - x_lab = NULL, - y_lab = NULL, - colors = NULL, - x_line = NULL, - width = NULL, - date_breaks = NULL, - coord_flip = FALSE) { - - moduleServer( id, function(input, output, session){ - ns <- session$ns - - # render stacked bar - output$stacked_bar <- shiny::renderPlot({ - df <- df() - - # base plot - bar <- ggplot2::ggplot(df, ggplot2::aes(x = .data[[x_var]], y = .data[[y_var]], fill = .data[[fill_var]])) + - - ggplot2::geom_col(position = "fill", width = width) - - # add x intercept - if (!is.null(x_line)) { - bar <- bar + - ggplot2::geom_vline(xintercept = x_line, linetype = 2, colour = "black") - } - - # scale x axis with date breaks - if (!is.null(date_breaks)) { - bar <- bar + - ggplot2::scale_x_date(date_breaks = date_breaks) - } - - # add styling/labs - bar <- bar + - ggplot2::labs(title = title, x = x_lab, y = y_lab) + - ggplot2::theme_minimal() + - ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 90, hjust = 1)) - - # add custom color - if (!is.null(colors)) { - bar <- bar + - ggplot2::scale_fill_manual(values = colors) - } - - # flip coordinates - if (coord_flip) { - bar <- bar + - ggplot2::coord_flip() - } - - bar - }) - - }) -} - -## To be copied in the UI -# mod_stacked_bar_ui("stacked_bar_1") - -## To be copied in the server -# mod_stacked_bar_server("stacked_bar_1") diff --git a/R/mod_submit_model.R b/R/mod_submit_model.R deleted file mode 100644 index 6626696..0000000 --- a/R/mod_submit_model.R +++ /dev/null @@ -1,79 +0,0 @@ -#' submit_model UI Function -#' -#' @description A shiny Module. -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_submit_model_ui <- function(id){ - ns <- NS(id) - tagList( - waiter::useWaiter(), - actionButton(ns("submit"), "Submit to Synapse") - - ) -} - -#' submit_model Server Functions -#' -#' @noRd -mod_submit_model_server <- function(id, - dfs_manifest, - data_type, - asset_view, - dataset_id, - manifest_dir = "./manifest", - input_token, - schema_url, - base_url) { - moduleServer( id, function(input, output, session) { - ns <- session$ns - - # FIXME: Stop writing csv, use json instead - # Blocked due to schematic api limitations - - # create manifest directory if it doesn't exist yet - if (!file.exists(manifest_dir)) { - dir.create(manifest_dir) - } - - # on button click submit model to synapse - observeEvent(input$submit, { - - # write manifest csv - path <- file.path(manifest_dir, "synapse_storage_manifest_dataflow.csv") - write.table(dfs_manifest(), - path, - sep = ",", - row.names = FALSE) - - waiter::waiter_show(html = div( - style="color:#424874;", - waiter::spin_3(), - h4("Submitting updated manifest to Synapse..."))) - - # submit model to synapse - model_submit(data_type = data_type, - asset_view = asset_view, - dataset_id = dataset_id, - file_name = path, - restrict_rules = TRUE, - input_token = input_token, - manifest_record_type = "table_and_file", - schema_url = schema_url, - base_url = base_url) - - waiter::waiter_hide() - }) - - - }) -} - -## To be copied in the UI -# mod_submit_model_ui("submit_model_1") - -## To be copied in the server -# mod_submit_model_server("submit_model_1") diff --git a/R/mod_tabbed_dashboard.R b/R/mod_tabbed_dashboard.R deleted file mode 100644 index 69c244c..0000000 --- a/R/mod_tabbed_dashboard.R +++ /dev/null @@ -1,126 +0,0 @@ -#' tabbed_dashboard UI Function -#' -#' @description A shiny Module. -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_tabbed_dashboard_ui <- function(id){ - ns <- NS(id) - tagList( - - # tabbox - shinydashboard::tabBox( - title = "Dataset Dashboard", - width = NULL, - side = "right", - - # show different views of dataset on different tab panels - - # all unreleased data - tabPanel("Unreleased", - mod_datatable_dashboard_ui(ns("datatable_dashboard_unreleased"))), - - # unreleased, no embargo, passing all checks - # aka ready for release - tabPanel("Ready for release", - mod_datatable_dashboard_ui(ns("datatable_dashboard_ready"))), - - # released_scheduled = NA - tabPanel("Not scheduled", - mod_datatable_dashboard_ui(ns("datatable_dashboard_not_scheduled"))), - - # all - tabPanel("All", - mod_datatable_dashboard_ui(ns("datatable_dashboard_all"))), - - # released = TRUE - tabPanel("Previously released", - mod_datatable_dashboard_ui(ns("datatable_dashboard_archive"))) - ) - ) -} - -#' tabbed_dashboard Server Functions -#' -#' @noRd -mod_tabbed_dashboard_server <- function(id, df, config){ - moduleServer( id, function(input, output, session){ - ns <- session$ns - - # TODO: Remove hard coded column names - # I think column names will come from data flow component - - # subset dataframe into various views - unreleased_datasets <- reactive({ - data <- df() - data[ data$released == FALSE, ] - }) - - # not scheduled - not_scheduled_datasets <- reactive({ - data <- df() - data[ is.na(data$release_scheduled), ] - }) - - # all checks passing / no embargo / unreleased (i.e. ready for release) - all_checks_passed_datasets <- reactive({ - - qc_cols <- "standard_compliance" - - data <- df() - - # which rows have all qc_cols == TRUE - passing <- apply(data[qc_cols], 1, all) - - # which rows have passed their embargo date or are NA - no_embargo <- data$embargo <= Sys.Date() | is.na(data$embargo) - - # which rows are unreleased - unreleased <- data$released == FALSE - - # which rows are passing qc, past/have no embargo, and are unreleased - ready <- passing & no_embargo - - - # subset - data[ ready, ] - }) - - # previously released - released_datasets <- reactive({ - data <- df() - data[ data$released == TRUE, ] - }) - - # render datatables - - mod_datatable_dashboard_server("datatable_dashboard_all", - df, - config) - - mod_datatable_dashboard_server("datatable_dashboard_unreleased", - unreleased_datasets, - config) - - mod_datatable_dashboard_server("datatable_dashboard_not_scheduled", - not_scheduled_datasets, - config) - - mod_datatable_dashboard_server("datatable_dashboard_ready", - all_checks_passed_datasets, - config) - - mod_datatable_dashboard_server("datatable_dashboard_archive", - released_datasets, - config) - }) -} - -## To be copied in the UI -# mod_tabbed_dashboard_ui("tabbed_dashboard_1") - -## To be copied in the server -# mod_tabbed_dashboard_server("tabbed_dashboard_1") diff --git a/R/mod_update_data_flow_status.R b/R/mod_update_data_flow_status.R deleted file mode 100644 index 57d0e17..0000000 --- a/R/mod_update_data_flow_status.R +++ /dev/null @@ -1,99 +0,0 @@ -#' update_data_flow_status UI Function -#' -#' @description A shiny Module. -#' -#' @param id,input,output,session Internal parameters for {shiny}. -#' -#' @noRd -#' -#' @importFrom shiny NS tagList -mod_update_data_flow_status_ui <- function(id){ - ns <- NS(id) - tagList( - shinydashboard::box( - title = "Update Data Flow Status", - width = NULL, - - # release scheduled input - mod_scheduler_ui(ns("release_date"), - dateInput_label = h4("Schedule Release"), - checkboxInput_label = "Unschedule Release"), - # embargo input - mod_scheduler_ui(ns("embargo"), - dateInput_label = h4("Schedule Embargo"), - checkboxInput_label = "Unschedule Embargo"), - - # standard compliance input - radioButtons(ns("standard_compliance"), - label = h4("Standard Compliance"), - list("TRUE" = TRUE, "FALSE" = FALSE), - selected = NA), - - # data portal input - radioButtons(ns("data_portal"), - label = h4("Data Portal"), - choices = list("TRUE" = TRUE, "FALSE" = FALSE), - selected = NA), - - # released input - radioButtons(ns("released"), - label = h4("Released"), - choices = list("TRUE" = TRUE, "FALSE" = FALSE), - selected = NA), - - br(), - - # reset button - actionButton(ns("reset_btn"), "Reset Button") - ) - ) -} - - -#' update_data_flow_status Server Functions -#' -#' @noRd -mod_update_data_flow_status_server <- function(id){ - moduleServer( id, function(input, output, session){ - ns <- session$ns - - release_scheduled <- mod_scheduler_server("release_date", - reactive({input$reset_btn})) - - embargo <- mod_scheduler_server("embargo", - reactive({input$reset_btn})) - - observeEvent(input$reset_btn, { - updateRadioButtons(session = session, - inputId = "standard_compliance", - selected = character(0)) - - updateRadioButtons(session = session, - inputId = "data_portal", - selected = character(0)) - - updateRadioButtons(session = session, - inputId = "released", - selected = character(0)) - }) - - res <- reactive({ - list(release_scheduled = release_scheduled(), - embargo = embargo(), - standard_compliance = input$standard_compliance, - data_portal = input$data_portal, - released = input$released) - }) - - - return(reactive({ res() })) - - - }) -} - -## To be copied in the UI -# mod_update_data_flow_status_ui("update_data_flow_status_1") - -## To be copied in the server -# mod_update_data_flow_status_server("update_data_flow_status_1") diff --git a/R/parse_config.R b/R/parse_config.R deleted file mode 100644 index b39ac09..0000000 --- a/R/parse_config.R +++ /dev/null @@ -1,71 +0,0 @@ -#' Parse config to get columns types -#' -#' @param config datatable_dashboard_config.json as a datatable (`jsonlite::read_json("inst/datatable_dashboard_config.json")`) -#' @param type column type as described in datatable_dashboard_config.json -#' -#' @export - -get_colname_by_type <- function(type = c("icon", "drop_down_fliter"), - config) { - - # get all elements with 'type' - type_list <- purrr::map(config, "type") - types <- unlist(type_list) - - #subset types (a names list) where the entry == type - col_names <- names(types[types == type]) - - return(col_names) - -} - -#' Parse config to get display column names for dashboard -#' -#' @param config datatable_dashboard_config.json as a datatable (`jsonlite::read_json("inst/datatable_dashboard_config.json")`) -#' -#' @export - -get_renamed_colnames <- function(config) { - # create a vector of display column names - new_col_names <- purrr::map(config, "col_name") - - purrr::flatten_chr(new_col_names) -} - -#' Parse config to get columns with na_replace specified -#' -#' @param config datatable_dashboard_config.json as a datatable (`jsonlite::read_json("inst/datatable_dashboard_config.json")`) -#' -#' @export - -get_na_replace_colnames <- function(config) { - # create a vector of display column names - col_names <- purrr::map(config, "na_replace") - names(purrr::flatten(col_names)) -} - -#' Parse config to get na replacement definitions with custom javascript. Outputs a list. -#' -#' @param config datatable_dashboard_config.json as a datatable (`jsonlite::read_json("inst/datatable_dashboard_config.json")`) -#' @param prepped_dataframe dataframe output by `prep_df_for_dash()` -#' -#' @export - -get_na_replace_defs <- function(prepped_dataframe, - config) { - - # get na_replace columns - na_replace_cols <- get_na_replace_colnames(config) - - # get colname index in prepped dataframe - na_replace_idx <- match(na_replace_cols, names(prepped_dataframe)) - - defs <- lapply(seq_along(na_replace_cols), function(i) { - colname <- na_replace_cols[i] - replacement <- config[[colname]]$na_replace - dt_replace_na(na_replace_idx[i], - replacement) - }) - - return(defs) -} diff --git a/R/schematic_rest_api.R b/R/schematic_rest_api.R deleted file mode 100644 index 656a052..0000000 --- a/R/schematic_rest_api.R +++ /dev/null @@ -1,428 +0,0 @@ -############################# -## Schematic API Functions ## -############################# - -# Functions follow best practice convention laid out in httr vingette -# https://httr.r-lib.org/articles/api-packages.html - -#' Download a manifest -#' -#' @param asset_view ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml) -#' @param dataset_id Synapse ID of existing manifest -#' @param input_token Synapse login cookie, PAT, or API key. -#' @param base_url URL to schematic API endpoint - -#' @export - -manifest_download <- function(asset_view, - dataset_id, - input_token, - base_url = "https://schematic-dev.api.sagebionetworks.org") { - - # create api url - url <- paste0(base_url, "/v1/manifest/download") - - # set up parameters for httr::get call - params = list( - `input_token` = input_token, - `asset_view` = asset_view, - `dataset_id` = dataset_id, - `as_json` = TRUE, - `new_manifest_name` = NULL - ) - - # run GET - res <- httr::GET(url = url, query = params) - - # check that application returns json - # even when json = TRUE, http_type = "text/csv" - # if (httr::http_type(res) != "application/json") { - # stop("API did not return json", call. = FALSE) - # } - - # pull out content from request - parsed <- suppressMessages(jsonlite::fromJSON(httr::content(res, as = "text"))) - - # if the api call returns an error - # surface error to user - if (httr::http_error(res)) { - stop( - sprintf( - "Schematic API request failed [%s]\n%s", - httr::status_code(res), - parsed$detail - ), - call. = FALSE - ) - } - - # return a helpful object - structure( - list( - content = parsed, - response = res - ), - class = "schematic_api" - ) -} - -#' schematic rest api to submit metadata -#' -#' @param data_type Type of dataset. Set to None for no validation check -#' @param asset_view ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml) -#' @param dataset_id Synapse ID of existing manifest -#' @param file_name Filepath of csv to validate -#' @param input_token Synapse login cookie, PAT, or API key -#' @param restrict_rules If True, validation suite will only run with in-house validation rule. If False, the Great Expectations suite will be utilized and all rules will be available. -#' @param manifest_record_type Manifest storage type. Options: "--", "table" (default), "entity", "both". -#' @param base_url URL to schematic API endpoint -#' @param schema_url URL to a schema jsonld -#' -#' @returns TRUE if successful upload or validate errors if not. -#' @export - -model_submit <- function(data_type = NULL, - asset_view, - dataset_id, - file_name, - input_token, - restrict_rules = TRUE, - manifest_record_type = "table_and_file", - base_url = "https://schematic-dev.api.sagebionetworks.org", - schema_url="https://raw.githubusercontent.com/Sage-Bionetworks/data_flow/main/inst/data_flow_component.jsonld", - use_schema_label = TRUE) { - - # create url - url <- paste0(base_url, "/v1/model/submit") - - # set up parameters for httr::get call - params = list( - `schema_url` = schema_url, - `data_type` = data_type, - `dataset_id` = dataset_id, - `manifest_record_type` = manifest_record_type, - `restrict_rules` = restrict_rules, - `asset_view` = asset_view, - `input_token` = input_token, - `use_schema_label` = use_schema_label - ) - - files = list( - `file_name` = httr::upload_file(file_name) - ) - - # POST - res <- httr::POST(url = url, - query = params, - body = files) - - # parse response for content - parsed <- httr::content(res) - - # if the api call returns an error - # surface error to user - if (httr::http_error(res)) { - stop( - sprintf( - "Schematic API request failed [%s]", - httr::status_code(res) - ), - call. = FALSE - ) - } - - # return a helpful object - structure( - list( - content = parsed, - response = res - ), - class = "schematic_api" - ) -} - -#' Gets all datasets in folder under a given storage project that the current user has access to. -#' -#' @param asset_view synapse ID of master file view. -#' @param project_id synapse ID of a storage project. -#' @param input_token synapse PAT -#' @param base_url URL to schematic API endpoint -#' -#'@export - -storage_project_datasets <- function(asset_view, - project_id, - input_token, - base_url = "https://schematic-dev.api.sagebionetworks.org") { - - # create url - url <- paste0(base_url, "/v1/storage/project/datasets") - - # set up parameters for httr::get call - params <- list( - asset_view = asset_view, - project_id = project_id, - input_token = input_token) - - # GET - res <- httr::GET(url, query = params) - - # pull out content from request - parsed <- suppressMessages(jsonlite::fromJSON(httr::content(res, as = "text"))) - - # if the api call returns an error - # surface error to user - if (httr::http_error(res)) { - stop( - sprintf( - "Schematic API request failed [%s]\n%s", - httr::status_code(res), - parsed$detail - ), - call. = FALSE - ) - } - - # return parsed matrix as dataframe - parsed_df <-data.frame(parsed) - names(parsed_df) <- c("id", "name") - - # return a helpful object - structure( - list( - content = parsed_df, - response = res - ), - class = "schematic_api" - ) -} - -#' Get all storage projects the current user has access to -#' -#' @param asset_view synapse ID of master file view. -#' @param input_token synapse PAT -#' @param base_url URL to schematic API endpoint -#' -#' @export - -storage_projects <- function(asset_view, - input_token, - base_url = "https://schematic-dev.api.sagebionetworks.org") { - - # create url - url <- paste0(base_url, "/v1/storage/projects") - - # set up parameters for httr::get call - params <- list( - asset_view = asset_view, - input_token = input_token - ) - - # GET - res <- httr::GET(url, query = params) - - # pull out content from request - parsed <- suppressMessages(jsonlite::fromJSON(httr::content(res, as = "text"))) - - # if the api call returns an error - # surface error to user - if (httr::http_error(res)) { - stop( - sprintf( - "Schematic API request failed [%s]\n%s", - httr::status_code(res), - parsed$detail - ), - call. = FALSE - ) - } - - # return parsed matrix as dataframe - parsed_df <- data.frame(parsed) - names(parsed_df) <- c("id", "name") - - # return a helpful object - structure( - list( - content = parsed_df, - response = res - ), - class = "schematic_api" - ) -} - -#' /storage/project/manifests -#' -#' @param asset_view synapse ID of master file view. -#' @param dataset_id synapse ID of a storage dataset. -#' @param input_token synapse PAT -#' @param base_url URL to schematic API endpoint -#' -#' @export - -storage_project_manifests <- function(asset_view, - project_id, - input_token, - base_url = "https://schematic-dev.api.sagebionetworks.org") { - - # write URL - url <- paste0(base_url, "/v1/storage/project/manifests") - - # set up parameters for httr::get call - params = list( - `input_token` = input_token, - `project_id` = project_id, - `asset_view` = asset_view - ) - - #GET - res <- httr::GET(url = url, query = params) - - # pull out content from request - parsed <- suppressMessages(jsonlite::fromJSON(httr::content(res, as = "text"))) - - # if the api call returns an error - # surface error to user - if (httr::http_error(res)) { - stop( - sprintf( - "Schematic API request failed [%s]\n%s", - httr::status_code(res), - parsed$detail - ), - call. = FALSE - ) - } - - # return parsed matrix as dataframe - parsed_df <- data.frame(parsed) - - # if dataframe has content, name columns - if (nrow(parsed_df) > 0) { - names(parsed_df) <- c("dataset_id", "manifest_id", "data_type", "folder_name", "file_name") - # drop redundant data type column - parsed_df <- parsed_df[,-6] - } - - # return a helpful object - structure( - list( - content = parsed_df, - response = res - ), - class = "schematic_api" - ) -} - - -#' Get all the attributes associated with a specific data model component formatted as a dataframe -#' -#' @param schema_url A data model URL -#' @param component Component of the data model to explore -#' @param base_url URL to schematic API endpoint -#' @export - -visualize_component <- function(schema_url, - component = "DataFlow", - base_url = "https://schematic-dev.api.sagebionetworks.org") { - - # create api url - url <- paste0(base_url, "/v1/visualize/component") - - # set up parameters for httr::get - params = list( - `schema_url` = schema_url, - `component` = component, - `include_index` = "false" - ) - - # GET - res <- httr::GET(url = url, query = params) - - # check that application returns json - # even when json = TRUE, http_type = "text/csv" - # if (httr::http_type(res) != "application/json") { - # stop("API did not return json", call. = FALSE) - # } - - # pull out content from request - parsed <- suppressMessages(httr::content(res)) - - # if the api call returns an error - # surface error to user - if (httr::http_error(res)) { - stop( - sprintf( - "Schematic API request failed [%s]", - httr::status_code(res) - ), - call. = FALSE - ) - } - - # return a helpful object - structure( - list( - content = parsed, - response = res - ), - class = "schematic_api" - ) -} - -# print method for schematic_api class of functions -print.schematic_api <- function(x, ...) { - str(x$content) - invisible(x) -} - -## ARCHIVE #################################################################### -# -# THIS FUNCTION IS UNTESTED AND NOT USED ANYMORE -# -# storage_dataset_files <- function(asset_view, -# dataset_id, -# input_token, -# file_names=list(), -# full_path=FALSE, -# base_url = "https://schematic-dev.api.sagebionetworks.org") { -# -# # create url -# url <- paste0(base_url, "/v1/storage/dataset/files") -# -# # set up parameters for httr::get call -# params <- list( -# asset_view = asset_view, -# dataset_id = dataset_id, -# file_names = file_names, -# full_path = full_path, -# input_token = input_token) -# -# # GET -# res <- httr::GET(url, query = params) -# -# # pull out content from request -# parsed <- jsonlite::fromJSON(httr::content(res, as = "text")) -# -# # if the api call returns an error -# # surface error to user -# if (httr::http_error(res)) { -# stop( -# sprintf( -# "Schematic API request failed [%s]\n%s", -# httr::status_code(res), -# parsed$detail -# ), -# call. = FALSE -# ) -# } -# -# # return a helpful object -# structure( -# list( -# content = parsed, -# response = res -# ), -# class = "schematic_api" -# ) -# } diff --git a/R/utility.R b/R/utility.R deleted file mode 100644 index cb1ea93..0000000 --- a/R/utility.R +++ /dev/null @@ -1,99 +0,0 @@ -############################### -## Generic Utility Functions ## -############################### - -#' Convert a list to a dataframe -#' -#' @param list A list of items. Only works where list entries all follow the same pattern. -#' @param col_names Desired column names. Ex: `c("id", "name")` -#' -#' @export - -list_to_dataframe <- function(list, - col_names = NULL) { - - # convert list to dataframe - df <- data.frame(do.call(rbind, list)) - - if (length(list) != 1){ - # for some reason the columns of this df are class = list - # this hasn't really caused a problem, but I want class = char - df <- data.frame(apply(df, 2, unlist)) - } - - # if colnames are specified, add them - if (!is.null(col_names)) { - names(df) <- col_names - } - - return(df) -} - -#' Convert date columns from date to string -#' -#' @param df a data flow status manifest. -#' @param col_names columns to update -#' @param type date, character, integer, logical, icon, or factor -#' -#' @export - -convert_column_type <- function(df, - col_names, - type) { - if (type == "date") { - df[col_names] <- lapply(df[,col_names], as.Date) - } else if (type == "character") { - df[col_names] <- sapply(df[,col_names], as.character) - } else if (type == "factor") { - df[col_names] <- lapply(df[,col_names], as.factor) - } else if (type == "logical") { - df[col_names] <- sapply(df[,col_names], as.logical) - } else if (type == "integer") { - df[col_names] <- sapply(df[,col_names], as.integer) - } else if (type == "icon") { - df[col_names] <- sapply(df[,col_names], true_false_icon) - } else { - stop(paste0(type, " is not a supported date type")) - } - - return(df) -} - -#' Convert a vector of TRUE/FALSE to icon html -#' -#' @param vec A vector of TRUE/FALSE -#' -#' @export - -true_false_icon <- function(vec) { - - # if true assign checkmark icon - # if false assign x icon - true_icon <- as.character(icon("check", lib = "font-awesome")) - false_icon <- as.character(icon("xmark", lib = "font-awesome")) - - ifelse(vec == TRUE, true_icon, false_icon) -} - -#' Rearrange a dataframe. Expected columns are ordered to match `expected_col_names` and moved to the front of the dataframe. Unexpected columns are moved to the back of the dataframe. -#' -#' @param df a dataframe -#' @param expected_col_names a vector of expected column names in the order you would like them to appear. -#' -#' @export - -rearrange_dataframe <- function(df, - expected_col_names) { - - # capture column names of unexpected columns - other_column_names <- setdiff(names(df), expected_col_names) - - # create separate dataframes - # order expected columns to match expected_col_names - exected_df <- df[expected_col_names] - other_df <- df[other_column_names] - - # bind back together - dplyr::bind_cols(exected_df, other_df) - -} \ No newline at end of file diff --git a/R/utils-pipe.R b/R/utils-pipe.R deleted file mode 100644 index fd0b1d1..0000000 --- a/R/utils-pipe.R +++ /dev/null @@ -1,14 +0,0 @@ -#' Pipe operator -#' -#' See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details. -#' -#' @name %>% -#' @rdname pipe -#' @keywords internal -#' @export -#' @importFrom magrittr %>% -#' @usage lhs \%>\% rhs -#' @param lhs A value or the magrittr placeholder. -#' @param rhs A function call using the magrittr semantics. -#' @return The result of calling `rhs(lhs)`. -NULL diff --git a/man/calculate_items_per_manifest.Rd b/man/calculate_items_per_manifest.Rd deleted file mode 100644 index c28fdb0..0000000 --- a/man/calculate_items_per_manifest.Rd +++ /dev/null @@ -1,20 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/api_wrappers.R -\name{calculate_items_per_manifest} -\alias{calculate_items_per_manifest} -\title{Call `calculate_items_per_manifest` calculate the number of items per manifest synID in a given dataframe} -\usage{ -calculate_items_per_manifest(df, asset_view, input_token, base_url) -} -\arguments{ -\item{df}{A dataframe with `entityId` and `dataset` columns from data flow status manifest} - -\item{asset_view}{ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml)} - -\item{input_token}{Synapse PAT} - -\item{base_url}{Base URL of schematic API} -} -\description{ -Call `calculate_items_per_manifest` calculate the number of items per manifest synID in a given dataframe -} diff --git a/man/convert_column_type.Rd b/man/convert_column_type.Rd deleted file mode 100644 index 969a2ac..0000000 --- a/man/convert_column_type.Rd +++ /dev/null @@ -1,18 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utility.R -\name{convert_column_type} -\alias{convert_column_type} -\title{Convert date columns from date to string} -\usage{ -convert_column_type(df, col_names, type) -} -\arguments{ -\item{df}{a data flow status manifest.} - -\item{col_names}{columns to update} - -\item{type}{date, character, integer, logical, icon, or factor} -} -\description{ -Convert date columns from date to string -} diff --git a/man/create_dashboard.Rd b/man/create_dashboard.Rd deleted file mode 100644 index 425f1ec..0000000 --- a/man/create_dashboard.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/datatable_functions.R -\name{create_dashboard} -\alias{create_dashboard} -\title{Create a dashboard style datatable} -\usage{ -create_dashboard(df, past_due_col, config) -} -\arguments{ -\item{df}{A dataframe prepared by `prep_df_for_dash()` with the columns `Contributor`, `Dataset_Name`, `Dataset_Type`, `Num_Items`, `Release_Scheduled`, `Embargo`, `Standard_Compliance`, `QC_Compliance`,`PHI_Detection_Compliance`, `Access_Controls_Compliance`, `Data_Portal`, `Released`, `past_due`} - -\item{config}{Config for datatable dashboard module in `inst/datatable_dashboard_config.json`} -} -\description{ -Create a dashboard style datatable -} diff --git a/man/dt_replace_na.Rd b/man/dt_replace_na.Rd deleted file mode 100644 index 64d7c13..0000000 --- a/man/dt_replace_na.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/datatable_functions.R -\name{dt_replace_na} -\alias{dt_replace_na} -\title{NA replacement - datatable custom JS} -\usage{ -dt_replace_na(col_index, na_replacement) -} -\arguments{ -\item{col_index}{target columns index} - -\item{na_replacement}{text to replace NA} -} -\description{ -NA replacement - datatable custom JS -} diff --git a/man/generate_data_flow_manifest_skeleton.Rd b/man/generate_data_flow_manifest_skeleton.Rd deleted file mode 100644 index 7796b74..0000000 --- a/man/generate_data_flow_manifest_skeleton.Rd +++ /dev/null @@ -1,27 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/manifest.R -\name{generate_data_flow_manifest_skeleton} -\alias{generate_data_flow_manifest_skeleton} -\title{Generate a data flow status manifest skeleton. Fills in the component, contributor, data type, number of items, and dataset name columns.} -\usage{ -generate_data_flow_manifest_skeleton( - asset_view, - input_token, - calc_num_items, - base_url = "https://schematic-dev.api.sagebionetworks.org" -) -} -\arguments{ -\item{asset_view}{ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml)} - -\item{calc_num_items}{TRUE/FALSE. Calculate the number of items in each manifest.} - -\item{base_url}{Base URL of schematic API} - -\item{storage_project_list}{List output from `storage_projects` schematic endpoint} - -\item{dataset_id}{Synapse ID of existing manifest} -} -\description{ -Generate a data flow status manifest skeleton. Fills in the component, contributor, data type, number of items, and dataset name columns. -} diff --git a/man/get_all_manifests.Rd b/man/get_all_manifests.Rd deleted file mode 100644 index d349076..0000000 --- a/man/get_all_manifests.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/api_wrappers.R -\name{get_all_manifests} -\alias{get_all_manifests} -\title{Call `storage/project/manifests` Schematic endpoint for a given asset_view} -\usage{ -get_all_manifests( - asset_view, - input_token, - base_url = "https://schematic-dev.api.sagebionetworks.org", - verbose = FALSE -) -} -\arguments{ -\item{asset_view}{ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml)} - -\item{input_token}{Synapse PAT} - -\item{base_url}{Base URL of schematic API} - -\item{verbose}{T/F for console messages} -} -\description{ -Call `storage/project/manifests` Schematic endpoint for a given asset_view -} diff --git a/man/get_colname_by_type.Rd b/man/get_colname_by_type.Rd deleted file mode 100644 index 1dddc1b..0000000 --- a/man/get_colname_by_type.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/parse_config.R -\name{get_colname_by_type} -\alias{get_colname_by_type} -\title{Parse config to get columns types} -\usage{ -get_colname_by_type(type = c("icon", "drop_down_fliter"), config) -} -\arguments{ -\item{type}{column type as described in datatable_dashboard_config.json} - -\item{config}{datatable_dashboard_config.json as a datatable (`jsonlite::read_json("inst/datatable_dashboard_config.json")`)} -} -\description{ -Parse config to get columns types -} diff --git a/man/get_na_replace_colnames.Rd b/man/get_na_replace_colnames.Rd deleted file mode 100644 index fc33f4a..0000000 --- a/man/get_na_replace_colnames.Rd +++ /dev/null @@ -1,14 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/parse_config.R -\name{get_na_replace_colnames} -\alias{get_na_replace_colnames} -\title{Parse config to get columns with na_replace specified} -\usage{ -get_na_replace_colnames(config) -} -\arguments{ -\item{config}{datatable_dashboard_config.json as a datatable (`jsonlite::read_json("inst/datatable_dashboard_config.json")`)} -} -\description{ -Parse config to get columns with na_replace specified -} diff --git a/man/get_na_replace_defs.Rd b/man/get_na_replace_defs.Rd deleted file mode 100644 index 204c444..0000000 --- a/man/get_na_replace_defs.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/parse_config.R -\name{get_na_replace_defs} -\alias{get_na_replace_defs} -\title{Parse config to get na replacement definitions with custom javascript. Outputs a list.} -\usage{ -get_na_replace_defs(prepped_dataframe, config) -} -\arguments{ -\item{prepped_dataframe}{dataframe output by `prep_df_for_dash()`} - -\item{config}{datatable_dashboard_config.json as a datatable (`jsonlite::read_json("inst/datatable_dashboard_config.json")`)} -} -\description{ -Parse config to get na replacement definitions with custom javascript. Outputs a list. -} diff --git a/man/get_renamed_colnames.Rd b/man/get_renamed_colnames.Rd deleted file mode 100644 index e7afd01..0000000 --- a/man/get_renamed_colnames.Rd +++ /dev/null @@ -1,14 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/parse_config.R -\name{get_renamed_colnames} -\alias{get_renamed_colnames} -\title{Parse config to get display column names for dashboard} -\usage{ -get_renamed_colnames(config) -} -\arguments{ -\item{config}{datatable_dashboard_config.json as a datatable (`jsonlite::read_json("inst/datatable_dashboard_config.json")`)} -} -\description{ -Parse config to get display column names for dashboard -} diff --git a/man/list_to_dataframe.Rd b/man/list_to_dataframe.Rd deleted file mode 100644 index a620756..0000000 --- a/man/list_to_dataframe.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utility.R -\name{list_to_dataframe} -\alias{list_to_dataframe} -\title{Convert a list to a dataframe} -\usage{ -list_to_dataframe(list, col_names = NULL) -} -\arguments{ -\item{list}{A list of items. Only works where list entries all follow the same pattern.} - -\item{col_names}{Desired column names. Ex: `c("id", "name")`} -} -\description{ -Convert a list to a dataframe -} diff --git a/man/manifest_download.Rd b/man/manifest_download.Rd deleted file mode 100644 index 643bc67..0000000 --- a/man/manifest_download.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/schematic_rest_api.R -\name{manifest_download} -\alias{manifest_download} -\title{Download a manifest} -\usage{ -manifest_download( - asset_view, - dataset_id, - input_token, - base_url = "https://schematic-dev.api.sagebionetworks.org" -) -} -\arguments{ -\item{asset_view}{ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml)} - -\item{dataset_id}{Synapse ID of existing manifest} - -\item{input_token}{Synapse login cookie, PAT, or API key.} - -\item{base_url}{URL to schematic API endpoint} -} -\description{ -Download a manifest -} diff --git a/man/model_submit.Rd b/man/model_submit.Rd deleted file mode 100644 index 959c1ad..0000000 --- a/man/model_submit.Rd +++ /dev/null @@ -1,45 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/schematic_rest_api.R -\name{model_submit} -\alias{model_submit} -\title{schematic rest api to submit metadata} -\usage{ -model_submit( - data_type = NULL, - asset_view, - dataset_id, - file_name, - input_token, - restrict_rules = TRUE, - manifest_record_type = "table_and_file", - base_url = "https://schematic-dev.api.sagebionetworks.org", - schema_url = - "https://raw.githubusercontent.com/Sage-Bionetworks/data_flow/main/inst/data_flow_component.jsonld", - use_schema_label = TRUE -) -} -\arguments{ -\item{data_type}{Type of dataset. Set to None for no validation check} - -\item{asset_view}{ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml)} - -\item{dataset_id}{Synapse ID of existing manifest} - -\item{file_name}{Filepath of csv to validate} - -\item{input_token}{Synapse login cookie, PAT, or API key} - -\item{restrict_rules}{If True, validation suite will only run with in-house validation rule. If False, the Great Expectations suite will be utilized and all rules will be available.} - -\item{manifest_record_type}{Manifest storage type. Options: "--", "table" (default), "entity", "both".} - -\item{base_url}{URL to schematic API endpoint} - -\item{schema_url}{URL to a schema jsonld} -} -\value{ -TRUE if successful upload or validate errors if not. -} -\description{ -schematic rest api to submit metadata -} diff --git a/man/pipe.Rd b/man/pipe.Rd deleted file mode 100644 index 1f8f237..0000000 --- a/man/pipe.Rd +++ /dev/null @@ -1,20 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utils-pipe.R -\name{\%>\%} -\alias{\%>\%} -\title{Pipe operator} -\usage{ -lhs \%>\% rhs -} -\arguments{ -\item{lhs}{A value or the magrittr placeholder.} - -\item{rhs}{A function call using the magrittr semantics.} -} -\value{ -The result of calling `rhs(lhs)`. -} -\description{ -See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details. -} -\keyword{internal} diff --git a/man/prep_manifest_dash.Rd b/man/prep_manifest_dash.Rd deleted file mode 100644 index ddeb0b6..0000000 --- a/man/prep_manifest_dash.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/datatable_functions.R -\name{prep_manifest_dash} -\alias{prep_manifest_dash} -\title{Prepare a dataframe for a dashboard style datatable} -\usage{ -prep_manifest_dash(df, past_due_col, config) -} -\arguments{ -\item{df}{A dataframe with the columns `Contributor`, `Dataset_Name`, `Dataset_Type`, `Num_Items`, `Release_Scheduled`, `Embargo`, `Standard_Compliance`, `QC_Compliance`,`PHI_Detection_Compliance`, `Access_Controls_Compliance`, `Data_Portal`, `Released`, `past_due`} - -\item{config}{Config for datatable dashboard module in `inst/datatable_dashboard_config.json`} -} -\description{ -Prepare a dataframe for a dashboard style datatable -} diff --git a/man/prep_manifest_dfa.Rd b/man/prep_manifest_dfa.Rd deleted file mode 100644 index ecf9ac2..0000000 --- a/man/prep_manifest_dfa.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/manifest.R -\name{prep_manifest_dfa} -\alias{prep_manifest_dfa} -\title{Prepare a dataframe that has been downloaded from Synapse for the Data Flow App} -\usage{ -prep_manifest_dfa(manifest, config) -} -\arguments{ -\item{manifest}{A manifest that has been downloaded from using manifest_download_to_df()} - -\item{config}{`datatable_dashboard_config.json` read in as a dataframe} -} -\description{ -Prepare a dataframe that has been downloaded from Synapse for the Data Flow App -} diff --git a/man/prep_manifest_submit.Rd b/man/prep_manifest_submit.Rd deleted file mode 100644 index 8b936c1..0000000 --- a/man/prep_manifest_submit.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/manifest.R -\name{prep_manifest_submit} -\alias{prep_manifest_submit} -\title{Prepare a dataframe for Synapse submission} -\usage{ -prep_manifest_submit(manifest, config) -} -\arguments{ -\item{manifest}{A manifest that has been downloaded from using manifest_download_to_df()} - -\item{config}{`datatable_dashboard_config.json` read in as a dataframe} -} -\description{ -Prepare a dataframe for Synapse submission -} diff --git a/man/rearrange_dataframe.Rd b/man/rearrange_dataframe.Rd deleted file mode 100644 index eaa49fe..0000000 --- a/man/rearrange_dataframe.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utility.R -\name{rearrange_dataframe} -\alias{rearrange_dataframe} -\title{Rearrange a dataframe. Expected columns are ordered to match `expected_col_names` and moved to the front of the dataframe. Unexpected columns are moved to the back of the dataframe.} -\usage{ -rearrange_dataframe(df, expected_col_names) -} -\arguments{ -\item{df}{a dataframe} - -\item{expected_col_names}{a vector of expected column names in the order you would like them to appear.} -} -\description{ -Rearrange a dataframe. Expected columns are ordered to match `expected_col_names` and moved to the front of the dataframe. Unexpected columns are moved to the back of the dataframe. -} diff --git a/man/storage_project_datasets.Rd b/man/storage_project_datasets.Rd deleted file mode 100644 index e42b87b..0000000 --- a/man/storage_project_datasets.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/schematic_rest_api.R -\name{storage_project_datasets} -\alias{storage_project_datasets} -\title{Gets all datasets in folder under a given storage project that the current user has access to.} -\usage{ -storage_project_datasets( - asset_view, - project_id, - input_token, - base_url = "https://schematic-dev.api.sagebionetworks.org" -) -} -\arguments{ -\item{asset_view}{synapse ID of master file view.} - -\item{project_id}{synapse ID of a storage project.} - -\item{input_token}{synapse PAT} - -\item{base_url}{URL to schematic API endpoint} -} -\description{ -Gets all datasets in folder under a given storage project that the current user has access to. -} diff --git a/man/storage_project_manifests.Rd b/man/storage_project_manifests.Rd deleted file mode 100644 index 998ee53..0000000 --- a/man/storage_project_manifests.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/schematic_rest_api.R -\name{storage_project_manifests} -\alias{storage_project_manifests} -\title{/storage/project/manifests} -\usage{ -storage_project_manifests( - asset_view, - project_id, - input_token, - base_url = "https://schematic-dev.api.sagebionetworks.org" -) -} -\arguments{ -\item{asset_view}{synapse ID of master file view.} - -\item{input_token}{synapse PAT} - -\item{base_url}{URL to schematic API endpoint} - -\item{dataset_id}{synapse ID of a storage dataset.} -} -\description{ -/storage/project/manifests -} diff --git a/man/storage_projects.Rd b/man/storage_projects.Rd deleted file mode 100644 index 7cd6ff5..0000000 --- a/man/storage_projects.Rd +++ /dev/null @@ -1,22 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/schematic_rest_api.R -\name{storage_projects} -\alias{storage_projects} -\title{Get all storage projects the current user has access to} -\usage{ -storage_projects( - asset_view, - input_token, - base_url = "https://schematic-dev.api.sagebionetworks.org" -) -} -\arguments{ -\item{asset_view}{synapse ID of master file view.} - -\item{input_token}{synapse PAT} - -\item{base_url}{URL to schematic API endpoint} -} -\description{ -Get all storage projects the current user has access to -} diff --git a/man/style_dashboard.Rd b/man/style_dashboard.Rd deleted file mode 100644 index 9ba6b24..0000000 --- a/man/style_dashboard.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/datatable_functions.R -\name{style_dashboard} -\alias{style_dashboard} -\title{Add custom styling to dashboard based on contents of config} -\usage{ -style_dashboard(prepped_manifest, config) -} -\arguments{ -\item{prepped_manifest}{A manifest prepped with `prep_manifest_dash()`} - -\item{config}{`inst/datatable_dashboard_config.json`} -} -\description{ -Add custom styling to dashboard based on contents of config -} diff --git a/man/true_false_icon.Rd b/man/true_false_icon.Rd deleted file mode 100644 index 17e3c7f..0000000 --- a/man/true_false_icon.Rd +++ /dev/null @@ -1,14 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utility.R -\name{true_false_icon} -\alias{true_false_icon} -\title{Convert a vector of TRUE/FALSE to icon html} -\usage{ -true_false_icon(vec) -} -\arguments{ -\item{vec}{A vector of TRUE/FALSE} -} -\description{ -Convert a vector of TRUE/FALSE to icon html -} diff --git a/man/update_data_flow_manifest.Rd b/man/update_data_flow_manifest.Rd deleted file mode 100644 index 346a785..0000000 --- a/man/update_data_flow_manifest.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/manifest.R -\name{update_data_flow_manifest} -\alias{update_data_flow_manifest} -\title{Check synapse for updates to data flow status manifest} -\usage{ -update_data_flow_manifest( - asset_view, - manifest_dataset_id, - input_token, - base_url -) -} -\arguments{ -\item{asset_view}{ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml)} - -\item{manifest_dataset_id}{Dataset ID for data flow status manifest to be updated} - -\item{input_token}{Synapse PAT} - -\item{base_url}{Base URL of schematic API (Defaults to AWS version)} -} -\description{ -Check synapse for updates to data flow status manifest -} diff --git a/man/update_dfs_manifest.Rd b/man/update_dfs_manifest.Rd deleted file mode 100644 index ef23f5a..0000000 --- a/man/update_dfs_manifest.Rd +++ /dev/null @@ -1,18 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/manifest.R -\name{update_dfs_manifest} -\alias{update_dfs_manifest} -\title{Convert a list to a dataframe} -\usage{ -update_dfs_manifest(dfs_manifest, dfs_updates, selected_datasets_df) -} -\arguments{ -\item{dfs_updates}{Output from mod_update_data_flow_status.R} - -\item{selected_datasets_df}{Output from mod_dataset_selection.R} - -\item{dfs_status_manifest}{A data flow status manifest} -} -\description{ -Convert a list to a dataframe -} From 283f6e8907d69f3f6654c01939a75773bcbab27f Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Thu, 20 Apr 2023 13:44:00 -0700 Subject: [PATCH 07/38] remove dfamodules tests --- tests/testthat/test-datatable.R | 15 ---- tests/testthat/test-manifest.R | 129 ---------------------------- tests/testthat/test-parse_config.R | 46 ---------- tests/testthat/test-schematic-api.R | 80 ----------------- tests/testthat/test-utility.R | 59 ------------- 5 files changed, 329 deletions(-) delete mode 100644 tests/testthat/test-datatable.R delete mode 100644 tests/testthat/test-manifest.R delete mode 100644 tests/testthat/test-parse_config.R delete mode 100644 tests/testthat/test-schematic-api.R delete mode 100644 tests/testthat/test-utility.R diff --git a/tests/testthat/test-datatable.R b/tests/testthat/test-datatable.R deleted file mode 100644 index e2e4066..0000000 --- a/tests/testthat/test-datatable.R +++ /dev/null @@ -1,15 +0,0 @@ -test_that("dt_replace_na", { - - expected_output <- list(targets = 1, - render = DT::JS( - "function(data, type, row, meta) {", - "return data === null ? 'Not Applicable' : data;", - "}" - )) - - expect_equal(dt_replace_na(col_index = 1, - na_replacement = "Not Applicable"), - expected_output) -}) - -# FIXME how to test DT::datatable output? \ No newline at end of file diff --git a/tests/testthat/test-manifest.R b/tests/testthat/test-manifest.R deleted file mode 100644 index e344bf1..0000000 --- a/tests/testthat/test-manifest.R +++ /dev/null @@ -1,129 +0,0 @@ -# CREATE TESTING VARIABLES - -base_url <- base_url <- Sys.getenv("SCHEMATIC_BASE_URL_AWS") -input_token <- Sys.getenv("SYNAPSE_PAT") -asset_view <- "syn50896957" - -# mock synapse / submission ready manifest -manifest_synapse <- data.frame(Component = "DataFlow", - contributor = "FAIR demo data", - entityId = "syn123", - dataset_name = "biospecimen", - dataset = "Biospecimen", - num_items = "1", - release_scheduled = "2050-01-01", - embargo = "Not Applicable", - standard_compliance = FALSE, - data_portal = FALSE, - released = FALSE) - -# mock dfa ready manifest -manifest_dfa <- data.frame(Component = "DataFlow", - contributor = as.factor("FAIR demo data"), - entityId = "syn123", - dataset_name = "biospecimen", - dataset = as.factor("Biospecimen"), - num_items = 1, - release_scheduled = as.Date("2050-01-01"), - embargo = as.Date(NA), - standard_compliance = FALSE, - data_portal = FALSE, - released = FALSE) - -# mock get_all_manifests output -get_all_manifests_same <- manifest_synapse[,c("Component", "contributor", "entityId", "dataset_name", "dataset")] - -# read in test config -config <- jsonlite::read_json("../../inst/testing/datatable_dashboard_config.json") - -# TESTS - -test_that("prep_manifest_dfa modifies manifest in expected way", { - expect_equal(prep_manifest_dfa(manifest_synapse, config), - manifest_dfa) -}) - -test_that("prep_manifest_submit modifies manifest in expected way", { - expect_equal(prep_manifest_submit(manifest_dfa, config), - manifest_synapse) -}) - -test_that("update_manifest_add_datasets adds new datasets to manifest", { - - # add a dataset - get_all_manifests_add_dataset <- rbind(get_all_manifests_same, - data.frame(Component = "DataFlow", - contributor = "FAIR demo data", - entityId = "syn44539618", - dataset_name = "MockComponent", - dataset = "Patient")) - - manifest <- update_manifest_add_datasets(dataflow_manifest = manifest_synapse, - get_all_manifests_out = get_all_manifests_add_dataset, - asset_view = asset_view, - input_token = input_token, - base_url = base_url) - - expect_equal(get_all_manifests_add_dataset$entityId, manifest$entityId) -}) - -test_that("update_manifest_remove_datasets removes datasets from manifest", { - - # remove a dataset - get_all_manifests_remove_dataset <- get_all_manifests_same[-2, ] - - manifest <- update_manifest_remove_datasets(dataflow_manifest = manifest_synapse, - get_all_manifests_out = get_all_manifests_remove_dataset, - asset_view = asset_view, - input_token = input_token, - base_url = base_url) - - expect_equal(get_all_manifests_remove_dataset$entityId, manifest$entityId) -}) - -test_that("update_manifest_column updates items in a selected column", { - - # change the dataset_name column - get_all_manifests_change_dataset_name <- get_all_manifests_same - get_all_manifests_change_dataset_name$dataset_name[1] <- "new_dataset_name" - - manifest <- update_manifest_column(dataflow_manifest = manifest_synapse, - get_all_manifests_out = get_all_manifests_change_dataset_name, - update_column = "dataset_name", - asset_view = asset_view, - recalc_num_items = FALSE, - input_token = input_token, - base_url = base_url) - - expect_equal(manifest$dataset_name, "new_dataset_name") -}) - -# FIXME: FIX THIS TEST -# test_that("update_dfs_manifest", { -# -# dfs_updates <- list(release_scheduled = as.Date("2022-01-01"), -# embargo = as.Date("2022-01-01"), -# standard_compliance = TRUE, -# data_portal = TRUE, -# released = TRUE) -# -# selected_datasets_df <- data.frame(id = c("syn123"), name = "biospecimen") -# -# expected_updated_row <- data.frame(Component = "DataFlow", -# contributor = as.factor("FAIR demo data"), -# entityId = "syn123", -# dataset_name = "biospecimen", -# dataset = as.factor("Biospecimen"), -# num_items = as.numeric(NA), -# release_scheduled = as.Date("2022-01-01"), -# embargo = as.Date("2022-01-01"), -# standard_compliance = TRUE, -# data_portal = TRUE, -# released = TRUE) -# expected_df <- rbind(expected_updated_row, manifest_dfa[-1,]) -# -# expect_equal(update_dfs_manifest(dfs_manifest = manifest_dfa, -# dfs_updates = dfs_updates, -# selected_datasets_df = selected_datasets_df), -# expected_df) -# }) diff --git a/tests/testthat/test-parse_config.R b/tests/testthat/test-parse_config.R deleted file mode 100644 index bc3dd82..0000000 --- a/tests/testthat/test-parse_config.R +++ /dev/null @@ -1,46 +0,0 @@ -test_that("get_colname_by_type", { - tst_json <- '{"contributor": {"type": "type_1"}, "release_scheduled": {"type": "type_2"}, "entityId": {"type": "type_3"}}' - - expected_output <- c("contributor", "entityId") - - expect_equal(c(get_colname_by_type(type = "type_1", config = jsonlite::fromJSON(tst_json)), - get_colname_by_type(type = "type_3", config = jsonlite::fromJSON(tst_json))), - expected_output) -}) - -test_that("get_renamed_colnames", { - tst_json <- '{"contributor": {"col_name": "Contributor"}, "release_scheduled": {"col_name": "RELEASE DATE"}, "entityId": {"col_name": "Synapse ID"}}' - - expected_output <- c("Contributor", "RELEASE DATE", "Synapse ID") - - expect_equal(get_renamed_colnames(config = jsonlite::fromJSON(tst_json)), - expected_output) -}) - -test_that("get_na_replace_colnames", { - tst_json <- '{"contributor": {"na_replace": "Unknown"}, "release_scheduled": {"type": "type_1"}, "entityId": {"na_replace": "NO ID"}}' - - expected_output <- c("contributor", "entityId") - - expect_equal(get_na_replace_colnames(config = jsonlite::fromJSON(tst_json)), - expected_output) -}) - -test_that("get_na_replace_defs", { - tst_json <- '{"contributor": {"na_replace": "Unknown"}, "release_scheduled": {"type": "type_1"}}' - tst_manifest <- data.frame(contributor = c("Center A", NA, "Center B"), - entityId = c("syn123", "syn987", NA), - release_scheduled = c(as.Date("2050-01-01"), as.Date("2050-01-01"), NA)) - - - expected_output <- list(list(targets = 1, - render = DT::JS( - "function(data, type, row, meta) {", - "return data === null ? 'Unknown' : data;", - "}" - ))) - - expect_equal(get_na_replace_defs(prepped_dataframe = tst_manifest, - config = jsonlite::fromJSON(tst_json)), - expected_output) -}) \ No newline at end of file diff --git a/tests/testthat/test-schematic-api.R b/tests/testthat/test-schematic-api.R deleted file mode 100644 index b295c24..0000000 --- a/tests/testthat/test-schematic-api.R +++ /dev/null @@ -1,80 +0,0 @@ -# adapted from afwillia's work on data_curator -# (https://github.com/Sage-Bionetworks/data_curator/blob/schematic-rest-api/tests/testthat/test_schematic_rest_api.R) - -# VARIABLES ############################################################################# -# FAIR DEMO DATA PROJECT A -asset_view <- "syn50896957" # FAIR Demo All Projects, Files and Folders -project_id <- "syn50896931" # FAIR Demo Project A -dataset_id <- "syn51219090" # DataFlowStatusDFATesting -input_token <- Sys.getenv("SYNAPSE_PAT") -base_url <- Sys.getenv("SCHEMATIC_BASE_URL_AWS") -testing_manifest_path <- "../../inst/testing/synapse_storage_manifest_dataflow.csv" -schema_url <- "https://raw.githubusercontent.com/Sage-Bionetworks/data_flow/main/inst/data_flow_component.jsonld" - -# TEST API ############################################################################## - -test_that("storage_projects successfully returns a schematic_api object", { - res <- try(storage_projects(asset_view = asset_view, - input_token = input_token), - silent = FALSE) - - expect_true(class(res) == "schematic_api") -}) - -test_that("storage_project_datasets successfully returns a schematic_api object", { - res <- try(storage_project_datasets(asset_view = asset_view, - project_id = project_id, - input_token = input_token, - base_url = base_url), - silent = FALSE) - - expect_true(class(res) == "schematic_api") -}) - -test_that("manifest_download successfully returns a schematic_api object", { - res <- try(manifest_download(input_token = input_token, - asset_view = asset_view, - dataset_id = dataset_id, - base_url = base_url), - silent = FALSE) - - expect_true(class(res) == "schematic_api") - -}) - -test_that("model_submit successfully returns a schematic_api object", { - res <- try(model_submit(data_type = NULL, - asset_view = asset_view, - dataset_id = dataset_id, - file_name = testing_manifest_path, - input_token = input_token, - restrict_rules = TRUE, - manifest_record_type = "table_and_file", - base_url = base_url, - schema_url = schema_url, - use_schema_label = TRUE), - silent = FALSE) - - expect_true(class(res) == "schematic_api") -}) - -test_that("storage_project_manifests successfully returns a schematic_api object", { - res <- try(storage_project_manifests(asset_view, - project_id, - input_token, - base_url), - silent = FALSE) - - expect_true(class(res) == "schematic_api") - -}) - -test_that("visualize/component successfully returns a schematic_api object", { - res <- try(visualize_component(schema_url = schema_url, - component = "DataFlow", - base_url = base_url), - silent = FALSE) - - expect_true(class(res) == "schematic_api") - -}) diff --git a/tests/testthat/test-utility.R b/tests/testthat/test-utility.R deleted file mode 100644 index 2d07be4..0000000 --- a/tests/testthat/test-utility.R +++ /dev/null @@ -1,59 +0,0 @@ -test_that("list_to_dataframe", { - mock_storage_projects_output <- list(list("syn123", "project 1"), - list("syn345", "project 2")) - - expected_output <- data.frame(X1 = c("syn123", "syn345"), - X2 = c("project 1", "project 2")) - - expect_equal(list_to_dataframe(mock_storage_projects_output), - expected_output) -}) - -test_that("convert_column_type", { - testing_df <- data.frame(int = "1", factor = "dog", logic = "TRUE", char = 1, date = "2020-01-01") - - testing_df <- convert_column_type(df = testing_df, - col_names = "factor", - type = "factor") - - testing_df <- convert_column_type(df = testing_df, - col_names = "int", - type = "integer") - - testing_df <- convert_column_type(df = testing_df, - col_names = "date", - type = "date") - - testing_df <- convert_column_type(df = testing_df, - col_names = "char", - type = "character") - - testing_df <- convert_column_type(df = testing_df, - col_names = "logic", - type = "logical") - - expected_output <- data.frame(int = as.integer(1), factor = as.factor("dog"), logic = TRUE, char = "1", date = as.Date("2020-01-01")) - - expect_identical(testing_df, - expected_output) -}) - -test_that("true_false_icon", { - testing_vec <- c("TRUE", "FALSE") - - expected_output <- c(as.character(icon("check", lib = "font-awesome")), as.character(icon("times", lib = "font-awesome"))) - - expect_equal(true_false_icon(testing_vec), - expected_output) -}) - -test_that("rearrange_dataframe", { - testing_df <- data.frame(a = c(1,2,3), b = c(1,2,3), c = c(1,2,3), d = c(1,2,3)) - - expected_output <- data.frame(b = c(1,2,3), a = c(1,2,3), d = c(1,2,3), c = c(1,2,3)) - - - expect_equal(rearrange_dataframe(testing_df, - expected_col_names = c("b", "a", "d")), - expected_output) -}) \ No newline at end of file From a8924759a5bca13d0cde9301aad99dba466538b6 Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Thu, 20 Apr 2023 15:38:55 -0700 Subject: [PATCH 08/38] add dfamodules, update renv snapshot --- DESCRIPTION | 1 + renv.lock | 483 ++++++++++++++-------------------------------------- 2 files changed, 126 insertions(+), 358 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5dfdb9f..1f103ac 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -8,6 +8,7 @@ Imports: attempt, config (>= 0.3.1), dcamodules, + dfamodules, dplyr, DT, ggplot2, diff --git a/renv.lock b/renv.lock index 35f9d73..75f20a8 100644 --- a/renv.lock +++ b/renv.lock @@ -11,10 +11,10 @@ "Packages": { "DT": { "Package": "DT", - "Version": "0.26", + "Version": "0.27", "Source": "Repository", "Repository": "CRAN", - "Hash": "c66a72c4d3499e14ae179ccb742e740a", + "Hash": "3444e6ed78763f9f13aaa39f2481eb34", "Requirements": [ "crosstalk", "htmltools", @@ -61,18 +61,18 @@ }, "Rcpp": { "Package": "Rcpp", - "Version": "1.0.9", + "Version": "1.0.10", "Source": "Repository", "Repository": "CRAN", - "Hash": "e9c08b94391e9f3f97355841229124f2", + "Hash": "e749cae40fa9ef469b6050959517453c", "Requirements": [] }, "RcppTOML": { "Package": "RcppTOML", - "Version": "0.1.7", + "Version": "0.2.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "f8a578aa91321ecec1292f1e2ffadeda", + "Hash": "c232938949fcd8126034419cc529333a", "Requirements": [ "Rcpp" ] @@ -121,24 +121,6 @@ "Hash": "543776ae6848fde2f48ff3816d0628bc", "Requirements": [] }, - "bit": { - "Package": "bit", - "Version": "4.0.4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "f36715f14d94678eea9933af927bc15d", - "Requirements": [] - }, - "bit64": { - "Package": "bit64", - "Version": "4.0.5", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "9fe98599ca456d6552421db0d6772d8f", - "Requirements": [ - "bit" - ] - }, "brew": { "Package": "brew", "Version": "1.0-8", @@ -175,10 +157,10 @@ }, "cachem": { "Package": "cachem", - "Version": "1.0.6", + "Version": "1.0.7", "Source": "Repository", "Repository": "CRAN", - "Hash": "648c5b3d71e6a37e3043617489a0a0e9", + "Hash": "cda74447c42f529de601fe4d4050daef", "Requirements": [ "fastmap", "rlang" @@ -197,10 +179,10 @@ }, "cli": { "Package": "cli", - "Version": "3.5.0", + "Version": "3.6.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "eb9fc121ad9a1075c471107ef185be46", + "Hash": "89e6d8219950eac806ae0c489052048a", "Requirements": [] }, "clipr": { @@ -213,10 +195,10 @@ }, "colorspace": { "Package": "colorspace", - "Version": "2.0-3", + "Version": "2.1-0", "Source": "Repository", "Repository": "CRAN", - "Hash": "bb4341986bc8b914f0f0acf2e4a3f2f7", + "Hash": "f20c47fd52fae58b4e377c37bb8c335b", "Requirements": [] }, "colourpicker": { @@ -237,10 +219,10 @@ }, "commonmark": { "Package": "commonmark", - "Version": "1.8.1", + "Version": "1.9.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "b6e3e947d1d7ebf3d2bdcea1bde63fe7", + "Hash": "d691c61bff84bd63c383874d2d0c3307", "Requirements": [] }, "config": { @@ -298,18 +280,10 @@ }, "curl": { "Package": "curl", - "Version": "4.3.3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "0eb86baa62f06e8855258fa5a8048667", - "Requirements": [] - }, - "data.table": { - "Package": "data.table", - "Version": "1.14.2", + "Version": "5.0.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "36b67b5adf57b292923f5659f5f0c853", + "Hash": "e4f97056611e8e6b8b852d13b7400cf1", "Requirements": [] }, "dcamodules": { @@ -322,8 +296,8 @@ "RemoteRepo": "dcamodules", "RemoteUsername": "Sage-Bionetworks", "RemoteRef": "HEAD", - "RemoteSha": "3c7765f4b21ef898d1794fc3a58b356ba3721822", - "Hash": "a55df0a1785e77ba98d2800e1f4cf531", + "RemoteSha": "1e14dcfbdaa2913eeeacc12acaac1c8264bac1f7", + "Hash": "c27efc5d7a84072f43c242d6ffd13964", "Requirements": [ "base64enc", "colourpicker", @@ -380,6 +354,19 @@ "withr" ] }, + "dfamodules": { + "Package": "dfamodules", + "Version": "0.0.0.9000", + "Source": "GitHub", + "RemoteType": "github", + "RemoteHost": "api.github.com", + "RemoteUsername": "Sage-Bionetworks", + "RemoteRepo": "dfamodules", + "RemoteRef": "main", + "RemoteSha": "2a1ff254ae5ad2fce96c4bbcddef3abf43891131", + "Hash": "218f2e10ad7c6c01b17baa2af2361a17", + "Requirements": [] + }, "diffobj": { "Package": "diffobj", "Version": "0.3.5", @@ -419,12 +406,13 @@ }, "dplyr": { "Package": "dplyr", - "Version": "1.0.10", + "Version": "1.1.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "539412282059f7f0c07295723d23f987", + "Hash": "dea6970ff715ca541c387de363ff405e", "Requirements": [ "R6", + "cli", "generics", "glue", "lifecycle", @@ -448,10 +436,10 @@ }, "evaluate": { "Package": "evaluate", - "Version": "0.19", + "Version": "0.20", "Source": "Repository", "Repository": "CRAN", - "Hash": "5aac3cd0a3ccb1a738941796b28c26fe", + "Hash": "4b68aa51edd89a0e044a66e75ae3cc6c", "Requirements": [] }, "extrafont": { @@ -475,10 +463,10 @@ }, "fansi": { "Package": "fansi", - "Version": "1.0.3", + "Version": "1.0.4", "Source": "Repository", "Repository": "CRAN", - "Hash": "83a8afdbe71839506baa9f90eebad7ec", + "Hash": "1d9e7ad3c8312a192dea7d3db0274fde", "Requirements": [] }, "farver": { @@ -491,36 +479,23 @@ }, "fastmap": { "Package": "fastmap", - "Version": "1.1.0", + "Version": "1.1.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "77bd60a6157420d4ffa93b27cf6a58b8", + "Hash": "f7736a18de97dea803bde0a2daaafb27", "Requirements": [] }, "fontawesome": { "Package": "fontawesome", - "Version": "0.4.0", + "Version": "0.5.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "c5a628c2570aa86a96cc6ef739d8bfda", + "Hash": "1e22b8cabbad1eae951a75e9f8b52378", "Requirements": [ "htmltools", "rlang" ] }, - "forcats": { - "Package": "forcats", - "Version": "0.5.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "81c3244cab67468aac4c60550832655d", - "Requirements": [ - "ellipsis", - "magrittr", - "rlang", - "tibble" - ] - }, "fresh": { "Package": "fresh", "Version": "0.2.0", @@ -536,10 +511,10 @@ }, "fs": { "Package": "fs", - "Version": "1.5.2", + "Version": "1.6.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "7c89603d81793f0d5486d91ab1fc6f1d", + "Hash": "f4dcd23b67e33d851d2079f703e8b985", "Requirements": [] }, "generics": { @@ -567,10 +542,10 @@ }, "ggplot2": { "Package": "ggplot2", - "Version": "3.4.0", + "Version": "3.4.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "fd2aab12f54400c6bca43687231e246b", + "Hash": "3a147ee02e85a8941aad9909f1b43b7b", "Requirements": [ "MASS", "cli", @@ -588,16 +563,17 @@ }, "gh": { "Package": "gh", - "Version": "1.3.1", + "Version": "1.4.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "b6a12054ee13dce0f6696c019c10e539", + "Hash": "03533b1c875028233598f848fda44c4c", "Requirements": [ "cli", "gitcreds", - "httr", + "httr2", "ini", - "jsonlite" + "jsonlite", + "rlang" ] }, "gitcreds": { @@ -618,34 +594,32 @@ }, "golem": { "Package": "golem", - "Version": "0.3.5", + "Version": "0.4.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "c4fbd853653f38cccdd009d75abb344c", + "Hash": "4275a95781526a472cff3e39f957c8be", "Requirements": [ "attempt", - "cli", "config", - "crayon", - "desc", - "fs", "here", "htmltools", - "pkgload", - "roxygen2", - "rstudioapi", + "rlang", "shiny", - "usethis", "yaml" ] }, "gtable": { "Package": "gtable", - "Version": "0.3.1", + "Version": "0.3.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "36b4265fb818f6a342bed217549cd896", - "Requirements": [] + "Hash": "b44addadb528a0d227794121c00572a0", + "Requirements": [ + "cli", + "glue", + "lifecycle", + "rlang" + ] }, "here": { "Package": "here", @@ -667,26 +641,12 @@ "xfun" ] }, - "hms": { - "Package": "hms", - "Version": "1.1.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "5b8a2dd0fdbe2ab4f6081e6c7be6dfca", - "Requirements": [ - "ellipsis", - "lifecycle", - "pkgconfig", - "rlang", - "vctrs" - ] - }, "htmltools": { "Package": "htmltools", - "Version": "0.5.4", + "Version": "0.5.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "9d27e99cc90bd701c0a7a63e5923f9b7", + "Hash": "ba0240784ad50a62165058a27459304a", "Requirements": [ "base64enc", "digest", @@ -697,10 +657,10 @@ }, "htmlwidgets": { "Package": "htmlwidgets", - "Version": "1.6.0", + "Version": "1.6.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "f894e7b76e36258a483c602a786d7270", + "Hash": "a865aa85bcb2697f47505bfd70422471", "Requirements": [ "htmltools", "jsonlite", @@ -711,10 +671,10 @@ }, "httpuv": { "Package": "httpuv", - "Version": "1.6.7", + "Version": "1.6.9", "Source": "Repository", "Repository": "CRAN", - "Hash": "13fdc650c853fffbffee66b2a5b9fdbf", + "Hash": "1046aa31a57eae8b357267a56a0b6d8b", "Requirements": [ "R6", "Rcpp", @@ -736,6 +696,24 @@ "openssl" ] }, + "httr2": { + "Package": "httr2", + "Version": "0.2.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "5c09fe33064978ede54de42309c8b532", + "Requirements": [ + "R6", + "cli", + "curl", + "glue", + "magrittr", + "openssl", + "rappdirs", + "rlang", + "withr" + ] + }, "hunspell": { "Package": "hunspell", "Version": "3.0.1", @@ -781,39 +759,15 @@ "Hash": "a4269a09a9b865579b2635c77e572374", "Requirements": [] }, - "kableExtra": { - "Package": "kableExtra", - "Version": "1.3.4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "49b625e6aabe4c5f091f5850aba8ff78", - "Requirements": [ - "digest", - "glue", - "htmltools", - "knitr", - "magrittr", - "rmarkdown", - "rstudioapi", - "rvest", - "scales", - "stringr", - "svglite", - "viridisLite", - "webshot", - "xml2" - ] - }, "knitr": { "Package": "knitr", - "Version": "1.41", + "Version": "1.42", "Source": "Repository", "Repository": "CRAN", - "Hash": "6d4971f3610e75220534a1befe81bc92", + "Hash": "8329a9bcc82943c8069104d4be3ee22d", "Requirements": [ "evaluate", "highr", - "stringr", "xfun", "yaml" ] @@ -867,10 +821,10 @@ }, "lubridate": { "Package": "lubridate", - "Version": "1.9.0", + "Version": "1.9.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "2af4550c2f0f7fbe7cbbf3dbf4ea3902", + "Hash": "e25f18436e3efd42c7c590a1c4c15390", "Requirements": [ "generics", "timechange" @@ -976,10 +930,10 @@ }, "pillar": { "Package": "pillar", - "Version": "1.8.1", + "Version": "1.9.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "f2316df30902c81729ae9de95ad5a608", + "Hash": "15da5a8412f317beeee6175fbc76f4bb", "Requirements": [ "cli", "fansi", @@ -1061,36 +1015,6 @@ "withr" ] }, - "plotly": { - "Package": "plotly", - "Version": "4.10.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "3781cf6971c6467fa842a63725bbee9e", - "Requirements": [ - "RColorBrewer", - "base64enc", - "crosstalk", - "data.table", - "digest", - "dplyr", - "ggplot2", - "htmltools", - "htmlwidgets", - "httr", - "jsonlite", - "lazyeval", - "magrittr", - "promises", - "purrr", - "rlang", - "scales", - "tibble", - "tidyr", - "vctrs", - "viridisLite" - ] - }, "png": { "Package": "png", "Version": "0.1-8", @@ -1117,10 +1041,10 @@ }, "processx": { "Package": "processx", - "Version": "3.8.0", + "Version": "3.8.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "a33ee2d9bf07564efb888ad98410da84", + "Hash": "d75b4059d781336efba24021915902b4", "Requirements": [ "R6", "ps" @@ -1137,19 +1061,6 @@ "stringr" ] }, - "progress": { - "Package": "progress", - "Version": "1.2.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "14dc9f7a3c91ebb14ec5bb9208a07061", - "Requirements": [ - "R6", - "crayon", - "hms", - "prettyunits" - ] - }, "promises": { "Package": "promises", "Version": "1.2.0.1", @@ -1166,18 +1077,18 @@ }, "ps": { "Package": "ps", - "Version": "1.7.2", + "Version": "1.7.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "68dd03d98a5efd1eb3012436de45ba83", + "Hash": "709d852d33178db54b17c722e5b1e594", "Requirements": [] }, "purrr": { "Package": "purrr", - "Version": "1.0.0", + "Version": "1.0.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "1ad491d27989ec6c26a2918ad6df116b", + "Hash": "d71c815267c640f17ddbf7f16144b4bb", "Requirements": [ "cli", "lifecycle", @@ -1197,17 +1108,6 @@ "textshaping" ] }, - "ragg": { - "Package": "ragg", - "Version": "1.2.4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "0db17bd5a1d4abfec76487b6f5dd957b", - "Requirements": [ - "systemfonts", - "textshaping" - ] - }, "rappdirs": { "Package": "rappdirs", "Version": "0.3.3", @@ -1237,26 +1137,6 @@ "xopen" ] }, - "readr": { - "Package": "readr", - "Version": "2.1.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "9c59de1357dc209868b5feb5c9f0fe2f", - "Requirements": [ - "R6", - "cli", - "clipr", - "cpp11", - "crayon", - "hms", - "lifecycle", - "rlang", - "tibble", - "tzdb", - "vroom" - ] - }, "rematch": { "Package": "rematch", "Version": "1.0.1", @@ -1293,10 +1173,10 @@ }, "reticulate": { "Package": "reticulate", - "Version": "1.26", + "Version": "1.28", "Source": "Repository", "Repository": "CRAN", - "Hash": "91c176c84a2e3558572d2cbaddc08bd4", + "Hash": "86c441bf33e1d608db773cb94b848458", "Requirements": [ "Matrix", "Rcpp", @@ -1339,21 +1219,22 @@ }, "rlang": { "Package": "rlang", - "Version": "1.0.6", + "Version": "1.1.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "4ed1f8336c8d52c3e750adcdc57228a7", + "Hash": "dc079ccd156cde8647360f473c1fa718", "Requirements": [] }, "rmarkdown": { "Package": "rmarkdown", - "Version": "2.19", + "Version": "2.21", "Source": "Repository", "Repository": "CRAN", - "Hash": "4e29299e1f4c7eabb0b8365b338adf3c", + "Hash": "493df4ae51e2e984952ea4d5c75786a3", "Requirements": [ "bslib", "evaluate", + "fontawesome", "htmltools", "jquerylib", "jsonlite", @@ -1414,22 +1295,6 @@ "xml2" ] }, - "rvest": { - "Package": "rvest", - "Version": "1.0.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "bb099886deffecd6f9b298b7d4492943", - "Requirements": [ - "httr", - "lifecycle", - "magrittr", - "rlang", - "selectr", - "tibble", - "xml2" - ] - }, "sagethemes": { "Package": "sagethemes", "Version": "0.0.0.9003", @@ -1452,10 +1317,10 @@ }, "sass": { "Package": "sass", - "Version": "0.4.4", + "Version": "0.4.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "c76cbac7ca04ce82d8c38e29729987a3", + "Hash": "2bb4371a4c80115518261866eab6ab11", "Requirements": [ "R6", "fs", @@ -1481,17 +1346,6 @@ "viridisLite" ] }, - "selectr": { - "Package": "selectr", - "Version": "0.4-2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "3838071b66e0c566d55cc26bd6e27bf4", - "Requirements": [ - "R6", - "stringr" - ] - }, "sessioninfo": { "Package": "sessioninfo", "Version": "1.2.2", @@ -1572,10 +1426,10 @@ }, "sourcetools": { "Package": "sourcetools", - "Version": "0.1.7", + "Version": "0.1.7-1", "Source": "Repository", "Repository": "CRAN", - "Hash": "947e4e02a79effa5d512473e10f41797", + "Hash": "5f5a7629f956619d519205ec475fe647", "Requirements": [] }, "spelling": { @@ -1593,10 +1447,10 @@ }, "stringi": { "Package": "stringi", - "Version": "1.7.8", + "Version": "1.7.12", "Source": "Repository", "Repository": "CRAN", - "Hash": "a68b980681bcbc84c7a67003fa796bfb", + "Hash": "ca8bd84263c77310739d2cf64d84d7c9", "Requirements": [] }, "stringr": { @@ -1615,28 +1469,6 @@ "vctrs" ] }, - "svglite": { - "Package": "svglite", - "Version": "2.1.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "68dfdf211af6aa4e5f050f064f64d401", - "Requirements": [ - "cpp11", - "systemfonts" - ] - }, - "svglite": { - "Package": "svglite", - "Version": "2.1.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "68dfdf211af6aa4e5f050f064f64d401", - "Requirements": [ - "cpp11", - "systemfonts" - ] - }, "sys": { "Package": "sys", "Version": "3.4.1", @@ -1695,10 +1527,10 @@ }, "tibble": { "Package": "tibble", - "Version": "3.1.8", + "Version": "3.2.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "56b6934ef0f8c68225949a8672fe1a8f", + "Hash": "a84e2cc86d07289b3b6f5069df7a004c", "Requirements": [ "fansi", "lifecycle", @@ -1709,26 +1541,6 @@ "vctrs" ] }, - "tidyr": { - "Package": "tidyr", - "Version": "1.2.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "d8b95b7fee945d7da6888cf7eb71a49c", - "Requirements": [ - "cpp11", - "dplyr", - "ellipsis", - "glue", - "lifecycle", - "magrittr", - "purrr", - "rlang", - "tibble", - "tidyselect", - "vctrs" - ] - }, "tidyselect": { "Package": "tidyselect", "Version": "1.2.0", @@ -1746,34 +1558,24 @@ }, "timechange": { "Package": "timechange", - "Version": "0.1.1", + "Version": "0.2.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "4657195cc632097bb8d140d626b519fb", + "Hash": "8548b44f79a35ba1791308b61e6012d7", "Requirements": [ "cpp11" ] }, "tinytex": { "Package": "tinytex", - "Version": "0.43", + "Version": "0.45", "Source": "Repository", "Repository": "CRAN", - "Hash": "facc02f3d63ed7dd765513c004c394ce", + "Hash": "e4e357f28c2edff493936b6cb30c3d65", "Requirements": [ "xfun" ] }, - "tzdb": { - "Package": "tzdb", - "Version": "0.3.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "b2e1cbce7c903eaf23ec05c58e59fb5e", - "Requirements": [ - "cpp11" - ] - }, "urlchecker": { "Package": "urlchecker", "Version": "1.0.1", @@ -1816,10 +1618,10 @@ }, "utf8": { "Package": "utf8", - "Version": "1.2.2", + "Version": "1.2.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "c9c462b759a5cc844ae25b5942654d13", + "Hash": "1fe17157424bb09c48a8b3b550c753bc", "Requirements": [] }, "uuid": { @@ -1832,10 +1634,10 @@ }, "vctrs": { "Package": "vctrs", - "Version": "0.5.1", + "Version": "0.6.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "970324f6572b4fd81db507b5d4062cb0", + "Hash": "a745bda7aff4734c17294bb41d4e4607", "Requirements": [ "cli", "glue", @@ -1851,29 +1653,6 @@ "Hash": "62f4b5da3e08d8e5bcba6cac15603f70", "Requirements": [] }, - "vroom": { - "Package": "vroom", - "Version": "1.5.7", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "976507b5a105bc3bdf6a5a5f29e0684f", - "Requirements": [ - "bit64", - "cli", - "cpp11", - "crayon", - "glue", - "hms", - "lifecycle", - "progress", - "rlang", - "tibble", - "tidyselect", - "tzdb", - "vctrs", - "withr" - ] - }, "waiter": { "Package": "waiter", "Version": "0.2.5", @@ -1902,18 +1681,6 @@ "tibble" ] }, - "webshot": { - "Package": "webshot", - "Version": "0.5.4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "cfd9342c76693ae53108a474aafa1641", - "Requirements": [ - "callr", - "jsonlite", - "magrittr" - ] - }, "whisker": { "Package": "whisker", "Version": "0.4.1", @@ -1943,10 +1710,10 @@ }, "xfun": { "Package": "xfun", - "Version": "0.36", + "Version": "0.39", "Source": "Repository", "Repository": "CRAN", - "Hash": "f5baec54606751aa53ac9c0e05848ed6", + "Hash": "8f56e9acb54fb525e66464d57ab58bcb", "Requirements": [] }, "xml2": { @@ -1977,10 +1744,10 @@ }, "yaml": { "Package": "yaml", - "Version": "2.3.6", + "Version": "2.3.7", "Source": "Repository", "Repository": "CRAN", - "Hash": "9b570515751dcbae610f29885e025b41", + "Hash": "0d0056cc5383fbc240ccd0cb584bf436", "Requirements": [] }, "zip": { From cc27a585a30173321b8d21f79e0a0b0a49d0231f Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Fri, 21 Apr 2023 12:28:11 -0700 Subject: [PATCH 09/38] add dfamodules to depends --- DESCRIPTION | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1f103ac..40036fa 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -4,11 +4,12 @@ Version: 0.0.0.9000 Authors@R: person('L', 'Wolfe', email = 'loren.wolfe@sagebase.org', role = c('cre', 'aut')) Description: A data flow package. License: What license is it under? +Depends: + dfamodules Imports: attempt, config (>= 0.3.1), dcamodules, - dfamodules, dplyr, DT, ggplot2, From 67e354ddadc145fe707d3a00b91d64a0058d7d99 Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Fri, 21 Apr 2023 13:53:15 -0700 Subject: [PATCH 10/38] remove testing action, tests will be done in dfamodules repo --- .github/workflows/shinyapps_deploy.yml | 94 -------------------------- 1 file changed, 94 deletions(-) delete mode 100644 .github/workflows/shinyapps_deploy.yml diff --git a/.github/workflows/shinyapps_deploy.yml b/.github/workflows/shinyapps_deploy.yml deleted file mode 100644 index 814c400..0000000 --- a/.github/workflows/shinyapps_deploy.yml +++ /dev/null @@ -1,94 +0,0 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/master/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help - -name: shiny-deploy - -on: - # on push to branches labeled main and dev* or commits tagged as VYY.MM.n deploy - push: - branches: - - main - - dev* - tags: - - v[0-9]+.[0-9]+.[0-9]+ - - paths-ignore: - - '.github/ISSUE_TEMPLATE/**' - - '**/*.md' - - '**/.gitignore' - -jobs: - shiny-deploy: - runs-on: ubuntu-latest - # This image seems to be based on rocker/r-ver which in turn is based on debian - container: rocker/rstudio:4.1.2 - env: - # This should not be necessary for installing from public repo's however remotes::install_github() fails without it. - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - steps: - - name: Install System Dependencies - run: | - sudo apt-get update - sudo apt-get install -y pip python3.8-venv libcurl4-openssl-dev libpng-dev libfontconfig1-dev libharfbuzz-dev libfribidi-dev libtiff-dev libxml2-dev - # this action checks out the $GITHUB_WORKSPACE repository so that the workflow can access it - - uses: actions/checkout@v3 - # this action sets up pandoc - - uses: r-lib/actions/setup-pandoc@v2 - # this action activates renv - - uses: r-lib/actions/setup-renv@v2 - # Write synapse config (not sure if I even need this??) - - name: Set Configurations - shell: bash - run: | - echo "${{ secrets.SCHEMATIC_SYNAPSE_CONFIG }}" > .synapseConfig - # deploy app using rsconnect - - name: Authorize and deploy app - run: | - install.packages("rsconnect") - refName <- Sys.getenv("GITHUB_REF_NAME") - repo <- Sys.getenv("GITHUB_REPOSITORY") - appName <- strsplit(repo, "/")[[1]][2] - - # if tag is v*.*.*, deploy to prod, if main to staging, otherwise to test - if (grepl("v[0-9]+.[0-9]+.[0-9]+", refName)) { - message("Deploying release version of app") - } else if (refName == "main") { - appName <- paste(appName, "staging", sep = "-") - message("Deploying staging version of app") - } else { - appName <- paste(appName, "testing", sep = "-") - message("Deploying testing version of app") - } - - message(sprintf("Deploying to %s instance.", appName)) - - rsConnectUser <-"${{ secrets.RSCONNECT_USER }}" - rsConnectToken <- "${{ secrets.RSCONNECT_TOKEN }}" - rsConnectSecret <- "${{ secrets.RSCONNECT_SECRET }}" - - # create config file - config <- "client_id: ${{ secrets.OAUTH_CLIENT_ID }}" - config <- c(config, "client_secret: ${{ secrets.OAUTH_CLIENT_SECRET }}") - appUrl<- sprintf("https://%s.shinyapps.io/%s", rsConnectUser, appName) - config <- c(config, sprintf("app_url: %s", appUrl)) - - configFileConn<-file("oauth_config.yml") - tryCatch( - writeLines(config, configFileConn), - finally=close(configFileConn) - ) - # FIXME ADD size parameter - rsconnect::setAccountInfo(rsConnectUser, rsConnectToken, rsConnectSecret) - - # Get app names. If app exists, configure then deploy. Otherwise - # deploy then configure. - apps <- rsconnect::applications()$name - if (appName %in% apps) { - rsconnect::configureApp(appName = appName, size = "xxxlarge", logLevel = "verbose") - rsconnect::deployApp(appName = appName) - } else { - rsconnect::deployApp(appName = appName) - rsconnect::configureApp(appName = appName, size = "xxxlarge", logLevel = "verbose") - } - shell: Rscript {0} \ No newline at end of file From 39bcf36a6e901b997249fa209584f4b6b083a18c Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Fri, 21 Apr 2023 14:08:06 -0700 Subject: [PATCH 11/38] restore accidently deleted deployment workflow and remove testing workflow --- .github/workflows/devtools_tests.yml | 44 ------------ .github/workflows/shinyapps_deploy.yml | 94 ++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/devtools_tests.yml create mode 100644 .github/workflows/shinyapps_deploy.yml diff --git a/.github/workflows/devtools_tests.yml b/.github/workflows/devtools_tests.yml deleted file mode 100644 index 249f847..0000000 --- a/.github/workflows/devtools_tests.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Devtools Tests -on: [push] -jobs: - devtools-tests: - runs-on: ubuntu-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v3 - - - uses: r-lib/actions/setup-pandoc@v2 - - - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - - - uses: r-lib/actions/setup-renv@v2 - - - name: Create and Activate Python Virtual Environment - shell: bash - run: | - python3 -m venv .venv - chmod 755 .venv/bin/activate - source .venv/bin/activate - - - name: Create Oauth Config - shell: Rscript {0} - run: | - config <- "client_id: ${{ secrets.OAUTH_CLIENT_ID }}" - config <- c(config, "client_secret: ${{ secrets.OAUTH_CLIENT_SECRET }}") - appUrl<- "http://127.0.0.1:3978" - config <- c(config, sprintf("app_url: %s", appUrl)) - - configFileConn<-file("oauth_config.yml") - tryCatch( - writeLines(config, configFileConn), - finally=close(configFileConn) - ) - - - name: Run tests - shell: Rscript {0} - run: | - install.packages("devtools") - devtools::test() \ No newline at end of file diff --git a/.github/workflows/shinyapps_deploy.yml b/.github/workflows/shinyapps_deploy.yml new file mode 100644 index 0000000..814c400 --- /dev/null +++ b/.github/workflows/shinyapps_deploy.yml @@ -0,0 +1,94 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help + +name: shiny-deploy + +on: + # on push to branches labeled main and dev* or commits tagged as VYY.MM.n deploy + push: + branches: + - main + - dev* + tags: + - v[0-9]+.[0-9]+.[0-9]+ + + paths-ignore: + - '.github/ISSUE_TEMPLATE/**' + - '**/*.md' + - '**/.gitignore' + +jobs: + shiny-deploy: + runs-on: ubuntu-latest + # This image seems to be based on rocker/r-ver which in turn is based on debian + container: rocker/rstudio:4.1.2 + env: + # This should not be necessary for installing from public repo's however remotes::install_github() fails without it. + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - name: Install System Dependencies + run: | + sudo apt-get update + sudo apt-get install -y pip python3.8-venv libcurl4-openssl-dev libpng-dev libfontconfig1-dev libharfbuzz-dev libfribidi-dev libtiff-dev libxml2-dev + # this action checks out the $GITHUB_WORKSPACE repository so that the workflow can access it + - uses: actions/checkout@v3 + # this action sets up pandoc + - uses: r-lib/actions/setup-pandoc@v2 + # this action activates renv + - uses: r-lib/actions/setup-renv@v2 + # Write synapse config (not sure if I even need this??) + - name: Set Configurations + shell: bash + run: | + echo "${{ secrets.SCHEMATIC_SYNAPSE_CONFIG }}" > .synapseConfig + # deploy app using rsconnect + - name: Authorize and deploy app + run: | + install.packages("rsconnect") + refName <- Sys.getenv("GITHUB_REF_NAME") + repo <- Sys.getenv("GITHUB_REPOSITORY") + appName <- strsplit(repo, "/")[[1]][2] + + # if tag is v*.*.*, deploy to prod, if main to staging, otherwise to test + if (grepl("v[0-9]+.[0-9]+.[0-9]+", refName)) { + message("Deploying release version of app") + } else if (refName == "main") { + appName <- paste(appName, "staging", sep = "-") + message("Deploying staging version of app") + } else { + appName <- paste(appName, "testing", sep = "-") + message("Deploying testing version of app") + } + + message(sprintf("Deploying to %s instance.", appName)) + + rsConnectUser <-"${{ secrets.RSCONNECT_USER }}" + rsConnectToken <- "${{ secrets.RSCONNECT_TOKEN }}" + rsConnectSecret <- "${{ secrets.RSCONNECT_SECRET }}" + + # create config file + config <- "client_id: ${{ secrets.OAUTH_CLIENT_ID }}" + config <- c(config, "client_secret: ${{ secrets.OAUTH_CLIENT_SECRET }}") + appUrl<- sprintf("https://%s.shinyapps.io/%s", rsConnectUser, appName) + config <- c(config, sprintf("app_url: %s", appUrl)) + + configFileConn<-file("oauth_config.yml") + tryCatch( + writeLines(config, configFileConn), + finally=close(configFileConn) + ) + # FIXME ADD size parameter + rsconnect::setAccountInfo(rsConnectUser, rsConnectToken, rsConnectSecret) + + # Get app names. If app exists, configure then deploy. Otherwise + # deploy then configure. + apps <- rsconnect::applications()$name + if (appName %in% apps) { + rsconnect::configureApp(appName = appName, size = "xxxlarge", logLevel = "verbose") + rsconnect::deployApp(appName = appName) + } else { + rsconnect::deployApp(appName = appName) + rsconnect::configureApp(appName = appName, size = "xxxlarge", logLevel = "verbose") + } + shell: Rscript {0} \ No newline at end of file From 929910390849a3a4dbddd99fe4dd2a8748aa24cf Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Mon, 1 May 2023 10:35:26 -0700 Subject: [PATCH 12/38] move functions to dfamodules --- man/update_manifest_column.Rd | 34 -------------------------- man/update_manifest_remove_datasets.Rd | 28 --------------------- man/visualize_component.Rd | 22 ----------------- 3 files changed, 84 deletions(-) delete mode 100644 man/update_manifest_column.Rd delete mode 100644 man/update_manifest_remove_datasets.Rd delete mode 100644 man/visualize_component.Rd diff --git a/man/update_manifest_column.Rd b/man/update_manifest_column.Rd deleted file mode 100644 index b98f20c..0000000 --- a/man/update_manifest_column.Rd +++ /dev/null @@ -1,34 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/manifest.R -\name{update_manifest_column} -\alias{update_manifest_column} -\title{Update dataFlow manifest when dataset folder name changes} -\usage{ -update_manifest_column( - dataflow_manifest, - get_all_manifests_out, - update_column, - asset_view, - recalc_num_items = FALSE, - input_token, - base_url -) -} -\arguments{ -\item{dataflow_manifest}{A dataFlow manifest} - -\item{get_all_manifests_out}{The output of get_all_manifests. Also can be a dataframe that includes Component, contributor, entityId, dataset_name, and dataset.} - -\item{update_column}{Column name of the column to be updated} - -\item{asset_view}{ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml)} - -\item{recalc_num_items}{TRUE/FALSE if there is an item to be updated, should the manifest} - -\item{input_token}{Synapse PAT} - -\item{base_url}{Base URL of schematic API (Defaults to AWS version)} -} -\description{ -Update dataFlow manifest when dataset folder name changes -} diff --git a/man/update_manifest_remove_datasets.Rd b/man/update_manifest_remove_datasets.Rd deleted file mode 100644 index bafad7b..0000000 --- a/man/update_manifest_remove_datasets.Rd +++ /dev/null @@ -1,28 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/manifest.R -\name{update_manifest_remove_datasets} -\alias{update_manifest_remove_datasets} -\title{Remove datasets that are no longer found in Synapse} -\usage{ -update_manifest_remove_datasets( - dataflow_manifest, - get_all_manifests_out, - asset_view, - input_token, - base_url -) -} -\arguments{ -\item{dataflow_manifest}{A dataFlow manifest} - -\item{get_all_manifests_out}{The output of get_all_manifests. Also can be a dataframe that includes Component, contributor, entityId, dataset_name, and dataset.} - -\item{asset_view}{ID of view listing all project data assets. For example, for Synapse this would be the Synapse ID of the fileview listing all data assets for a given project.(i.e. master_fileview in config.yml)} - -\item{input_token}{Synapse PAT} - -\item{base_url}{Base URL of schematic API (Defaults to AWS version)} -} -\description{ -Remove datasets that are no longer found in Synapse -} diff --git a/man/visualize_component.Rd b/man/visualize_component.Rd deleted file mode 100644 index 3764765..0000000 --- a/man/visualize_component.Rd +++ /dev/null @@ -1,22 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/schematic_rest_api.R -\name{visualize_component} -\alias{visualize_component} -\title{Get all the attributes associated with a specific data model component formatted as a dataframe} -\usage{ -visualize_component( - schema_url, - component = "DataFlow", - base_url = "https://schematic-dev.api.sagebionetworks.org" -) -} -\arguments{ -\item{schema_url}{A data model URL} - -\item{component}{Component of the data model to explore} - -\item{base_url}{URL to schematic API endpoint} -} -\description{ -Get all the attributes associated with a specific data model component formatted as a dataframe -} From e6e7b34552ff9d6c75760c0239117a5aa07df611 Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Mon, 1 May 2023 13:31:15 -0700 Subject: [PATCH 13/38] redo description --- DESCRIPTION | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 40036fa..9afbb8b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,36 +1,31 @@ Package: dataflow -Title: Data Flow +Title: Data Flow App Demo Version: 0.0.0.9000 Authors@R: person('L', 'Wolfe', email = 'loren.wolfe@sagebase.org', role = c('cre', 'aut')) Description: A data flow package. -License: What license is it under? -Depends: - dfamodules +License: MIT + file LICENSE Imports: attempt, config (>= 0.3.1), dcamodules, + dfamodules, dplyr, - DT, - ggplot2, glue, golem (>= 0.3.1), htmltools, - lubridate, + jsonlite, magrittr, pkgload, processx, - reticulate, - shiny (>= 1.7.1), - shinydashboard, - shinydashboardPlus, - shinyjs, - waiter + shiny (>= 1.7.1) Encoding: UTF-8 LazyData: true RoxygenNote: 7.2.3 Suggests: spelling, - testthat (>= 3.0.0) + testthat (>= 3.0.0), + devtools, + usethis, + renv Config/testthat/edition: 3 -Language: en-US +Language: en-US \ No newline at end of file From 23b9a5960a1df1bdaf1cd819cb8763a3f03ab6ff Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Mon, 1 May 2023 13:31:36 -0700 Subject: [PATCH 14/38] no longer using .venv --- .github/workflows/shinyapps_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/shinyapps_deploy.yml b/.github/workflows/shinyapps_deploy.yml index 814c400..c7d5044 100644 --- a/.github/workflows/shinyapps_deploy.yml +++ b/.github/workflows/shinyapps_deploy.yml @@ -30,7 +30,7 @@ jobs: - name: Install System Dependencies run: | sudo apt-get update - sudo apt-get install -y pip python3.8-venv libcurl4-openssl-dev libpng-dev libfontconfig1-dev libharfbuzz-dev libfribidi-dev libtiff-dev libxml2-dev + sudo apt-get install -y pip libcurl4-openssl-dev libpng-dev libfontconfig1-dev libharfbuzz-dev libfribidi-dev libtiff-dev libxml2-dev # this action checks out the $GITHUB_WORKSPACE repository so that the workflow can access it - uses: actions/checkout@v3 # this action sets up pandoc From 9bfe888c8ea2febbc0c399f5197299c95b0c5ef7 Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Mon, 1 May 2023 13:59:17 -0700 Subject: [PATCH 15/38] add pipe operator --- NAMESPACE | 2 ++ R/utils-pipe.R | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 R/utils-pipe.R diff --git a/NAMESPACE b/NAMESPACE index 2b8d54c..da9e7bc 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,5 +1,6 @@ # Generated by roxygen2: do not edit by hand +export("%>%") export(run_app) import(shiny) importFrom(golem,activate_js) @@ -7,4 +8,5 @@ importFrom(golem,add_resource_path) importFrom(golem,bundle_resources) importFrom(golem,favicon) importFrom(golem,with_golem_options) +importFrom(magrittr,"%>%") importFrom(shiny,shinyApp) diff --git a/R/utils-pipe.R b/R/utils-pipe.R new file mode 100644 index 0000000..fd0b1d1 --- /dev/null +++ b/R/utils-pipe.R @@ -0,0 +1,14 @@ +#' Pipe operator +#' +#' See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details. +#' +#' @name %>% +#' @rdname pipe +#' @keywords internal +#' @export +#' @importFrom magrittr %>% +#' @usage lhs \%>\% rhs +#' @param lhs A value or the magrittr placeholder. +#' @param rhs A function call using the magrittr semantics. +#' @return The result of calling `rhs(lhs)`. +NULL From 7301c2bc6676c72065b08b1e658e418eedafc09a Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Mon, 1 May 2023 14:08:49 -0700 Subject: [PATCH 16/38] add shinyjs --- DESCRIPTION | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9afbb8b..2e6983c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -17,7 +17,8 @@ Imports: magrittr, pkgload, processx, - shiny (>= 1.7.1) + shiny (>= 1.7.1), + shinyjs Encoding: UTF-8 LazyData: true RoxygenNote: 7.2.3 From 97864d9be640237274b823ad5b7048dca1c6d34d Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Mon, 1 May 2023 14:09:09 -0700 Subject: [PATCH 17/38] add packages to code --- R/app_server.R | 218 ++++++++++++++++++++++++------------------------- R/app_ui.R | 80 +++++++++--------- 2 files changed, 149 insertions(+), 149 deletions(-) diff --git a/R/app_server.R b/R/app_server.R index 2a4bfd0..af12ff6 100644 --- a/R/app_server.R +++ b/R/app_server.R @@ -20,7 +20,7 @@ app_server <- function( input, output, session ) { api$access, "?", "redirect_uri=", app_url, "&grant_type=", "authorization_code", "&code=", params$code ) - + # get the access_token and userinfo token req <- httr::POST(redirect_url, encode = "form", @@ -35,24 +35,24 @@ app_server <- function( input, output, session ) { session$userData$access_token <- access_token # DEV STUFF ########################################################################### - + # read in configs global_config <- jsonlite::read_json("inst/global.json") dash_config <- jsonlite::read_json("inst/datatable_dashboard_config.json") # download data flow status manifest - synapse_manifest <- manifest_download(asset_view = global_config$asset_view, - dataset_id = global_config$manifest_dataset_id, - input_token = access_token, - base_url = global_config$api_base_url) + synapse_manifest <- dfamodules::manifest_download(asset_view = global_config$asset_view, + dataset_id = global_config$manifest_dataset_id, + input_token = access_token, + base_url = global_config$api_base_url) - manifest_dfa <- prep_manifest_dfa(manifest = synapse_manifest$content, - config = dash_config) + manifest_dfa <- dfamodules::prep_manifest_dfa(manifest = synapse_manifest$content, + config = dash_config) # PREPARE MANIFEST FOR DASH ########################################################### # add status to manifest - manifest_w_status <- reactive({ + manifest_w_status <- shiny::reactive({ # add some columns to manifest to make logic easier manifest <- manifest_dfa %>% @@ -88,8 +88,8 @@ app_server <- function( input, output, session ) { # FILTER MANIFEST FOR DASH UI ########################################################### # prepare inputs for filter module - filter_inputs <- reactive({ - + filter_inputs <- shiny::reactive({ + contributor_choices <- unique(manifest_w_status()$contributor) dataset_choices <- unique(manifest_w_status()$dataset) release_daterange_start <- min(manifest_w_status()$release_scheduled, na.rm = TRUE) @@ -103,49 +103,49 @@ app_server <- function( input, output, session ) { status_choices) }) - output$filter_module <- renderUI({ + output$filter_module <- shiny::renderUI({ filters <- filter_inputs() - mod_datatable_filters_ui("datatable_filters_1", - contributor_choices = filters[[1]], - dataset_choices = filters[[2]], - release_daterange = c(filters[[3]], filters[[4]]), - status_choices = filters[[5]]) + dfamodules::mod_datatable_filters_ui("datatable_filters_1", + contributor_choices = filters[[1]], + dataset_choices = filters[[2]], + release_daterange = c(filters[[3]], filters[[4]]), + status_choices = filters[[5]]) }) # FILTER MANIFEST FOR DASH SERVER #################################################### - filtered_manifest <- mod_datatable_filters_server("datatable_filters_1", - manifest_w_status) + filtered_manifest <- dfamodules::mod_datatable_filters_server("datatable_filters_1", + manifest_w_status) + - # DATASET DASH ####################################################################### - mod_datatable_dashboard_server("dashboard_1", - filtered_manifest, - jsonlite::read_json("inst/datatable_dashboard_config.json")) + dfamodules::mod_datatable_dashboard_server("dashboard_1", + filtered_manifest, + jsonlite::read_json("inst/datatable_dashboard_config.json")) # DATASET DASH VIZ : DISTRIBUTIONS #################################################### - mod_distribution_server(id = "distribution_contributor", - df = filtered_manifest, - group_by_var = "contributor", - title = NULL, - x_lab = "Contributor", - y_lab = "Number of Datasets", - fill = "#0d1c38") - - mod_distribution_server(id = "distribution_datatype", - df = filtered_manifest, - group_by_var = "dataset", - title = NULL, - x_lab = "Type of dataset", - y_lab = "Number of Datasets", - fill = "#0d1c38") + dfamodules::mod_distribution_server(id = "distribution_contributor", + df = filtered_manifest, + group_by_var = "contributor", + title = NULL, + x_lab = "Contributor", + y_lab = "Number of Datasets", + fill = "#0d1c38") + + dfamodules::mod_distribution_server(id = "distribution_datatype", + df = filtered_manifest, + group_by_var = "dataset", + title = NULL, + x_lab = "Type of dataset", + y_lab = "Number of Datasets", + fill = "#0d1c38") # PREPARE DATA FOR STACKED BAR PLOTS ################################################## # specifically stacked bar plots that show data flow status grouped by contributor - stacked_bar_data <- reactive({ - + stacked_bar_data <- shiny::reactive({ + release_status_data <- filtered_manifest() %>% dplyr::group_by(contributor) %>% dplyr::group_by(dataset, .add = TRUE) %>% @@ -159,16 +159,16 @@ app_server <- function( input, output, session ) { release_status_data }) - mod_stacked_bar_server(id = "stacked_bar_release_status", - df = stacked_bar_data, - x_var = "contributor", - y_var = "n", - fill_var = "data_flow_status", - title = NULL, - x_lab = "Contributors", - y_lab = NULL, - colors = c("#085631", "#ffa500", "#a72a1e", "#3d3d3d"), - coord_flip = TRUE) + dfamodules::mod_stacked_bar_server(id = "stacked_bar_release_status", + df = stacked_bar_data, + x_var = "contributor", + y_var = "n", + fill_var = "data_flow_status", + title = NULL, + x_lab = "Contributors", + y_lab = NULL, + colors = c("#085631", "#ffa500", "#a72a1e", "#3d3d3d"), + coord_flip = TRUE) # drop down for runners plot output$select_project_ui <- shiny::renderUI({ @@ -183,10 +183,10 @@ app_server <- function( input, output, session ) { # wrangle data for stacked bar plot (runners) - release_data_runners <- reactive({ + release_data_runners <- shiny::reactive({ + + shiny::req(input$select_project_input) - req(input$select_project_input) - release_status_data <- filtered_manifest() %>% dplyr::filter(!is.na(release_scheduled)) %>% dplyr::filter(contributor == input$select_project_input) %>% @@ -202,78 +202,78 @@ app_server <- function( input, output, session ) { }) - mod_stacked_bar_server(id = "stacked_runners", - df = release_data_runners, - x_var = "release_scheduled", - y_var = "n", - fill_var = "data_flow_status", - title = NULL, - x_lab = "Release Dates", - y_lab = NULL, - x_line = Sys.Date(), - colors = c("#085631", "#ffa500", "#a72a1e"), - width = 10, - date_breaks = "1 month", - coord_flip = FALSE) + dfamodules::mod_stacked_bar_server(id = "stacked_runners", + df = release_data_runners, + x_var = "release_scheduled", + y_var = "n", + fill_var = "data_flow_status", + title = NULL, + x_lab = "Release Dates", + y_lab = NULL, + x_line = Sys.Date(), + colors = c("#085631", "#ffa500", "#a72a1e"), + width = 10, + date_breaks = "1 month", + coord_flip = FALSE) # ADMINISTRATOR ####################################################################### # reactive value that holds manifest_dfa - rv_manifest <- reactiveVal(manifest_dfa) + rv_manifest <- shiny::reactiveVal(manifest_dfa) # STORAGE PROJECT SELECTION - select_storage_project_out <- mod_select_storage_project_server(id = "select_storage_project_1", - asset_view = global_config$asset_view, - input_token = access_token, - base_url = global_config$api_base_url) - + select_storage_project_out <- dfamodules::mod_select_storage_project_server(id = "select_storage_project_1", + asset_view = global_config$asset_view, + input_token = access_token, + base_url = global_config$api_base_url) + # DATASET SELECTION - dataset_selection <- mod_dataset_selection_server(id = "dataset_selection_1", - storage_project_df = select_storage_project_out, - asset_view = global_config$asset_view, - input_token = access_token, - base_url = global_config$api_base_url) + dataset_selection <- dfamodules::mod_dataset_selection_server(id = "dataset_selection_1", + storage_project_df = select_storage_project_out, + asset_view = global_config$asset_view, + input_token = access_token, + base_url = global_config$api_base_url) # UPDATE DATA FLOW STATUS SELECTIONS - updated_data_flow_status <- mod_update_data_flow_status_server("update_data_flow_status_1") + updated_data_flow_status <- dfamodules::mod_update_data_flow_status_server("update_data_flow_status_1") # MODIFY MANIFEST - modified_manifest <- reactive({ - req(updated_data_flow_status()) + modified_manifest <- shiny::reactive({ + shiny::req(updated_data_flow_status()) - update_dfs_manifest(dfs_manifest = rv_manifest(), - dfs_updates = updated_data_flow_status(), - selected_datasets_df = dataset_selection()) + dfamodules::update_dfs_manifest(dfs_manifest = rv_manifest(), + dfs_updates = updated_data_flow_status(), + selected_datasets_df = dataset_selection()) }) # BUTTON CLICK UPDATE MANIFEST - observeEvent(input$save_update, { - rv_manifest(modified_manifest()) - }) + shiny::observeEvent(input$save_update, { + rv_manifest(modified_manifest()) + }) - observeEvent(input$clear_update, { + shiny::observeEvent(input$clear_update, { rv_manifest(manifest_dfa) }) # PREP MANIFEST FOR SYNAPSE SUBMISSION - manifest_submit <- reactive({ - prep_manifest_submit(modified_manifest(), - dash_config) + manifest_submit <- shiny::reactive({ + dfamodules::prep_manifest_submit(modified_manifest(), + dash_config) }) # DISPLAY MANIFEST - admin_display_manifest <- reactive({ + admin_display_manifest <- shiny::reactive({ # rearrange manifest so it's more readable - manifest <- rearrange_dataframe(manifest_submit(), - names(dash_config)) + manifest <- dfamodules::rearrange_dataframe(manifest_submit(), + names(dash_config)) # make columns factors - factor_cols <- get_colname_by_type(dash_config, type = "drop_down_filter") + factor_cols <- dfamodules::get_colname_by_type(dash_config, type = "drop_down_filter") manifest[factor_cols] <- lapply(manifest[,factor_cols], factor) # return @@ -281,26 +281,26 @@ app_server <- function( input, output, session ) { }) # get names of selected datasets - selected_row_names <- reactive({ + selected_row_names <- shiny::reactive({ dataset_selection()$id }) - mod_highlight_datatable_server("highlight_datatable_1", - admin_display_manifest, - selected_row_names, - "entityId") + dfamodules::mod_highlight_datatable_server("highlight_datatable_1", + admin_display_manifest, + selected_row_names, + "entityId") # SUBMIT MODEL TO SYNAPSE # make sure to submit using a manifest that has been run through date to string - mod_submit_model_server(id = "submit_model_1", - dfs_manifest = manifest_submit, - data_type = NULL, - asset_view = global_config$asset_view, - dataset_id = global_config$manifest_dataset_id, - manifest_dir = "./manifest", - input_token = access_token, - base_url = global_config$api_base_url, - schema_url = global_config$schema_url) - + dfamodules::mod_submit_model_server(id = "submit_model_1", + dfs_manifest = manifest_submit, + data_type = NULL, + asset_view = global_config$asset_view, + dataset_id = global_config$manifest_dataset_id, + manifest_dir = "./manifest", + input_token = access_token, + base_url = global_config$api_base_url, + schema_url = global_config$schema_url) + } diff --git a/R/app_ui.R b/R/app_ui.R index cd33c9b..5ed3ee8 100644 --- a/R/app_ui.R +++ b/R/app_ui.R @@ -8,7 +8,7 @@ app_ui <- function() { - tagList( + shiny::tagList( # Leave this function for adding external resources golem_add_external_resources(), @@ -16,16 +16,16 @@ app_ui <- function() { waiter::useWaiter(), waiter::waiterPreloader( - html = tagList( - img(src = "www/loading.gif"), - h4("Retrieving Synapse information...", style = "color:white;")), - color="#424874"), + html = shiny::tagList( + shiny::img(src = "www/loading.gif"), + shiny::h4("Retrieving Synapse information...", style = "color:white;")), + color="#424874"), # define colors for icons in datatable # green check - tags$style(".fa-check {color:#58A158}"), + shiny::tags$style(".fa-check {color:#58A158}"), # red x - tags$style(".fa-xmark {color:#B2242A}"), + shiny::tags$style(".fa-xmark {color:#B2242A}"), # Your application UI logic @@ -68,7 +68,7 @@ app_ui <- function() { shinydashboard::tabItem(tabName = "dataset-dashboard", shiny::fluidRow( - uiOutput("filter_module")), + shiny::uiOutput("filter_module")), shiny::fluidRow( @@ -77,7 +77,7 @@ app_ui <- function() { title = "Dashboard", status = "primary", collapsible = TRUE, - mod_datatable_dashboard_ui("dashboard_1") + dfamodules::mod_datatable_dashboard_ui("dashboard_1") )), shiny::fluidRow( @@ -85,67 +85,67 @@ app_ui <- function() { title = "Distribution of datasets by contributor", status = "primary", collapsible = TRUE, - mod_distribution_ui("distribution_contributor")), + dfamodules::mod_distribution_ui("distribution_contributor")), shinydashboard::box( title = "Distribution of datasets by data type", status = "primary", collapsible = TRUE, - mod_distribution_ui("distribution_datatype") + dfamodules::mod_distribution_ui("distribution_datatype") )), shiny::fluidRow( shinydashboard::box( - title = "Release status of all datasets by contributor", - status = "primary", - collapsible = TRUE, - mod_stacked_bar_ui("stacked_bar_release_status")), - shinydashboard::box( - title = "Data flow status by release date", - status = "primary", - collapsible = TRUE, - - shiny::uiOutput("select_project_ui"), - - mod_stacked_bar_ui("stacked_runners"))) - ), + title = "Release status of all datasets by contributor", + status = "primary", + collapsible = TRUE, + dfamodules::mod_stacked_bar_ui("stacked_bar_release_status")), + shinydashboard::box( + title = "Data flow status by release date", + status = "primary", + collapsible = TRUE, + + shiny::uiOutput("select_project_ui"), + + dfamodules::mod_stacked_bar_ui("stacked_runners"))) + ), # Administrator tab shinydashboard::tabItem(tabName = "administrator", - fluidPage( + shiny::fluidPage( - mod_select_storage_project_ui("select_storage_project_1"), + dfamodules::mod_select_storage_project_ui("select_storage_project_1"), - mod_dataset_selection_ui("dataset_selection_1"), + dfamodules::mod_dataset_selection_ui("dataset_selection_1"), br(), - mod_update_data_flow_status_ui("update_data_flow_status_1"), + dfamodules::mod_update_data_flow_status_ui("update_data_flow_status_1"), shinydashboard::box( width = NULL, - mod_highlight_datatable_ui("highlight_datatable_1"), + dfamodules::mod_highlight_datatable_ui("highlight_datatable_1"), br(), - actionButton("save_update", "Save Updates"), - actionButton("clear_update", "Clear Updates") + shiny::actionButton("save_update", "Save Updates"), + shiny::actionButton("clear_update", "Clear Updates") ), - - br(), - mod_submit_model_ui("submit_model_1")) + shiny::br(), + + dfamodules::mod_submit_model_ui("submit_model_1")) ) - - ) + ) ) ) - } + ) +} #' Add external Resources to the Application #' @@ -160,7 +160,7 @@ golem_add_external_resources <- function(){ add_resource_path( 'www', app_sys('app/www') ) - + tags$head( favicon(), bundle_resources( @@ -173,9 +173,9 @@ golem_add_external_resources <- function(){ } uiFunc <- function(req) { - if (!has_auth_code(parseQueryString(req$QUERY_STRING))) { + if (!has_auth_code(shiny::parseQueryString(req$QUERY_STRING))) { authorization_url <- httr::oauth2.0_authorize_url(api, app, scope = scope) - return(tags$script(HTML(sprintf( + return(shiny::tags$script(shiny::HTML(sprintf( "location.replace(\"%s\");", authorization_url )))) From c64208feac3872471bc4dba6aaa7840b0bd383fc Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Mon, 1 May 2023 14:52:42 -0700 Subject: [PATCH 18/38] reinit renv --- renv.lock | 202 +++--------------------------------------------------- 1 file changed, 9 insertions(+), 193 deletions(-) diff --git a/renv.lock b/renv.lock index 75f20a8..b2ca215 100644 --- a/renv.lock +++ b/renv.lock @@ -9,22 +9,6 @@ ] }, "Packages": { - "DT": { - "Package": "DT", - "Version": "0.27", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "3444e6ed78763f9f13aaa39f2481eb34", - "Requirements": [ - "crosstalk", - "htmltools", - "htmlwidgets", - "jquerylib", - "jsonlite", - "magrittr", - "promises" - ] - }, "MASS": { "Package": "MASS", "Version": "7.3-58.1", @@ -67,16 +51,6 @@ "Hash": "e749cae40fa9ef469b6050959517453c", "Requirements": [] }, - "RcppTOML": { - "Package": "RcppTOML", - "Version": "0.2.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "c232938949fcd8126034419cc529333a", - "Requirements": [ - "Rcpp" - ] - }, "Rttf2pt1": { "Package": "Rttf2pt1", "Version": "1.3.11", @@ -95,14 +69,6 @@ "sys" ] }, - "assertthat": { - "Package": "assertthat", - "Version": "0.2.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "50c838a310445e954bc13f26f26a6ecf", - "Requirements": [] - }, "attempt": { "Package": "attempt", "Version": "0.3.1", @@ -265,19 +231,6 @@ "sys" ] }, - "crosstalk": { - "Package": "crosstalk", - "Version": "1.2.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "6aa54f69598c32177e920eb3402e8293", - "Requirements": [ - "R6", - "htmltools", - "jsonlite", - "lazyeval" - ] - }, "curl": { "Package": "curl", "Version": "5.0.0", @@ -496,19 +449,6 @@ "rlang" ] }, - "fresh": { - "Package": "fresh", - "Version": "0.2.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "fa54367040deb4537da49b7ac0ee5770", - "Requirements": [ - "htmltools", - "rstudioapi", - "sass", - "shiny" - ] - }, "fs": { "Package": "fs", "Version": "1.6.1", @@ -684,10 +624,10 @@ }, "httr": { "Package": "httr", - "Version": "1.4.4", + "Version": "1.4.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "57557fac46471f0dbbf44705cc6a5c8c", + "Hash": "f6844033201269bec3ca0097bc6c97b3", "Requirements": [ "R6", "curl", @@ -799,14 +739,6 @@ "Hash": "b64cdbb2b340437c4ee047a1f4c4377b", "Requirements": [] }, - "lazyeval": { - "Package": "lazyeval", - "Version": "0.2.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "d908914ae53b04d4c0c0fd72ecc35370", - "Requirements": [] - }, "lifecycle": { "Package": "lifecycle", "Version": "1.0.3", @@ -819,17 +751,6 @@ "rlang" ] }, - "lubridate": { - "Package": "lubridate", - "Version": "1.9.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "e25f18436e3efd42c7c590a1c4c15390", - "Requirements": [ - "generics", - "timechange" - ] - }, "magrittr": { "Package": "magrittr", "Version": "2.0.3", @@ -901,22 +822,14 @@ }, "openssl": { "Package": "openssl", - "Version": "2.0.5", + "Version": "2.0.6", "Source": "Repository", "Repository": "CRAN", - "Hash": "b04c27110bf367b4daa93f34f3d58e75", + "Hash": "0f7cd2962e3044bb940cca4f4b5cecbe", "Requirements": [ "askpass" ] }, - "parsedate": { - "Package": "parsedate", - "Version": "1.3.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "7f5024cc7af45eeecef657fa62beb568", - "Requirements": [] - }, "patchwork": { "Package": "patchwork", "Version": "1.1.2", @@ -946,10 +859,10 @@ }, "pkgbuild": { "Package": "pkgbuild", - "Version": "1.3.1", + "Version": "1.4.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "66d2adfed274daf81ccfe77d974c3b9b", + "Hash": "d6c3008d79653a0f267703288230105e", "Requirements": [ "R6", "callr", @@ -957,6 +870,7 @@ "crayon", "desc", "prettyunits", + "processx", "rprojroot", "withr" ] @@ -1137,14 +1051,6 @@ "xopen" ] }, - "rematch": { - "Package": "rematch", - "Version": "1.0.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "c66b930d20bb6d858cd18e1cebcfae5c", - "Requirements": [] - }, "rematch2": { "Package": "rematch2", "Version": "2.1.2", @@ -1171,58 +1077,12 @@ "Hash": "c9e8442ab69bc21c9697ecf856c1e6c7", "Requirements": [] }, - "reticulate": { - "Package": "reticulate", - "Version": "1.28", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "86c441bf33e1d608db773cb94b848458", - "Requirements": [ - "Matrix", - "Rcpp", - "RcppTOML", - "here", - "jsonlite", - "png", - "rappdirs", - "withr" - ] - }, - "rhub": { - "Package": "rhub", - "Version": "1.1.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "e0880f6783f720d136755fb92d63c78b", - "Requirements": [ - "R6", - "assertthat", - "callr", - "cli", - "crayon", - "desc", - "digest", - "httr", - "jsonlite", - "parsedate", - "pillar", - "prettyunits", - "processx", - "rappdirs", - "rcmdcheck", - "rematch", - "tibble", - "uuid", - "whoami", - "withr" - ] - }, "rlang": { "Package": "rlang", - "Version": "1.1.0", + "Version": "1.1.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "dc079ccd156cde8647360f473c1fa718", + "Hash": "a85c767b55f0bf9b7ad16c6d7baee5bb", "Requirements": [] }, "rmarkdown": { @@ -1397,21 +1257,6 @@ "shiny" ] }, - "shinydashboardPlus": { - "Package": "shinydashboardPlus", - "Version": "2.0.3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "5045276dcad7ad9b785d593b1a710681", - "Requirements": [ - "fresh", - "htmltools", - "lifecycle", - "shiny", - "shinydashboard", - "waiter" - ] - }, "shinyjs": { "Package": "shinyjs", "Version": "2.1.0", @@ -1556,16 +1401,6 @@ "withr" ] }, - "timechange": { - "Package": "timechange", - "Version": "0.2.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "8548b44f79a35ba1791308b61e6012d7", - "Requirements": [ - "cpp11" - ] - }, "tinytex": { "Package": "tinytex", "Version": "0.45", @@ -1624,14 +1459,6 @@ "Hash": "1fe17157424bb09c48a8b3b550c753bc", "Requirements": [] }, - "uuid": { - "Package": "uuid", - "Version": "1.1-0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "f1cb46c157d080b729159d407be83496", - "Requirements": [] - }, "vctrs": { "Package": "vctrs", "Version": "0.6.2", @@ -1689,17 +1516,6 @@ "Hash": "c6abfa47a46d281a7d5159d0a8891e88", "Requirements": [] }, - "whoami": { - "Package": "whoami", - "Version": "1.3.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "ef0f4d9b8f2cc2ebeccae1d725b8a023", - "Requirements": [ - "httr", - "jsonlite" - ] - }, "withr": { "Package": "withr", "Version": "2.5.0", From 6a06a9586ce837045104a06a1e911b7e6e5c2565 Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Mon, 1 May 2023 14:52:58 -0700 Subject: [PATCH 19/38] fix some error statements --- R/global.R | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/R/global.R b/R/global.R index 20a2694..f13bda2 100644 --- a/R/global.R +++ b/R/global.R @@ -1,3 +1,5 @@ +library(yaml) + # SET UP OAUTH oauth_client <- yaml::yaml.load_file("oauth_config.yml") @@ -5,9 +7,9 @@ client_id <- toString(oauth_client$client_id) client_secret <- toString(oauth_client$client_secret) app_url <- toString(oauth_client$app_url) -if (is.null(client_id) || nchar(client_id) == 0) stop("missing DCA_CLIENT_ID environmental variable") -if (is.null(client_secret) || nchar(client_secret) == 0) stop("missing DCA_CLIENT_SECRET environmental variable") -if (is.null(app_url) || nchar(app_url) == 0) stop("missing DCA_APP_URL environmental variable") +if (is.null(client_id) || nchar(client_id) == 0) stop("missing DFA_CLIENT_ID environmental variable") +if (is.null(client_secret) || nchar(client_secret) == 0) stop("missing DFA_CLIENT_SECRET environmental variable") +if (is.null(app_url) || nchar(app_url) == 0) stop("missing DFA_APP_URL environmental variable") # update port if running app locally if (interactive()) { From cfae296a3a00b66aaeace782fe7778c0a695d133 Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Mon, 1 May 2023 14:53:12 -0700 Subject: [PATCH 20/38] add space to end of description --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2e6983c..0d1d3b4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -29,4 +29,4 @@ Suggests: usethis, renv Config/testthat/edition: 3 -Language: en-US \ No newline at end of file +Language: en-US From cc72fd22722230c7116930078056037ffd7ecce2 Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Mon, 1 May 2023 15:26:44 -0700 Subject: [PATCH 21/38] update renv version --- renv.lock | 4 +--- renv/activate.R | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/renv.lock b/renv.lock index b2ca215..64f7b45 100644 --- a/renv.lock +++ b/renv.lock @@ -1071,10 +1071,8 @@ }, "renv": { "Package": "renv", - "Version": "0.16.0", + "Version": "0.17.3", "Source": "Repository", - "Repository": "CRAN", - "Hash": "c9e8442ab69bc21c9697ecf856c1e6c7", "Requirements": [] }, "rlang": { diff --git a/renv/activate.R b/renv/activate.R index 019b5a6..c972284 100644 --- a/renv/activate.R +++ b/renv/activate.R @@ -2,7 +2,7 @@ local({ # the requested version of renv - version <- "0.16.0" + version <- "0.17.3" # the project directory project <- getwd() From a9b30666392205b8a35f99d01358bb08c4d7f219 Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Mon, 1 May 2023 15:27:27 -0700 Subject: [PATCH 22/38] remove golem version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0d1d3b4..45aefa9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -11,7 +11,7 @@ Imports: dfamodules, dplyr, glue, - golem (>= 0.3.1), + golem, htmltools, jsonlite, magrittr, From f58f86bed264898c879183fca5ca964c610c47de Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Mon, 1 May 2023 16:09:05 -0700 Subject: [PATCH 23/38] make updates to renv --- renv/activate.R | 66 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 52 insertions(+), 14 deletions(-) diff --git a/renv/activate.R b/renv/activate.R index c972284..a8fdc32 100644 --- a/renv/activate.R +++ b/renv/activate.R @@ -63,6 +63,10 @@ local({ if (is.environment(x) || length(x)) x else y } + `%??%` <- function(x, y) { + if (is.null(x)) y else x + } + bootstrap <- function(version, library) { # attempt to download renv @@ -83,28 +87,39 @@ local({ renv_bootstrap_repos <- function() { + # get CRAN repository + cran <- getOption("renv.repos.cran", "https://cloud.r-project.org") + # check for repos override repos <- Sys.getenv("RENV_CONFIG_REPOS_OVERRIDE", unset = NA) - if (!is.na(repos)) + if (!is.na(repos)) { + + # check for RSPM; if set, use a fallback repository for renv + rspm <- Sys.getenv("RSPM", unset = NA) + if (identical(rspm, repos)) + repos <- c(RSPM = rspm, CRAN = cran) + return(repos) + } + # check for lockfile repositories repos <- tryCatch(renv_bootstrap_repos_lockfile(), error = identity) if (!inherits(repos, "error") && length(repos)) return(repos) # if we're testing, re-use the test repositories - if (renv_bootstrap_tests_running()) - return(getOption("renv.tests.repos")) + if (renv_bootstrap_tests_running()) { + repos <- getOption("renv.tests.repos") + if (!is.null(repos)) + return(repos) + } # retrieve current repos repos <- getOption("repos") # ensure @CRAN@ entries are resolved - repos[repos == "@CRAN@"] <- getOption( - "renv.repos.cran", - "https://cloud.r-project.org" - ) + repos[repos == "@CRAN@"] <- cran # add in renv.bootstrap.repos if set default <- c(FALLBACK = "https://cloud.r-project.org") @@ -344,8 +359,7 @@ local({ return() # allow directories - info <- file.info(tarball, extra_cols = FALSE) - if (identical(info$isdir, TRUE)) { + if (dir.exists(tarball)) { name <- sprintf("renv_%s.tar.gz", version) tarball <- file.path(tarball, name) } @@ -659,8 +673,8 @@ local({ if (version == loadedversion) return(TRUE) - # assume four-component versions are from GitHub; three-component - # versions are from CRAN + # assume four-component versions are from GitHub; + # three-component versions are from CRAN components <- strsplit(loadedversion, "[.-]")[[1]] remote <- if (length(components) == 4L) paste("rstudio/renv", loadedversion, sep = "@") @@ -700,6 +714,12 @@ local({ # warn if the version of renv loaded does not match renv_bootstrap_validate_version(version) + # execute renv load hooks, if any + hooks <- getHook("renv::autoload") + for (hook in hooks) + if (is.function(hook)) + tryCatch(hook(), error = warning) + # load the project renv::load(project) @@ -842,11 +862,29 @@ local({ renv_json_read <- function(file = NULL, text = NULL) { + jlerr <- NULL + # if jsonlite is loaded, use that instead - if ("jsonlite" %in% loadedNamespaces()) - renv_json_read_jsonlite(file, text) + if ("jsonlite" %in% loadedNamespaces()) { + + json <- catch(renv_json_read_jsonlite(file, text)) + if (!inherits(json, "error")) + return(json) + + jlerr <- json + + } + + # otherwise, fall back to the default JSON reader + json <- catch(renv_json_read_default(file, text)) + if (!inherits(json, "error")) + return(json) + + # report an error + if (!is.null(jlerr)) + stop(jlerr) else - renv_json_read_default(file, text) + stop(json) } From c7ac1a82d085381ec63f24df4b7e2f9d5d42c6c5 Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Mon, 1 May 2023 16:33:26 -0700 Subject: [PATCH 24/38] install golem and dfamodules --- .github/workflows/shinyapps_deploy.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/shinyapps_deploy.yml b/.github/workflows/shinyapps_deploy.yml index c7d5044..cd27441 100644 --- a/.github/workflows/shinyapps_deploy.yml +++ b/.github/workflows/shinyapps_deploy.yml @@ -35,6 +35,13 @@ jobs: - uses: actions/checkout@v3 # this action sets up pandoc - uses: r-lib/actions/setup-pandoc@v2 + # install dfamodules and golem to fix error in shinydeploy action + # renv not installing correctly + - name: Install R packages + run: | + install.packages("golem") + devtools::install_github("Sage-Bionetworks/dfamodules") + shell: Rscript {0} # this action activates renv - uses: r-lib/actions/setup-renv@v2 # Write synapse config (not sure if I even need this??) From 28caa5633afa3dc4161723f72749687a8ff7b86c Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Mon, 1 May 2023 16:46:05 -0700 Subject: [PATCH 25/38] install devtools and resconnect in same step --- .github/workflows/shinyapps_deploy.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/shinyapps_deploy.yml b/.github/workflows/shinyapps_deploy.yml index cd27441..eaad957 100644 --- a/.github/workflows/shinyapps_deploy.yml +++ b/.github/workflows/shinyapps_deploy.yml @@ -39,7 +39,7 @@ jobs: # renv not installing correctly - name: Install R packages run: | - install.packages("golem") + install.packages(c("devtools", "golem", "rsconnect")) devtools::install_github("Sage-Bionetworks/dfamodules") shell: Rscript {0} # this action activates renv @@ -52,7 +52,6 @@ jobs: # deploy app using rsconnect - name: Authorize and deploy app run: | - install.packages("rsconnect") refName <- Sys.getenv("GITHUB_REF_NAME") repo <- Sys.getenv("GITHUB_REPOSITORY") appName <- strsplit(repo, "/")[[1]][2] From 860917476d4f2fd937de6cda0e843fa14cd6fb5d Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Mon, 1 May 2023 17:33:08 -0700 Subject: [PATCH 26/38] add final line --- .Rprofile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.Rprofile b/.Rprofile index 3843d01..0e99f37 100644 --- a/.Rprofile +++ b/.Rprofile @@ -7,4 +7,4 @@ source("renv/activate.R") SAGE = "http://ran.synapse.org" ) ) -} \ No newline at end of file +} From 3aa7130dd0e392979c46c1ef4e80e09cac8052ca Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Tue, 2 May 2023 12:17:44 -0700 Subject: [PATCH 27/38] make minor changes to try and get deployment to go through --- .github/workflows/shinyapps_deploy.yml | 2 -- DESCRIPTION | 7 ++++--- renv/settings.json | 17 +++++++++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 renv/settings.json diff --git a/.github/workflows/shinyapps_deploy.yml b/.github/workflows/shinyapps_deploy.yml index eaad957..9ba8518 100644 --- a/.github/workflows/shinyapps_deploy.yml +++ b/.github/workflows/shinyapps_deploy.yml @@ -20,8 +20,6 @@ on: jobs: shiny-deploy: runs-on: ubuntu-latest - # This image seems to be based on rocker/r-ver which in turn is based on debian - container: rocker/rstudio:4.1.2 env: # This should not be necessary for installing from public repo's however remotes::install_github() fails without it. GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} diff --git a/DESCRIPTION b/DESCRIPTION index 45aefa9..dabba5a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -6,10 +6,11 @@ Description: A data flow package. License: MIT + file LICENSE Imports: attempt, - config (>= 0.3.1), + config, dcamodules, dfamodules, dplyr, + DT, glue, golem, htmltools, @@ -17,14 +18,14 @@ Imports: magrittr, pkgload, processx, - shiny (>= 1.7.1), + shiny, shinyjs Encoding: UTF-8 LazyData: true RoxygenNote: 7.2.3 Suggests: spelling, - testthat (>= 3.0.0), + testthat, devtools, usethis, renv diff --git a/renv/settings.json b/renv/settings.json new file mode 100644 index 0000000..3331ef2 --- /dev/null +++ b/renv/settings.json @@ -0,0 +1,17 @@ +{ + "bioconductor.version": [], + "external.libraries": [], + "ignored.packages": [], + "package.dependency.fields": [ + "Imports", + "Depends", + "LinkingTo" + ], + "r.version": [], + "snapshot.type": "implicit", + "use.cache": true, + "vcs.ignore.cellar": true, + "vcs.ignore.library": true, + "vcs.ignore.local": true, + "vcs.manage.ignores": true +} From 35c108b72fd91c5a1773651cbf00e92464331449 Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Tue, 2 May 2023 12:29:27 -0700 Subject: [PATCH 28/38] add renv activation --- app.R | 1 + 1 file changed, 1 insertion(+) diff --git a/app.R b/app.R index 0006adf..a5fab30 100644 --- a/app.R +++ b/app.R @@ -5,3 +5,4 @@ pkgload::load_all(export_all = FALSE,helpers = FALSE,attach_testthat = FALSE) options( "golem.app.prod" = TRUE) dataflow::run_app() # add parameters here (if any) +source("renv/activate.R) From f8e7f187df3ca509f2ae87d4eff56790cec72de7 Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Thu, 4 May 2023 10:37:13 -0700 Subject: [PATCH 29/38] updates to deployment --- .github/workflows/shinyapps_deploy.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/shinyapps_deploy.yml b/.github/workflows/shinyapps_deploy.yml index 9ba8518..1d952e6 100644 --- a/.github/workflows/shinyapps_deploy.yml +++ b/.github/workflows/shinyapps_deploy.yml @@ -20,9 +20,10 @@ on: jobs: shiny-deploy: runs-on: ubuntu-latest + container: rocker/rstudio:4.1.2 env: # This should not be necessary for installing from public repo's however remotes::install_github() fails without it. - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + GITHUB_PAT: ${{ github.GITHUB_TOKEN }} steps: - name: Install System Dependencies @@ -35,11 +36,11 @@ jobs: - uses: r-lib/actions/setup-pandoc@v2 # install dfamodules and golem to fix error in shinydeploy action # renv not installing correctly - - name: Install R packages - run: | - install.packages(c("devtools", "golem", "rsconnect")) - devtools::install_github("Sage-Bionetworks/dfamodules") - shell: Rscript {0} + #- name: Install R packages + # run: | + # install.packages(c("devtools", "golem", "rsconnect")) + # devtools::install_github("Sage-Bionetworks/dfamodules") + # shell: Rscript {0} # this action activates renv - uses: r-lib/actions/setup-renv@v2 # Write synapse config (not sure if I even need this??) @@ -50,6 +51,8 @@ jobs: # deploy app using rsconnect - name: Authorize and deploy app run: | + renv::restore() + refName <- Sys.getenv("GITHUB_REF_NAME") repo <- Sys.getenv("GITHUB_REPOSITORY") appName <- strsplit(repo, "/")[[1]][2] From 5fe643f47766f59a9835fa68c2b313570aca8cc8 Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Thu, 4 May 2023 10:47:24 -0700 Subject: [PATCH 30/38] use secret --- .github/workflows/shinyapps_deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/shinyapps_deploy.yml b/.github/workflows/shinyapps_deploy.yml index 1d952e6..207130a 100644 --- a/.github/workflows/shinyapps_deploy.yml +++ b/.github/workflows/shinyapps_deploy.yml @@ -23,7 +23,7 @@ jobs: container: rocker/rstudio:4.1.2 env: # This should not be necessary for installing from public repo's however remotes::install_github() fails without it. - GITHUB_PAT: ${{ github.GITHUB_TOKEN }} + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - name: Install System Dependencies @@ -40,7 +40,7 @@ jobs: # run: | # install.packages(c("devtools", "golem", "rsconnect")) # devtools::install_github("Sage-Bionetworks/dfamodules") - # shell: Rscript {0} + shell: Rscript {0} # this action activates renv - uses: r-lib/actions/setup-renv@v2 # Write synapse config (not sure if I even need this??) From 0986830cd4e5343a3b413471889de0c956a80903 Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Thu, 4 May 2023 10:48:13 -0700 Subject: [PATCH 31/38] fix syntax error --- .github/workflows/shinyapps_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/shinyapps_deploy.yml b/.github/workflows/shinyapps_deploy.yml index 207130a..b00a4fc 100644 --- a/.github/workflows/shinyapps_deploy.yml +++ b/.github/workflows/shinyapps_deploy.yml @@ -40,7 +40,7 @@ jobs: # run: | # install.packages(c("devtools", "golem", "rsconnect")) # devtools::install_github("Sage-Bionetworks/dfamodules") - shell: Rscript {0} + # shell: Rscript {0} # this action activates renv - uses: r-lib/actions/setup-renv@v2 # Write synapse config (not sure if I even need this??) From f027983b816c21df5e5f18a0d60c4a419942a50e Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Thu, 4 May 2023 11:32:24 -0700 Subject: [PATCH 32/38] add remotes --- DESCRIPTION | 3 +++ 1 file changed, 3 insertions(+) diff --git a/DESCRIPTION b/DESCRIPTION index dabba5a..6c678c3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -31,3 +31,6 @@ Suggests: renv Config/testthat/edition: 3 Language: en-US +Remotes: + Sage-Bionetworks/dcamodules, + Sage-Bionetworks/dfamodules From 7698d67f96e8f7df90ddb6a8e1582bba399011b0 Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Fri, 5 May 2023 11:14:55 -0700 Subject: [PATCH 33/38] fix typo --- app.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.R b/app.R index a5fab30..c1a8bf0 100644 --- a/app.R +++ b/app.R @@ -5,4 +5,4 @@ pkgload::load_all(export_all = FALSE,helpers = FALSE,attach_testthat = FALSE) options( "golem.app.prod" = TRUE) dataflow::run_app() # add parameters here (if any) -source("renv/activate.R) +source("renv/activate.R") From 73739f2667477fe896822cdbf8d59d073db118c3 Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Fri, 5 May 2023 11:18:18 -0700 Subject: [PATCH 34/38] reinitialize renv, update dfamodules release --- renv.lock | 1461 ++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 1176 insertions(+), 285 deletions(-) diff --git a/renv.lock b/renv.lock index 64f7b45..95b3623 100644 --- a/renv.lock +++ b/renv.lock @@ -9,109 +9,237 @@ ] }, "Packages": { + "DBI": { + "Package": "DBI", + "Version": "1.1.2", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "methods" + ], + "Hash": "dcd1743af4336156873e3ce3c950b8b9" + }, + "DT": { + "Package": "DT", + "Version": "0.27", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "crosstalk", + "htmltools", + "htmlwidgets", + "jquerylib", + "jsonlite", + "magrittr", + "promises" + ], + "Hash": "3444e6ed78763f9f13aaa39f2481eb34" + }, "MASS": { "Package": "MASS", "Version": "7.3-58.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "762e1804143a332333c054759f89a706", - "Requirements": [] + "Requirements": [ + "R", + "grDevices", + "graphics", + "methods", + "stats", + "utils" + ], + "Hash": "762e1804143a332333c054759f89a706" }, "Matrix": { "Package": "Matrix", "Version": "1.5-3", "Source": "Repository", "Repository": "CRAN", - "Hash": "4006dffe49958d2dd591c17e61e60591", "Requirements": [ - "lattice" - ] + "R", + "graphics", + "grid", + "lattice", + "methods", + "stats", + "utils" + ], + "Hash": "4006dffe49958d2dd591c17e61e60591" }, "R6": { "Package": "R6", "Version": "2.5.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "470851b6d5d0ac559e9d01bb352b4021", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "470851b6d5d0ac559e9d01bb352b4021" }, "RColorBrewer": { "Package": "RColorBrewer", "Version": "1.1-3", "Source": "Repository", "Repository": "CRAN", - "Hash": "45f0398006e83a5b10b72a90663d8d8c", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "45f0398006e83a5b10b72a90663d8d8c" }, "Rcpp": { "Package": "Rcpp", "Version": "1.0.10", "Source": "Repository", "Repository": "CRAN", - "Hash": "e749cae40fa9ef469b6050959517453c", - "Requirements": [] + "Requirements": [ + "methods", + "utils" + ], + "Hash": "e749cae40fa9ef469b6050959517453c" }, "Rttf2pt1": { "Package": "Rttf2pt1", "Version": "1.3.11", "Source": "Repository", "Repository": "CRAN", - "Hash": "60818466bde87943f750b33b5ef5217b", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "60818466bde87943f750b33b5ef5217b" }, "askpass": { "Package": "askpass", "Version": "1.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "e8a22846fff485f0be3770c2da758713", "Requirements": [ "sys" - ] + ], + "Hash": "e8a22846fff485f0be3770c2da758713" + }, + "assertthat": { + "Package": "assertthat", + "Version": "0.2.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "tools" + ], + "Hash": "50c838a310445e954bc13f26f26a6ecf" }, "attempt": { "Package": "attempt", "Version": "0.3.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "d7421bb5dfeb2676b9e4a5a60c2fcfd2", "Requirements": [ "rlang" - ] + ], + "Hash": "d7421bb5dfeb2676b9e4a5a60c2fcfd2" + }, + "backports": { + "Package": "backports", + "Version": "1.4.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "c39fbec8a30d23e721980b8afb31984c" }, "base64enc": { "Package": "base64enc", "Version": "0.1-3", "Source": "Repository", "Repository": "CRAN", - "Hash": "543776ae6848fde2f48ff3816d0628bc", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "543776ae6848fde2f48ff3816d0628bc" + }, + "bit": { + "Package": "bit", + "Version": "4.0.4", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "f36715f14d94678eea9933af927bc15d" + }, + "bit64": { + "Package": "bit64", + "Version": "4.0.5", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "bit", + "methods", + "stats", + "utils" + ], + "Hash": "9fe98599ca456d6552421db0d6772d8f" + }, + "blob": { + "Package": "blob", + "Version": "1.2.3", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "methods", + "rlang", + "vctrs" + ], + "Hash": "10d231579bc9c06ab1c320618808d4ff" }, "brew": { "Package": "brew", "Version": "1.0-8", "Source": "Repository", "Repository": "CRAN", - "Hash": "d69a786e85775b126bddbee185ae6084", - "Requirements": [] + "Hash": "d69a786e85775b126bddbee185ae6084" }, "brio": { "Package": "brio", "Version": "1.1.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "976cf154dfb043c012d87cddd8bca363", - "Requirements": [] + "Hash": "976cf154dfb043c012d87cddd8bca363" + }, + "broom": { + "Package": "broom", + "Version": "0.8.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "backports", + "dplyr", + "ellipsis", + "generics", + "ggplot2", + "glue", + "methods", + "purrr", + "rlang", + "stringr", + "tibble", + "tidyr" + ], + "Hash": "fe13cb670e14da57fd7a466578db8ce5" }, "bslib": { "Package": "bslib", "Version": "0.4.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "a7fbf03946ad741129dc81098722fca1", "Requirements": [ + "R", "base64enc", "cachem", + "grDevices", "htmltools", "jquerylib", "jsonlite", @@ -119,125 +247,208 @@ "mime", "rlang", "sass" - ] + ], + "Hash": "a7fbf03946ad741129dc81098722fca1" }, "cachem": { "Package": "cachem", "Version": "1.0.7", "Source": "Repository", "Repository": "CRAN", - "Hash": "cda74447c42f529de601fe4d4050daef", "Requirements": [ "fastmap", "rlang" - ] + ], + "Hash": "cda74447c42f529de601fe4d4050daef" }, "callr": { "Package": "callr", "Version": "3.7.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "9b2191ede20fa29828139b9900922e51", "Requirements": [ + "R", "R6", - "processx" - ] + "processx", + "utils" + ], + "Hash": "9b2191ede20fa29828139b9900922e51" + }, + "cellranger": { + "Package": "cellranger", + "Version": "1.1.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "rematch", + "tibble" + ], + "Hash": "f61dbaec772ccd2e17705c1e872e9e7c" }, "cli": { "Package": "cli", "Version": "3.6.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "89e6d8219950eac806ae0c489052048a", - "Requirements": [] + "Requirements": [ + "R", + "utils" + ], + "Hash": "89e6d8219950eac806ae0c489052048a" }, "clipr": { "Package": "clipr", "Version": "0.8.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "3f038e5ac7f41d4ac41ce658c85e3042", - "Requirements": [] + "Requirements": [ + "utils" + ], + "Hash": "3f038e5ac7f41d4ac41ce658c85e3042" }, "colorspace": { "Package": "colorspace", "Version": "2.1-0", "Source": "Repository", "Repository": "CRAN", - "Hash": "f20c47fd52fae58b4e377c37bb8c335b", - "Requirements": [] + "Requirements": [ + "R", + "grDevices", + "graphics", + "methods", + "stats" + ], + "Hash": "f20c47fd52fae58b4e377c37bb8c335b" }, "colourpicker": { "Package": "colourpicker", "Version": "1.2.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "ca4d99d106687d68392ffe270081bfc0", "Requirements": [ + "R", "ggplot2", "htmltools", "htmlwidgets", "jsonlite", "miniUI", "shiny", - "shinyjs" - ] + "shinyjs", + "utils" + ], + "Hash": "ca4d99d106687d68392ffe270081bfc0" }, "commonmark": { "Package": "commonmark", "Version": "1.9.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "d691c61bff84bd63c383874d2d0c3307", - "Requirements": [] + "Hash": "d691c61bff84bd63c383874d2d0c3307" }, "config": { "Package": "config", "Version": "0.3.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "31d77b09f63550cee9ecb5a08bf76e8f", "Requirements": [ "yaml" - ] + ], + "Hash": "31d77b09f63550cee9ecb5a08bf76e8f" }, "cpp11": { "Package": "cpp11", "Version": "0.4.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "ed588261931ee3be2c700d22e94a29ab", - "Requirements": [] + "Hash": "ed588261931ee3be2c700d22e94a29ab" }, "crayon": { "Package": "crayon", "Version": "1.5.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "e8a1e41acf02548751f45c718d55aa6a", - "Requirements": [] + "Requirements": [ + "grDevices", + "methods", + "utils" + ], + "Hash": "e8a1e41acf02548751f45c718d55aa6a" }, "credentials": { "Package": "credentials", "Version": "1.3.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "93762d0a34d78e6a025efdbfb5c6bb41", "Requirements": [ "askpass", "curl", "jsonlite", "openssl", "sys" - ] + ], + "Hash": "93762d0a34d78e6a025efdbfb5c6bb41" + }, + "crosstalk": { + "Package": "crosstalk", + "Version": "1.2.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R6", + "htmltools", + "jsonlite", + "lazyeval" + ], + "Hash": "6aa54f69598c32177e920eb3402e8293" }, "curl": { "Package": "curl", "Version": "5.0.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "e4f97056611e8e6b8b852d13b7400cf1", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "e4f97056611e8e6b8b852d13b7400cf1" + }, + "data.table": { + "Package": "data.table", + "Version": "1.14.2", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "methods" + ], + "Hash": "36b67b5adf57b292923f5659f5f0c853" + }, + "dbplyr": { + "Package": "dbplyr", + "Version": "2.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "DBI", + "R", + "R6", + "assertthat", + "blob", + "dplyr", + "ellipsis", + "glue", + "lifecycle", + "magrittr", + "methods", + "purrr", + "rlang", + "tibble", + "tidyselect", + "utils", + "vctrs", + "withr" + ], + "Hash": "1f37fa4ab2f5f7eded42f78b9a887182" }, "dcamodules": { "Package": "dcamodules", @@ -250,7 +461,6 @@ "RemoteUsername": "Sage-Bionetworks", "RemoteRef": "HEAD", "RemoteSha": "1e14dcfbdaa2913eeeacc12acaac1c8264bac1f7", - "Hash": "c27efc5d7a84072f43c242d6ffd13964", "Requirements": [ "base64enc", "colourpicker", @@ -263,27 +473,30 @@ "shiny", "shinydashboard", "waiter" - ] + ], + "Hash": "c27efc5d7a84072f43c242d6ffd13964" }, "desc": { "Package": "desc", "Version": "1.4.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "6b9602c7ebbe87101a9c8edb6e8b6d21", "Requirements": [ + "R", "R6", "cli", - "rprojroot" - ] + "rprojroot", + "utils" + ], + "Hash": "6b9602c7ebbe87101a9c8edb6e8b6d21" }, "devtools": { "Package": "devtools", "Version": "2.4.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "ea5bc8b4a6a01e4f12d98b58329930bb", "Requirements": [ + "R", "cli", "desc", "ellipsis", @@ -301,50 +514,77 @@ "roxygen2", "rversions", "sessioninfo", + "stats", "testthat", + "tools", "urlchecker", "usethis", + "utils", "withr" - ] + ], + "Hash": "ea5bc8b4a6a01e4f12d98b58329930bb" }, "dfamodules": { "Package": "dfamodules", - "Version": "0.0.0.9000", + "Version": "0.0.0.9001", "Source": "GitHub", "RemoteType": "github", "RemoteHost": "api.github.com", "RemoteUsername": "Sage-Bionetworks", "RemoteRepo": "dfamodules", "RemoteRef": "main", - "RemoteSha": "2a1ff254ae5ad2fce96c4bbcddef3abf43891131", - "Hash": "218f2e10ad7c6c01b17baa2af2361a17", - "Requirements": [] + "RemoteSha": "97d73f09831c53e1d384fe9b202ed8b32b690397", + "Requirements": [ + "DT", + "dplyr", + "ggplot2", + "glue", + "htmltools", + "httr", + "jsonlite", + "magrittr", + "purrr", + "rlang", + "shiny", + "shinydashboard", + "shinyjs", + "waiter" + ], + "Hash": "aa74d8b9e9a4c21a64673102c9f43eff" }, "diffobj": { "Package": "diffobj", "Version": "0.3.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "bcaa8b95f8d7d01a5dedfd959ce88ab8", "Requirements": [ - "crayon" - ] + "R", + "crayon", + "methods", + "stats", + "tools", + "utils" + ], + "Hash": "bcaa8b95f8d7d01a5dedfd959ce88ab8" }, "digest": { "Package": "digest", "Version": "0.6.31", "Source": "Repository", "Repository": "CRAN", - "Hash": "8b708f296afd9ae69f450f9640be8990", - "Requirements": [] + "Requirements": [ + "R", + "utils" + ], + "Hash": "8b708f296afd9ae69f450f9640be8990" }, "downlit": { "Package": "downlit", "Version": "0.4.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "79bf3f66590752ffbba20f8d2da94c7c", "Requirements": [ + "R", "brio", "desc", "digest", @@ -355,122 +595,198 @@ "vctrs", "withr", "yaml" - ] + ], + "Hash": "79bf3f66590752ffbba20f8d2da94c7c" }, "dplyr": { "Package": "dplyr", "Version": "1.1.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "dea6970ff715ca541c387de363ff405e", "Requirements": [ + "R", "R6", "cli", "generics", "glue", "lifecycle", "magrittr", + "methods", "pillar", "rlang", "tibble", "tidyselect", + "utils", "vctrs" - ] + ], + "Hash": "dea6970ff715ca541c387de363ff405e" + }, + "dtplyr": { + "Package": "dtplyr", + "Version": "1.2.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "crayon", + "data.table", + "dplyr", + "ellipsis", + "glue", + "lifecycle", + "rlang", + "tibble", + "tidyselect", + "vctrs" + ], + "Hash": "f5d195cd5fcc0a77499d9da698ef2ea3" }, "ellipsis": { "Package": "ellipsis", "Version": "0.3.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "bb0eec2fe32e88d9e2836c2f73ea2077", "Requirements": [ + "R", "rlang" - ] + ], + "Hash": "bb0eec2fe32e88d9e2836c2f73ea2077" }, "evaluate": { "Package": "evaluate", "Version": "0.20", "Source": "Repository", "Repository": "CRAN", - "Hash": "4b68aa51edd89a0e044a66e75ae3cc6c", - "Requirements": [] + "Requirements": [ + "R", + "methods" + ], + "Hash": "4b68aa51edd89a0e044a66e75ae3cc6c" }, "extrafont": { "Package": "extrafont", "Version": "0.18", "Source": "Repository", "Repository": "CRAN", - "Hash": "07a8a50195fc77e8690fd8bc4e87e6a0", "Requirements": [ + "R", "Rttf2pt1", - "extrafontdb" - ] + "extrafontdb", + "grDevices", + "utils" + ], + "Hash": "07a8a50195fc77e8690fd8bc4e87e6a0" }, "extrafontdb": { "Package": "extrafontdb", "Version": "1.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "a861555ddec7451c653b40e713166c6f", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "a861555ddec7451c653b40e713166c6f" }, "fansi": { "Package": "fansi", "Version": "1.0.4", "Source": "Repository", "Repository": "CRAN", - "Hash": "1d9e7ad3c8312a192dea7d3db0274fde", - "Requirements": [] + "Requirements": [ + "R", + "grDevices", + "utils" + ], + "Hash": "1d9e7ad3c8312a192dea7d3db0274fde" }, "farver": { "Package": "farver", "Version": "2.1.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "8106d78941f34855c440ddb946b8f7a5", - "Requirements": [] + "Hash": "8106d78941f34855c440ddb946b8f7a5" }, "fastmap": { "Package": "fastmap", "Version": "1.1.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "f7736a18de97dea803bde0a2daaafb27", - "Requirements": [] + "Hash": "f7736a18de97dea803bde0a2daaafb27" }, "fontawesome": { "Package": "fontawesome", "Version": "0.5.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "1e22b8cabbad1eae951a75e9f8b52378", "Requirements": [ + "R", "htmltools", "rlang" - ] + ], + "Hash": "1e22b8cabbad1eae951a75e9f8b52378" + }, + "forcats": { + "Package": "forcats", + "Version": "0.5.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "ellipsis", + "magrittr", + "rlang", + "tibble" + ], + "Hash": "81c3244cab67468aac4c60550832655d" }, "fs": { "Package": "fs", - "Version": "1.6.1", + "Version": "1.6.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "f4dcd23b67e33d851d2079f703e8b985", - "Requirements": [] + "Requirements": [ + "R", + "methods" + ], + "Hash": "94af08e0aa9675a16fadbb3aaaa90d2a" + }, + "gargle": { + "Package": "gargle", + "Version": "1.2.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cli", + "fs", + "glue", + "httr", + "jsonlite", + "rappdirs", + "rlang", + "rstudioapi", + "stats", + "utils", + "withr" + ], + "Hash": "9d234e6a87a6f8181792de6dc4a00e39" }, "generics": { "Package": "generics", "Version": "0.1.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "15e9634c0fcd294799e9b2e929ed1b86", - "Requirements": [] + "Requirements": [ + "R", + "methods" + ], + "Hash": "15e9634c0fcd294799e9b2e929ed1b86" }, "gert": { "Package": "gert", "Version": "1.9.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "9122b3958e749badb5c939f498038b57", "Requirements": [ "askpass", "credentials", @@ -478,171 +794,281 @@ "rstudioapi", "sys", "zip" - ] + ], + "Hash": "9122b3958e749badb5c939f498038b57" }, "ggplot2": { "Package": "ggplot2", "Version": "3.4.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "3a147ee02e85a8941aad9909f1b43b7b", "Requirements": [ "MASS", + "R", "cli", "glue", + "grDevices", + "grid", "gtable", "isoband", "lifecycle", "mgcv", "rlang", "scales", + "stats", "tibble", "vctrs", "withr" - ] + ], + "Hash": "3a147ee02e85a8941aad9909f1b43b7b" }, "gh": { "Package": "gh", "Version": "1.4.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "03533b1c875028233598f848fda44c4c", "Requirements": [ + "R", "cli", "gitcreds", "httr2", "ini", "jsonlite", "rlang" - ] + ], + "Hash": "03533b1c875028233598f848fda44c4c" }, "gitcreds": { "Package": "gitcreds", "Version": "0.1.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "ab08ac61f3e1be454ae21911eb8bc2fe", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "ab08ac61f3e1be454ae21911eb8bc2fe" }, "glue": { "Package": "glue", "Version": "1.6.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "4f2596dfb05dac67b9dc558e5c6fba2e", - "Requirements": [] + "Requirements": [ + "R", + "methods" + ], + "Hash": "4f2596dfb05dac67b9dc558e5c6fba2e" }, "golem": { "Package": "golem", "Version": "0.4.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "4275a95781526a472cff3e39f957c8be", "Requirements": [ + "R", "attempt", "config", "here", "htmltools", "rlang", "shiny", + "utils", "yaml" - ] + ], + "Hash": "4275a95781526a472cff3e39f957c8be" + }, + "googledrive": { + "Package": "googledrive", + "Version": "2.0.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cli", + "gargle", + "glue", + "httr", + "jsonlite", + "lifecycle", + "magrittr", + "pillar", + "purrr", + "rlang", + "tibble", + "utils", + "uuid", + "vctrs", + "withr" + ], + "Hash": "c3a25adbbfbb03f12e6f88c5fb1f3024" + }, + "googlesheets4": { + "Package": "googlesheets4", + "Version": "1.0.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cellranger", + "cli", + "curl", + "gargle", + "glue", + "googledrive", + "httr", + "ids", + "magrittr", + "methods", + "purrr", + "rematch2", + "rlang", + "tibble", + "utils", + "vctrs" + ], + "Hash": "9a6564184dc4a81daea4f1d7ce357c6a" }, "gtable": { "Package": "gtable", "Version": "0.3.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "b44addadb528a0d227794121c00572a0", "Requirements": [ + "R", "cli", "glue", + "grid", "lifecycle", "rlang" - ] + ], + "Hash": "b44addadb528a0d227794121c00572a0" + }, + "haven": { + "Package": "haven", + "Version": "2.5.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cli", + "cpp11", + "forcats", + "hms", + "lifecycle", + "methods", + "readr", + "rlang", + "tibble", + "tidyselect", + "vctrs" + ], + "Hash": "e3058e4ac77f4fa686f68a1838d5b715" }, "here": { "Package": "here", "Version": "1.0.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "24b224366f9c2e7534d2344d10d59211", "Requirements": [ "rprojroot" - ] + ], + "Hash": "24b224366f9c2e7534d2344d10d59211" }, "highr": { "Package": "highr", "Version": "0.10", "Source": "Repository", "Repository": "CRAN", - "Hash": "06230136b2d2b9ba5805e1963fa6e890", "Requirements": [ + "R", "xfun" - ] + ], + "Hash": "06230136b2d2b9ba5805e1963fa6e890" + }, + "hms": { + "Package": "hms", + "Version": "1.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "ellipsis", + "lifecycle", + "methods", + "pkgconfig", + "rlang", + "vctrs" + ], + "Hash": "5b8a2dd0fdbe2ab4f6081e6c7be6dfca" }, "htmltools": { "Package": "htmltools", "Version": "0.5.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "ba0240784ad50a62165058a27459304a", "Requirements": [ + "R", "base64enc", "digest", "ellipsis", "fastmap", - "rlang" - ] + "grDevices", + "rlang", + "utils" + ], + "Hash": "ba0240784ad50a62165058a27459304a" }, "htmlwidgets": { "Package": "htmlwidgets", "Version": "1.6.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "a865aa85bcb2697f47505bfd70422471", "Requirements": [ + "grDevices", "htmltools", "jsonlite", "knitr", "rmarkdown", "yaml" - ] + ], + "Hash": "a865aa85bcb2697f47505bfd70422471" }, "httpuv": { "Package": "httpuv", "Version": "1.6.9", "Source": "Repository", "Repository": "CRAN", - "Hash": "1046aa31a57eae8b357267a56a0b6d8b", "Requirements": [ + "R", "R6", "Rcpp", "later", - "promises" - ] + "promises", + "utils" + ], + "Hash": "1046aa31a57eae8b357267a56a0b6d8b" }, "httr": { "Package": "httr", "Version": "1.4.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "f6844033201269bec3ca0097bc6c97b3", "Requirements": [ + "R", "R6", "curl", "jsonlite", "mime", "openssl" - ] + ], + "Hash": "f6844033201269bec3ca0097bc6c97b3" }, "httr2": { "Package": "httr2", "Version": "0.2.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "5c09fe33064978ede54de42309c8b532", "Requirements": [ + "R", "R6", "cli", "curl", @@ -652,201 +1078,300 @@ "rappdirs", "rlang", "withr" - ] + ], + "Hash": "5c09fe33064978ede54de42309c8b532" }, "hunspell": { "Package": "hunspell", "Version": "3.0.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "3987784c19192ad0f2261c456d936df1", "Requirements": [ + "R", "Rcpp", "digest" - ] + ], + "Hash": "3987784c19192ad0f2261c456d936df1" + }, + "ids": { + "Package": "ids", + "Version": "1.0.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "openssl", + "uuid" + ], + "Hash": "99df65cfef20e525ed38c3d2577f7190" }, "ini": { "Package": "ini", "Version": "0.3.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "6154ec2223172bce8162d4153cda21f7", - "Requirements": [] + "Hash": "6154ec2223172bce8162d4153cda21f7" }, "isoband": { "Package": "isoband", "Version": "0.2.7", "Source": "Repository", "Repository": "CRAN", - "Hash": "0080607b4a1a7b28979aecef976d8bc2", - "Requirements": [] + "Requirements": [ + "grid", + "utils" + ], + "Hash": "0080607b4a1a7b28979aecef976d8bc2" }, "jquerylib": { "Package": "jquerylib", "Version": "0.1.4", "Source": "Repository", "Repository": "CRAN", - "Hash": "5aab57a3bd297eee1c1d862735972182", "Requirements": [ "htmltools" - ] + ], + "Hash": "5aab57a3bd297eee1c1d862735972182" }, "jsonlite": { "Package": "jsonlite", "Version": "1.8.4", "Source": "Repository", "Repository": "CRAN", - "Hash": "a4269a09a9b865579b2635c77e572374", - "Requirements": [] + "Requirements": [ + "methods" + ], + "Hash": "a4269a09a9b865579b2635c77e572374" }, "knitr": { "Package": "knitr", "Version": "1.42", "Source": "Repository", "Repository": "CRAN", - "Hash": "8329a9bcc82943c8069104d4be3ee22d", "Requirements": [ + "R", "evaluate", "highr", + "methods", + "tools", "xfun", "yaml" - ] + ], + "Hash": "8329a9bcc82943c8069104d4be3ee22d" }, "labeling": { "Package": "labeling", "Version": "0.4.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "3d5108641f47470611a32d0bdf357a72", - "Requirements": [] + "Requirements": [ + "graphics", + "stats" + ], + "Hash": "3d5108641f47470611a32d0bdf357a72" }, "later": { "Package": "later", "Version": "1.3.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "7e7b457d7766bc47f2a5f21cc2984f8e", "Requirements": [ "Rcpp", "rlang" - ] + ], + "Hash": "7e7b457d7766bc47f2a5f21cc2984f8e" }, "lattice": { "Package": "lattice", "Version": "0.20-45", "Source": "Repository", "Repository": "CRAN", - "Hash": "b64cdbb2b340437c4ee047a1f4c4377b", - "Requirements": [] + "Requirements": [ + "R", + "grDevices", + "graphics", + "grid", + "stats", + "utils" + ], + "Hash": "b64cdbb2b340437c4ee047a1f4c4377b" + }, + "lazyeval": { + "Package": "lazyeval", + "Version": "0.2.2", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "d908914ae53b04d4c0c0fd72ecc35370" }, "lifecycle": { "Package": "lifecycle", "Version": "1.0.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "001cecbeac1cff9301bdc3775ee46a86", "Requirements": [ + "R", "cli", "glue", "rlang" - ] + ], + "Hash": "001cecbeac1cff9301bdc3775ee46a86" + }, + "lubridate": { + "Package": "lubridate", + "Version": "1.9.2", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "generics", + "methods", + "timechange" + ], + "Hash": "e25f18436e3efd42c7c590a1c4c15390" }, "magrittr": { "Package": "magrittr", "Version": "2.0.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "7ce2733a9826b3aeb1775d56fd305472", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "7ce2733a9826b3aeb1775d56fd305472" }, "memoise": { "Package": "memoise", "Version": "2.0.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "e2817ccf4a065c5d9d7f2cfbe7c1d78c", "Requirements": [ "cachem", "rlang" - ] + ], + "Hash": "e2817ccf4a065c5d9d7f2cfbe7c1d78c" }, "mgcv": { "Package": "mgcv", "Version": "1.8-41", "Source": "Repository", "Repository": "CRAN", - "Hash": "6b3904f13346742caa3e82dd0303d4ad", "Requirements": [ "Matrix", - "nlme" - ] + "R", + "graphics", + "methods", + "nlme", + "splines", + "stats", + "utils" + ], + "Hash": "6b3904f13346742caa3e82dd0303d4ad" }, "mime": { "Package": "mime", "Version": "0.12", "Source": "Repository", "Repository": "CRAN", - "Hash": "18e9c28c1d3ca1560ce30658b22ce104", - "Requirements": [] + "Requirements": [ + "tools" + ], + "Hash": "18e9c28c1d3ca1560ce30658b22ce104" }, "miniUI": { "Package": "miniUI", "Version": "0.1.1.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "fec5f52652d60615fdb3957b3d74324a", "Requirements": [ "htmltools", - "shiny" - ] + "shiny", + "utils" + ], + "Hash": "fec5f52652d60615fdb3957b3d74324a" + }, + "modelr": { + "Package": "modelr", + "Version": "0.1.8", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "broom", + "magrittr", + "purrr", + "rlang", + "tibble", + "tidyr", + "tidyselect", + "vctrs" + ], + "Hash": "9fd59716311ee82cba83dc2826fc5577" }, "munsell": { "Package": "munsell", "Version": "0.5.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "6dfe8bf774944bd5595785e3229d8771", "Requirements": [ - "colorspace" - ] + "colorspace", + "methods" + ], + "Hash": "6dfe8bf774944bd5595785e3229d8771" }, "nlme": { "Package": "nlme", "Version": "3.1-160", "Source": "Repository", "Repository": "CRAN", - "Hash": "02e3c6e7df163aafa8477225e6827bc5", "Requirements": [ - "lattice" - ] + "R", + "graphics", + "lattice", + "stats", + "utils" + ], + "Hash": "02e3c6e7df163aafa8477225e6827bc5" }, "openssl": { "Package": "openssl", "Version": "2.0.6", "Source": "Repository", "Repository": "CRAN", - "Hash": "0f7cd2962e3044bb940cca4f4b5cecbe", "Requirements": [ "askpass" - ] + ], + "Hash": "0f7cd2962e3044bb940cca4f4b5cecbe" + }, + "parsedate": { + "Package": "parsedate", + "Version": "1.3.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "7f5024cc7af45eeecef657fa62beb568" }, "patchwork": { "Package": "patchwork", "Version": "1.1.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "63b611e9d909a9ed057639d9c3b77152", "Requirements": [ "ggplot2", - "gtable" - ] + "grDevices", + "graphics", + "grid", + "gtable", + "stats", + "utils" + ], + "Hash": "63b611e9d909a9ed057639d9c3b77152" }, "pillar": { "Package": "pillar", "Version": "1.9.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "15da5a8412f317beeee6175fbc76f4bb", "Requirements": [ "cli", "fansi", @@ -854,16 +1379,18 @@ "lifecycle", "rlang", "utf8", + "utils", "vctrs" - ] + ], + "Hash": "15da5a8412f317beeee6175fbc76f4bb" }, "pkgbuild": { "Package": "pkgbuild", "Version": "1.4.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "d6c3008d79653a0f267703288230105e", "Requirements": [ + "R", "R6", "callr", "cli", @@ -873,23 +1400,26 @@ "processx", "rprojroot", "withr" - ] + ], + "Hash": "d6c3008d79653a0f267703288230105e" }, "pkgconfig": { "Package": "pkgconfig", "Version": "2.0.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "01f28d4278f15c76cddbea05899c5d6f", - "Requirements": [] + "Requirements": [ + "utils" + ], + "Hash": "01f28d4278f15c76cddbea05899c5d6f" }, "pkgdown": { "Package": "pkgdown", "Version": "2.0.6", "Source": "Repository", "Repository": "CRAN", - "Hash": "f958d0b2a5dabc5ffd414f062b1ffbe7", "Requirements": [ + "R", "bslib", "callr", "cli", @@ -910,132 +1440,158 @@ "withr", "xml2", "yaml" - ] + ], + "Hash": "f958d0b2a5dabc5ffd414f062b1ffbe7" }, "pkgload": { "Package": "pkgload", "Version": "1.3.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "6b0c222c5071efe0f3baf3dae9aa40e2", "Requirements": [ + "R", "cli", "crayon", "desc", "fs", "glue", + "methods", "rlang", "rprojroot", + "utils", "withr" - ] + ], + "Hash": "6b0c222c5071efe0f3baf3dae9aa40e2" }, "png": { "Package": "png", "Version": "0.1-8", "Source": "Repository", "Repository": "CRAN", - "Hash": "bd54ba8a0a5faded999a7aab6e46b374", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "bd54ba8a0a5faded999a7aab6e46b374" }, "praise": { "Package": "praise", "Version": "1.0.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "a555924add98c99d2f411e37e7d25e9f", - "Requirements": [] + "Hash": "a555924add98c99d2f411e37e7d25e9f" }, "prettyunits": { "Package": "prettyunits", "Version": "1.1.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "95ef9167b75dde9d2ccc3c7528393e7e", - "Requirements": [] + "Hash": "95ef9167b75dde9d2ccc3c7528393e7e" }, "processx": { "Package": "processx", "Version": "3.8.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "d75b4059d781336efba24021915902b4", "Requirements": [ + "R", "R6", - "ps" - ] + "ps", + "utils" + ], + "Hash": "d75b4059d781336efba24021915902b4" }, "profvis": { "Package": "profvis", "Version": "0.3.7", "Source": "Repository", "Repository": "CRAN", - "Hash": "e9d21e79848e02e524bea6f5bd53e7e4", "Requirements": [ + "R", "htmlwidgets", "stringr" - ] + ], + "Hash": "e9d21e79848e02e524bea6f5bd53e7e4" + }, + "progress": { + "Package": "progress", + "Version": "1.2.2", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R6", + "crayon", + "hms", + "prettyunits" + ], + "Hash": "14dc9f7a3c91ebb14ec5bb9208a07061" }, "promises": { "Package": "promises", "Version": "1.2.0.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "4ab2c43adb4d4699cf3690acd378d75d", "Requirements": [ "R6", "Rcpp", "later", "magrittr", - "rlang" - ] + "rlang", + "stats" + ], + "Hash": "4ab2c43adb4d4699cf3690acd378d75d" }, "ps": { "Package": "ps", "Version": "1.7.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "709d852d33178db54b17c722e5b1e594", - "Requirements": [] + "Requirements": [ + "R", + "utils" + ], + "Hash": "709d852d33178db54b17c722e5b1e594" }, "purrr": { "Package": "purrr", "Version": "1.0.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "d71c815267c640f17ddbf7f16144b4bb", "Requirements": [ + "R", "cli", "lifecycle", "magrittr", "rlang", "vctrs" - ] + ], + "Hash": "d71c815267c640f17ddbf7f16144b4bb" }, "ragg": { "Package": "ragg", "Version": "1.2.4", "Source": "Repository", "Repository": "CRAN", - "Hash": "0db17bd5a1d4abfec76487b6f5dd957b", "Requirements": [ "systemfonts", "textshaping" - ] + ], + "Hash": "0db17bd5a1d4abfec76487b6f5dd957b" }, "rappdirs": { "Package": "rappdirs", "Version": "0.3.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "5e3c5dc0b071b21fa128676560dbe94d", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "5e3c5dc0b071b21fa128676560dbe94d" }, "rcmdcheck": { "Package": "rcmdcheck", "Version": "1.4.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "8f25ebe2ec38b1f2aef3b0d2ef76f6c4", "Requirements": [ "R6", "callr", @@ -1047,49 +1603,160 @@ "prettyunits", "rprojroot", "sessioninfo", + "utils", "withr", "xopen" - ] + ], + "Hash": "8f25ebe2ec38b1f2aef3b0d2ef76f6c4" + }, + "readr": { + "Package": "readr", + "Version": "2.1.2", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "R6", + "cli", + "clipr", + "cpp11", + "crayon", + "hms", + "lifecycle", + "methods", + "rlang", + "tibble", + "tzdb", + "utils", + "vroom" + ], + "Hash": "9c59de1357dc209868b5feb5c9f0fe2f" + }, + "readxl": { + "Package": "readxl", + "Version": "1.4.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cellranger", + "cpp11", + "progress", + "tibble", + "utils" + ], + "Hash": "170c35f745563bb307e963bde0197e4f" + }, + "rematch": { + "Package": "rematch", + "Version": "1.0.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "c66b930d20bb6d858cd18e1cebcfae5c" }, "rematch2": { "Package": "rematch2", "Version": "2.1.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "76c9e04c712a05848ae7a23d2f170a40", "Requirements": [ "tibble" - ] + ], + "Hash": "76c9e04c712a05848ae7a23d2f170a40" }, "remotes": { "Package": "remotes", "Version": "2.4.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "227045be9aee47e6dda9bb38ac870d67", - "Requirements": [] + "Requirements": [ + "R", + "methods", + "stats", + "tools", + "utils" + ], + "Hash": "227045be9aee47e6dda9bb38ac870d67" }, "renv": { "Package": "renv", "Version": "0.17.3", "Source": "Repository", - "Requirements": [] + "Repository": "CRAN", + "Requirements": [ + "utils" + ], + "Hash": "4543b8cd233ae25c6aba8548be9e747e" + }, + "reprex": { + "Package": "reprex", + "Version": "2.0.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "callr", + "cli", + "clipr", + "fs", + "glue", + "knitr", + "rlang", + "rmarkdown", + "rstudioapi", + "utils", + "withr" + ], + "Hash": "911d101becedc0fde495bd910984bdc8" + }, + "rhub": { + "Package": "rhub", + "Version": "1.1.2", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R6", + "assertthat", + "callr", + "cli", + "crayon", + "desc", + "digest", + "httr", + "jsonlite", + "parsedate", + "pillar", + "prettyunits", + "processx", + "rappdirs", + "rcmdcheck", + "rematch", + "tibble", + "utils", + "uuid", + "whoami", + "withr" + ], + "Hash": "e0880f6783f720d136755fb92d63c78b" }, "rlang": { "Package": "rlang", "Version": "1.1.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "a85c767b55f0bf9b7ad16c6d7baee5bb", - "Requirements": [] + "Requirements": [ + "R", + "utils" + ], + "Hash": "a85c767b55f0bf9b7ad16c6d7baee5bb" }, "rmarkdown": { "Package": "rmarkdown", "Version": "2.21", "Source": "Repository", "Repository": "CRAN", - "Hash": "493df4ae51e2e984952ea4d5c75786a3", "Requirements": [ + "R", "bslib", "evaluate", "fontawesome", @@ -1097,19 +1764,23 @@ "jquerylib", "jsonlite", "knitr", + "methods", "stringr", "tinytex", + "tools", + "utils", "xfun", "yaml" - ] + ], + "Hash": "493df4ae51e2e984952ea4d5c75786a3" }, "roxygen2": { "Package": "roxygen2", "Version": "7.2.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "7b153c746193b143c14baa072bae4e27", "Requirements": [ + "R", "R6", "brew", "cli", @@ -1117,41 +1788,63 @@ "cpp11", "desc", "knitr", + "methods", "pkgload", "purrr", "rlang", "stringi", "stringr", + "utils", "withr", "xml2" - ] + ], + "Hash": "7b153c746193b143c14baa072bae4e27" }, "rprojroot": { "Package": "rprojroot", "Version": "2.0.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "1de7ab598047a87bba48434ba35d497d", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "1de7ab598047a87bba48434ba35d497d" }, "rstudioapi": { "Package": "rstudioapi", "Version": "0.14", "Source": "Repository", "Repository": "CRAN", - "Hash": "690bd2acc42a9166ce34845884459320", - "Requirements": [] + "Hash": "690bd2acc42a9166ce34845884459320" }, "rversions": { "Package": "rversions", "Version": "2.1.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "a9881dfed103e83f9de151dc17002cd1", "Requirements": [ "curl", + "utils", "xml2" - ] + ], + "Hash": "a9881dfed103e83f9de151dc17002cd1" + }, + "rvest": { + "Package": "rvest", + "Version": "1.0.2", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "httr", + "lifecycle", + "magrittr", + "rlang", + "selectr", + "tibble", + "xml2" + ], + "Hash": "bb099886deffecd6f9b298b7d4492943" }, "sagethemes": { "Package": "sagethemes", @@ -1163,37 +1856,39 @@ "RemoteUsername": "Sage-Bionetworks", "RemoteRef": "HEAD", "RemoteSha": "457291ac7a8dfe3ceba672c0c11cbd7b82463d37", - "Hash": "86faea95402fe30c39e83c6d4ad91a4f", "Requirements": [ + "R", "extrafont", "ggplot2", + "grid", "patchwork", "png", "rlang", "scales" - ] + ], + "Hash": "86faea95402fe30c39e83c6d4ad91a4f" }, "sass": { "Package": "sass", "Version": "0.4.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "2bb4371a4c80115518261866eab6ab11", "Requirements": [ "R6", "fs", "htmltools", "rappdirs", "rlang" - ] + ], + "Hash": "2bb4371a4c80115518261866eab6ab11" }, "scales": { "Package": "scales", "Version": "1.2.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "906cb23d2f1c5680b8ce439b44c6fa63", "Requirements": [ + "R", "R6", "RColorBrewer", "farver", @@ -1202,25 +1897,42 @@ "munsell", "rlang", "viridisLite" - ] + ], + "Hash": "906cb23d2f1c5680b8ce439b44c6fa63" + }, + "selectr": { + "Package": "selectr", + "Version": "0.4-2", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "R6", + "methods", + "stringr" + ], + "Hash": "3838071b66e0c566d55cc26bd6e27bf4" }, "sessioninfo": { "Package": "sessioninfo", "Version": "1.2.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "3f9796a8d0a0e8c6eb49a4b029359d1f", "Requirements": [ - "cli" - ] + "R", + "cli", + "tools", + "utils" + ], + "Hash": "3f9796a8d0a0e8c6eb49a4b029359d1f" }, "shiny": { "Package": "shiny", "Version": "1.7.4", "Source": "Repository", "Repository": "CRAN", - "Hash": "c2eae3d8c670fa9dfa35a12066f4a1d5", "Requirements": [ + "R", "R6", "bslib", "cachem", @@ -1230,79 +1942,94 @@ "fastmap", "fontawesome", "glue", + "grDevices", "htmltools", "httpuv", "jsonlite", "later", "lifecycle", + "methods", "mime", "promises", "rlang", "sourcetools", + "tools", + "utils", "withr", "xtable" - ] + ], + "Hash": "c2eae3d8c670fa9dfa35a12066f4a1d5" }, "shinydashboard": { "Package": "shinydashboard", "Version": "0.7.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "e418b532e9bb4eb22a714b9a9f1acee7", "Requirements": [ + "R", "htmltools", "promises", - "shiny" - ] + "shiny", + "utils" + ], + "Hash": "e418b532e9bb4eb22a714b9a9f1acee7" }, "shinyjs": { "Package": "shinyjs", "Version": "2.1.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "802e4786b353a4bb27116957558548d5", "Requirements": [ + "R", "digest", "jsonlite", "shiny" - ] + ], + "Hash": "802e4786b353a4bb27116957558548d5" }, "sourcetools": { "Package": "sourcetools", "Version": "0.1.7-1", "Source": "Repository", "Repository": "CRAN", - "Hash": "5f5a7629f956619d519205ec475fe647", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "5f5a7629f956619d519205ec475fe647" }, "spelling": { "Package": "spelling", "Version": "2.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "b8c899a5c83f0d897286550481c91798", "Requirements": [ "commonmark", "hunspell", "knitr", "xml2" - ] + ], + "Hash": "b8c899a5c83f0d897286550481c91798" }, "stringi": { "Package": "stringi", "Version": "1.7.12", "Source": "Repository", "Repository": "CRAN", - "Hash": "ca8bd84263c77310739d2cf64d84d7c9", - "Requirements": [] + "Requirements": [ + "R", + "stats", + "tools", + "utils" + ], + "Hash": "ca8bd84263c77310739d2cf64d84d7c9" }, "stringr": { "Package": "stringr", "Version": "1.5.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "671a4d384ae9d32fc47a14e98bfa3dc8", "Requirements": [ + "R", "cli", "glue", "lifecycle", @@ -1310,33 +2037,34 @@ "rlang", "stringi", "vctrs" - ] + ], + "Hash": "671a4d384ae9d32fc47a14e98bfa3dc8" }, "sys": { "Package": "sys", "Version": "3.4.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "34c16f1ef796057bfa06d3f4ff818a5d", - "Requirements": [] + "Hash": "34c16f1ef796057bfa06d3f4ff818a5d" }, "systemfonts": { "Package": "systemfonts", "Version": "1.0.4", "Source": "Repository", "Repository": "CRAN", - "Hash": "90b28393209827327de889f49935140a", "Requirements": [ + "R", "cpp11" - ] + ], + "Hash": "90b28393209827327de889f49935140a" }, "testthat": { "Package": "testthat", "Version": "3.1.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "6e3c4843f1ed0d3d90f35498671a001c", "Requirements": [ + "R", "R6", "brio", "callr", @@ -1348,86 +2076,179 @@ "jsonlite", "lifecycle", "magrittr", + "methods", "pkgload", "praise", "processx", "ps", "rlang", + "utils", "waldo", "withr" - ] + ], + "Hash": "6e3c4843f1ed0d3d90f35498671a001c" }, "textshaping": { "Package": "textshaping", "Version": "0.3.6", "Source": "Repository", "Repository": "CRAN", - "Hash": "1ab6223d3670fac7143202cb6a2d43d5", "Requirements": [ + "R", "cpp11", "systemfonts" - ] + ], + "Hash": "1ab6223d3670fac7143202cb6a2d43d5" }, "tibble": { "Package": "tibble", "Version": "3.2.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "a84e2cc86d07289b3b6f5069df7a004c", "Requirements": [ + "R", "fansi", "lifecycle", "magrittr", + "methods", "pillar", "pkgconfig", "rlang", + "utils", + "vctrs" + ], + "Hash": "a84e2cc86d07289b3b6f5069df7a004c" + }, + "tidyr": { + "Package": "tidyr", + "Version": "1.2.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cpp11", + "dplyr", + "ellipsis", + "glue", + "lifecycle", + "magrittr", + "purrr", + "rlang", + "tibble", + "tidyselect", + "utils", "vctrs" - ] + ], + "Hash": "d8b95b7fee945d7da6888cf7eb71a49c" }, "tidyselect": { "Package": "tidyselect", "Version": "1.2.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "79540e5fcd9e0435af547d885f184fd5", "Requirements": [ + "R", "cli", "glue", "lifecycle", "rlang", "vctrs", "withr" - ] + ], + "Hash": "79540e5fcd9e0435af547d885f184fd5" + }, + "tidyverse": { + "Package": "tidyverse", + "Version": "1.3.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "broom", + "cli", + "crayon", + "dbplyr", + "dplyr", + "dtplyr", + "forcats", + "ggplot2", + "googledrive", + "googlesheets4", + "haven", + "hms", + "httr", + "jsonlite", + "lubridate", + "magrittr", + "modelr", + "pillar", + "purrr", + "readr", + "readxl", + "reprex", + "rlang", + "rstudioapi", + "rvest", + "stringr", + "tibble", + "tidyr", + "xml2" + ], + "Hash": "fc4c72b6ae9bb283416bd59a3303bbab" + }, + "timechange": { + "Package": "timechange", + "Version": "0.2.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cpp11" + ], + "Hash": "8548b44f79a35ba1791308b61e6012d7" }, "tinytex": { "Package": "tinytex", "Version": "0.45", "Source": "Repository", "Repository": "CRAN", - "Hash": "e4e357f28c2edff493936b6cb30c3d65", "Requirements": [ "xfun" - ] + ], + "Hash": "e4e357f28c2edff493936b6cb30c3d65" + }, + "tzdb": { + "Package": "tzdb", + "Version": "0.3.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cpp11" + ], + "Hash": "b2e1cbce7c903eaf23ec05c58e59fb5e" }, "urlchecker": { "Package": "urlchecker", "Version": "1.0.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "409328b8e1253c8d729a7836fe7f7a16", "Requirements": [ + "R", "cli", "curl", + "tools", "xml2" - ] + ], + "Hash": "409328b8e1253c8d729a7836fe7f7a16" }, "usethis": { "Package": "usethis", "Version": "2.1.6", "Source": "Repository", "Repository": "CRAN", - "Hash": "a67a22c201832b12c036cc059f1d137d", "Requirements": [ + "R", "cli", "clipr", "crayon", @@ -1444,133 +2265,203 @@ "rlang", "rprojroot", "rstudioapi", + "stats", + "utils", "whisker", "withr", "yaml" - ] + ], + "Hash": "a67a22c201832b12c036cc059f1d137d" }, "utf8": { "Package": "utf8", "Version": "1.2.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "1fe17157424bb09c48a8b3b550c753bc", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "1fe17157424bb09c48a8b3b550c753bc" + }, + "uuid": { + "Package": "uuid", + "Version": "1.1-0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "f1cb46c157d080b729159d407be83496" }, "vctrs": { "Package": "vctrs", "Version": "0.6.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "a745bda7aff4734c17294bb41d4e4607", "Requirements": [ + "R", "cli", "glue", "lifecycle", "rlang" - ] + ], + "Hash": "a745bda7aff4734c17294bb41d4e4607" }, "viridisLite": { "Package": "viridisLite", "Version": "0.4.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "62f4b5da3e08d8e5bcba6cac15603f70", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "62f4b5da3e08d8e5bcba6cac15603f70" + }, + "vroom": { + "Package": "vroom", + "Version": "1.5.7", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "bit64", + "cli", + "cpp11", + "crayon", + "glue", + "hms", + "lifecycle", + "methods", + "progress", + "rlang", + "stats", + "tibble", + "tidyselect", + "tzdb", + "vctrs", + "withr" + ], + "Hash": "976507b5a105bc3bdf6a5a5f29e0684f" }, "waiter": { "Package": "waiter", "Version": "0.2.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "93e6b6c8ae3f81d4be77a0dc74e5cf5e", "Requirements": [ "R6", "htmltools", "shiny" - ] + ], + "Hash": "93e6b6c8ae3f81d4be77a0dc74e5cf5e" }, "waldo": { "Package": "waldo", "Version": "0.4.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "035fba89d0c86e2113120f93301b98ad", "Requirements": [ "cli", "diffobj", "fansi", "glue", + "methods", "rematch2", "rlang", "tibble" - ] + ], + "Hash": "035fba89d0c86e2113120f93301b98ad" }, "whisker": { "Package": "whisker", "Version": "0.4.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "c6abfa47a46d281a7d5159d0a8891e88", - "Requirements": [] + "Hash": "c6abfa47a46d281a7d5159d0a8891e88" + }, + "whoami": { + "Package": "whoami", + "Version": "1.3.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "httr", + "jsonlite", + "utils" + ], + "Hash": "ef0f4d9b8f2cc2ebeccae1d725b8a023" }, "withr": { "Package": "withr", "Version": "2.5.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "c0e49a9760983e81e55cdd9be92e7182", - "Requirements": [] + "Requirements": [ + "R", + "grDevices", + "graphics", + "stats" + ], + "Hash": "c0e49a9760983e81e55cdd9be92e7182" }, "xfun": { "Package": "xfun", "Version": "0.39", "Source": "Repository", "Repository": "CRAN", - "Hash": "8f56e9acb54fb525e66464d57ab58bcb", - "Requirements": [] + "Requirements": [ + "stats", + "tools" + ], + "Hash": "8f56e9acb54fb525e66464d57ab58bcb" }, "xml2": { "Package": "xml2", "Version": "1.3.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "40682ed6a969ea5abfd351eb67833adc", - "Requirements": [] + "Requirements": [ + "R", + "methods" + ], + "Hash": "40682ed6a969ea5abfd351eb67833adc" }, "xopen": { "Package": "xopen", "Version": "1.0.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "6c85f015dee9cc7710ddd20f86881f58", "Requirements": [ + "R", "processx" - ] + ], + "Hash": "6c85f015dee9cc7710ddd20f86881f58" }, "xtable": { "Package": "xtable", "Version": "1.8-4", "Source": "Repository", "Repository": "CRAN", - "Hash": "b8acdf8af494d9ec19ccb2481a9b11c2", - "Requirements": [] + "Requirements": [ + "R", + "stats", + "utils" + ], + "Hash": "b8acdf8af494d9ec19ccb2481a9b11c2" }, "yaml": { "Package": "yaml", "Version": "2.3.7", "Source": "Repository", "Repository": "CRAN", - "Hash": "0d0056cc5383fbc240ccd0cb584bf436", - "Requirements": [] + "Hash": "0d0056cc5383fbc240ccd0cb584bf436" }, "zip": { "Package": "zip", "Version": "2.2.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "c42bfcec3fa6a0cce17ce1f8bc684f88", - "Requirements": [] + "Hash": "c42bfcec3fa6a0cce17ce1f8bc684f88" } } } From f7df372064d5294340476cb8f1c460b26c0aea2e Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Fri, 5 May 2023 11:54:53 -0700 Subject: [PATCH 35/38] add back in rsconnect installation --- .github/workflows/shinyapps_deploy.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/shinyapps_deploy.yml b/.github/workflows/shinyapps_deploy.yml index b00a4fc..fcfb358 100644 --- a/.github/workflows/shinyapps_deploy.yml +++ b/.github/workflows/shinyapps_deploy.yml @@ -34,13 +34,6 @@ jobs: - uses: actions/checkout@v3 # this action sets up pandoc - uses: r-lib/actions/setup-pandoc@v2 - # install dfamodules and golem to fix error in shinydeploy action - # renv not installing correctly - #- name: Install R packages - # run: | - # install.packages(c("devtools", "golem", "rsconnect")) - # devtools::install_github("Sage-Bionetworks/dfamodules") - # shell: Rscript {0} # this action activates renv - uses: r-lib/actions/setup-renv@v2 # Write synapse config (not sure if I even need this??) @@ -52,6 +45,7 @@ jobs: - name: Authorize and deploy app run: | renv::restore() + install.packages("rsconnect") refName <- Sys.getenv("GITHUB_REF_NAME") repo <- Sys.getenv("GITHUB_REPOSITORY") From 1591709d85ee176cc1c69c88c45b75d169bc1449 Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Fri, 5 May 2023 12:33:20 -0700 Subject: [PATCH 36/38] remove .Rprofile from app.R --- .Rprofile | 4 ++-- app.R | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.Rprofile b/.Rprofile index 0e99f37..9580bb1 100644 --- a/.Rprofile +++ b/.Rprofile @@ -1,5 +1,3 @@ -source("renv/activate.R") - .First <- function() { options( repos = c( @@ -8,3 +6,5 @@ source("renv/activate.R") ) ) } + +source("renv/activate.R") \ No newline at end of file diff --git a/app.R b/app.R index c1a8bf0..0006adf 100644 --- a/app.R +++ b/app.R @@ -5,4 +5,3 @@ pkgload::load_all(export_all = FALSE,helpers = FALSE,attach_testthat = FALSE) options( "golem.app.prod" = TRUE) dataflow::run_app() # add parameters here (if any) -source("renv/activate.R") From 8724a8d7d29aa55fdc096784fa348c7d6e9da01c Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Thu, 11 May 2023 10:37:47 -0700 Subject: [PATCH 37/38] update dfamodules version --- renv.lock | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/renv.lock b/renv.lock index 95b3623..e3bc822 100644 --- a/renv.lock +++ b/renv.lock @@ -5,6 +5,10 @@ { "Name": "CRAN", "URL": "https://cran.rstudio.com" + }, + { + "Name": "SAGE", + "URL": "http://ran.synapse.org" } ] }, @@ -454,13 +458,13 @@ "Package": "dcamodules", "Version": "0.1.0", "Source": "GitHub", - "Remotes": "Sage-Bionetworks/sagethemes", "RemoteType": "github", "RemoteHost": "api.github.com", - "RemoteRepo": "dcamodules", "RemoteUsername": "Sage-Bionetworks", - "RemoteRef": "HEAD", + "RemoteRepo": "dcamodules", + "RemoteRef": "main", "RemoteSha": "1e14dcfbdaa2913eeeacc12acaac1c8264bac1f7", + "Remotes": "Sage-Bionetworks/sagethemes", "Requirements": [ "base64enc", "colourpicker", @@ -474,7 +478,7 @@ "shinydashboard", "waiter" ], - "Hash": "c27efc5d7a84072f43c242d6ffd13964" + "Hash": "613cdfc41c99661f9d1afe2acf4c067b" }, "desc": { "Package": "desc", @@ -526,14 +530,14 @@ }, "dfamodules": { "Package": "dfamodules", - "Version": "0.0.0.9001", + "Version": "0.0.0.9002", "Source": "GitHub", "RemoteType": "github", "RemoteHost": "api.github.com", "RemoteUsername": "Sage-Bionetworks", "RemoteRepo": "dfamodules", "RemoteRef": "main", - "RemoteSha": "97d73f09831c53e1d384fe9b202ed8b32b690397", + "RemoteSha": "2441a1870dcb09a26fcc619c9806c17f97993754", "Requirements": [ "DT", "dplyr", @@ -550,7 +554,7 @@ "shinyjs", "waiter" ], - "Hash": "aa74d8b9e9a4c21a64673102c9f43eff" + "Hash": "b6b72de8c0e35c363724520742e5d51b" }, "diffobj": { "Package": "diffobj", From 3d5e458df8ebfae22079c81bb816ee2894b8e1f1 Mon Sep 17 00:00:00 2001 From: lakikowolfe Date: Thu, 11 May 2023 10:42:39 -0700 Subject: [PATCH 38/38] input_token -> access_token --- R/app_server.R | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/R/app_server.R b/R/app_server.R index af12ff6..f926798 100644 --- a/R/app_server.R +++ b/R/app_server.R @@ -41,10 +41,10 @@ app_server <- function( input, output, session ) { dash_config <- jsonlite::read_json("inst/datatable_dashboard_config.json") # download data flow status manifest - synapse_manifest <- dfamodules::manifest_download(asset_view = global_config$asset_view, - dataset_id = global_config$manifest_dataset_id, - input_token = access_token, - base_url = global_config$api_base_url) + synapse_manifest <- dfamodules::dataset_manifest_download(asset_view = global_config$asset_view, + dataset_id = global_config$manifest_dataset_id, + access_token = access_token, + base_url = global_config$api_base_url) manifest_dfa <- dfamodules::prep_manifest_dfa(manifest = synapse_manifest$content, config = dash_config) @@ -225,7 +225,7 @@ app_server <- function( input, output, session ) { select_storage_project_out <- dfamodules::mod_select_storage_project_server(id = "select_storage_project_1", asset_view = global_config$asset_view, - input_token = access_token, + access_token = access_token, base_url = global_config$api_base_url) # DATASET SELECTION @@ -233,7 +233,7 @@ app_server <- function( input, output, session ) { dataset_selection <- dfamodules::mod_dataset_selection_server(id = "dataset_selection_1", storage_project_df = select_storage_project_out, asset_view = global_config$asset_view, - input_token = access_token, + access_token = access_token, base_url = global_config$api_base_url) # UPDATE DATA FLOW STATUS SELECTIONS @@ -299,7 +299,7 @@ app_server <- function( input, output, session ) { asset_view = global_config$asset_view, dataset_id = global_config$manifest_dataset_id, manifest_dir = "./manifest", - input_token = access_token, + access_token = access_token, base_url = global_config$api_base_url, schema_url = global_config$schema_url)