diff --git a/.Rprofile b/.Rprofile index 3843d01..9580bb1 100644 --- a/.Rprofile +++ b/.Rprofile @@ -1,5 +1,3 @@ -source("renv/activate.R") - .First <- function() { options( repos = c( @@ -7,4 +5,6 @@ source("renv/activate.R") SAGE = "http://ran.synapse.org" ) ) -} \ No newline at end of file +} + +source("renv/activate.R") \ No newline at end of file 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 index 814c400..fcfb358 100644 --- a/.github/workflows/shinyapps_deploy.yml +++ b/.github/workflows/shinyapps_deploy.yml @@ -20,17 +20,16 @@ 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 }} + 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 + 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 @@ -45,7 +44,9 @@ jobs: # deploy app using rsconnect - name: Authorize and deploy app run: | + renv::restore() install.packages("rsconnect") + refName <- Sys.getenv("GITHUB_REF_NAME") repo <- Sys.getenv("GITHUB_REPOSITORY") appName <- strsplit(repo, "/")[[1]][2] diff --git a/DESCRIPTION b/DESCRIPTION index 5dfdb9f..6c678c3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,34 +1,36 @@ 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? +License: MIT + file LICENSE Imports: attempt, - config (>= 0.3.1), + config, dcamodules, + dfamodules, dplyr, DT, - ggplot2, glue, - golem (>= 0.3.1), + golem, htmltools, - lubridate, + jsonlite, magrittr, pkgload, processx, - reticulate, - shiny (>= 1.7.1), - shinydashboard, - shinydashboardPlus, - shinyjs, - waiter + shiny, + shinyjs Encoding: UTF-8 LazyData: true RoxygenNote: 7.2.3 Suggests: spelling, - testthat (>= 3.0.0) + testthat, + devtools, + usethis, + renv Config/testthat/edition: 3 Language: en-US +Remotes: + Sage-Bionetworks/dcamodules, + Sage-Bionetworks/dfamodules diff --git a/NAMESPACE b/NAMESPACE index 5d9c9fc..da9e7bc 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,32 +1,7 @@ # 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) @@ -34,6 +9,4 @@ 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/app_server.R b/R/app_server.R index 2a4bfd0..f926798 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::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 <- 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, + access_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, + access_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", + access_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 )))) 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/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()) { 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/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 -} diff --git a/man/update_manifest_add_datasets.Rd b/man/update_manifest_add_datasets.Rd deleted file mode 100644 index 78ec608..0000000 --- a/man/update_manifest_add_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_add_datasets} -\alias{update_manifest_add_datasets} -\title{Update manifest with new datasets found in Synapse} -\usage{ -update_manifest_add_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{ -Update manifest with new datasets found in Synapse -} 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 -} diff --git a/renv.lock b/renv.lock index 35f9d73..e3bc822 100644 --- a/renv.lock +++ b/renv.lock @@ -5,16 +5,30 @@ { "Name": "CRAN", "URL": "https://cran.rstudio.com" + }, + { + "Name": "SAGE", + "URL": "http://ran.synapse.org" } ] }, "Packages": { + "DBI": { + "Package": "DBI", + "Version": "1.1.2", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "methods" + ], + "Hash": "dcd1743af4336156873e3ce3c950b8b9" + }, "DT": { "Package": "DT", - "Version": "0.26", + "Version": "0.27", "Source": "Repository", "Repository": "CRAN", - "Hash": "c66a72c4d3499e14ae179ccb742e740a", "Requirements": [ "crosstalk", "htmltools", @@ -23,147 +37,213 @@ "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.9", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "e9c08b94391e9f3f97355841229124f2", - "Requirements": [] - }, - "RcppTOML": { - "Package": "RcppTOML", - "Version": "0.1.7", + "Version": "1.0.10", "Source": "Repository", "Repository": "CRAN", - "Hash": "f8a578aa91321ecec1292f1e2ffadeda", "Requirements": [ - "Rcpp" - ] + "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", - "Hash": "50c838a310445e954bc13f26f26a6ecf", - "Requirements": [] + "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", - "Hash": "f36715f14d94678eea9933af927bc15d", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "f36715f14d94678eea9933af927bc15d" }, "bit64": { "Package": "bit64", "Version": "4.0.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "9fe98599ca456d6552421db0d6772d8f", "Requirements": [ - "bit" - ] + "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", @@ -171,159 +251,220 @@ "mime", "rlang", "sass" - ] + ], + "Hash": "a7fbf03946ad741129dc81098722fca1" }, "cachem": { "Package": "cachem", - "Version": "1.0.6", + "Version": "1.0.7", "Source": "Repository", "Repository": "CRAN", - "Hash": "648c5b3d71e6a37e3043617489a0a0e9", "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.5.0", + "Version": "3.6.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "eb9fc121ad9a1075c471107ef185be46", - "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.0-3", + "Version": "2.1-0", "Source": "Repository", "Repository": "CRAN", - "Hash": "bb4341986bc8b914f0f0acf2e4a3f2f7", - "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.8.1", + "Version": "1.9.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "b6e3e947d1d7ebf3d2bdcea1bde63fe7", - "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", - "Hash": "6aa54f69598c32177e920eb3402e8293", "Requirements": [ "R6", "htmltools", "jsonlite", "lazyeval" - ] + ], + "Hash": "6aa54f69598c32177e920eb3402e8293" }, "curl": { "Package": "curl", - "Version": "4.3.3", + "Version": "5.0.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "0eb86baa62f06e8855258fa5a8048667", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "e4f97056611e8e6b8b852d13b7400cf1" }, "data.table": { "Package": "data.table", "Version": "1.14.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "36b67b5adf57b292923f5659f5f0c853", - "Requirements": [] + "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", "Version": "0.1.0", "Source": "GitHub", - "Remotes": "Sage-Bionetworks/sagethemes", "RemoteType": "github", "RemoteHost": "api.github.com", - "RemoteRepo": "dcamodules", "RemoteUsername": "Sage-Bionetworks", - "RemoteRef": "HEAD", - "RemoteSha": "3c7765f4b21ef898d1794fc3a58b356ba3721822", - "Hash": "a55df0a1785e77ba98d2800e1f4cf531", + "RemoteRepo": "dcamodules", + "RemoteRef": "main", + "RemoteSha": "1e14dcfbdaa2913eeeacc12acaac1c8264bac1f7", + "Remotes": "Sage-Bionetworks/sagethemes", "Requirements": [ "base64enc", "colourpicker", @@ -336,27 +477,30 @@ "shiny", "shinydashboard", "waiter" - ] + ], + "Hash": "613cdfc41c99661f9d1afe2acf4c067b" }, "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", @@ -374,37 +518,77 @@ "roxygen2", "rversions", "sessioninfo", + "stats", "testthat", + "tools", "urlchecker", "usethis", + "utils", "withr" - ] + ], + "Hash": "ea5bc8b4a6a01e4f12d98b58329930bb" + }, + "dfamodules": { + "Package": "dfamodules", + "Version": "0.0.0.9002", + "Source": "GitHub", + "RemoteType": "github", + "RemoteHost": "api.github.com", + "RemoteUsername": "Sage-Bionetworks", + "RemoteRepo": "dfamodules", + "RemoteRef": "main", + "RemoteSha": "2441a1870dcb09a26fcc619c9806c17f97993754", + "Requirements": [ + "DT", + "dplyr", + "ggplot2", + "glue", + "htmltools", + "httr", + "jsonlite", + "magrittr", + "purrr", + "rlang", + "shiny", + "shinydashboard", + "shinyjs", + "waiter" + ], + "Hash": "b6b72de8c0e35c363724520742e5d51b" }, "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", @@ -415,147 +599,198 @@ "vctrs", "withr", "yaml" - ] + ], + "Hash": "79bf3f66590752ffbba20f8d2da94c7c" }, "dplyr": { "Package": "dplyr", - "Version": "1.0.10", + "Version": "1.1.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "539412282059f7f0c07295723d23f987", "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.19", + "Version": "0.20", "Source": "Repository", "Repository": "CRAN", - "Hash": "5aac3cd0a3ccb1a738941796b28c26fe", - "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.3", + "Version": "1.0.4", "Source": "Repository", "Repository": "CRAN", - "Hash": "83a8afdbe71839506baa9f90eebad7ec", - "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.0", + "Version": "1.1.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "77bd60a6157420d4ffa93b27cf6a58b8", - "Requirements": [] + "Hash": "f7736a18de97dea803bde0a2daaafb27" }, "fontawesome": { "Package": "fontawesome", - "Version": "0.4.0", + "Version": "0.5.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "c5a628c2570aa86a96cc6ef739d8bfda", "Requirements": [ + "R", "htmltools", "rlang" - ] + ], + "Hash": "1e22b8cabbad1eae951a75e9f8b52378" }, "forcats": { "Package": "forcats", "Version": "0.5.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "81c3244cab67468aac4c60550832655d", "Requirements": [ + "R", "ellipsis", "magrittr", "rlang", "tibble" - ] + ], + "Hash": "81c3244cab67468aac4c60550832655d" }, - "fresh": { - "Package": "fresh", - "Version": "0.2.0", + "fs": { + "Package": "fs", + "Version": "1.6.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "fa54367040deb4537da49b7ac0ee5770", "Requirements": [ - "htmltools", - "rstudioapi", - "sass", - "shiny" - ] + "R", + "methods" + ], + "Hash": "94af08e0aa9675a16fadbb3aaaa90d2a" }, - "fs": { - "Package": "fs", - "Version": "1.5.2", + "gargle": { + "Package": "gargle", + "Version": "1.2.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "7c89603d81793f0d5486d91ab1fc6f1d", - "Requirements": [] + "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", @@ -563,423 +798,584 @@ "rstudioapi", "sys", "zip" - ] + ], + "Hash": "9122b3958e749badb5c939f498038b57" }, "ggplot2": { "Package": "ggplot2", - "Version": "3.4.0", + "Version": "3.4.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "fd2aab12f54400c6bca43687231e246b", "Requirements": [ "MASS", + "R", "cli", "glue", + "grDevices", + "grid", "gtable", "isoband", "lifecycle", "mgcv", "rlang", "scales", + "stats", "tibble", "vctrs", "withr" - ] + ], + "Hash": "3a147ee02e85a8941aad9909f1b43b7b" }, "gh": { "Package": "gh", - "Version": "1.3.1", + "Version": "1.4.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "b6a12054ee13dce0f6696c019c10e539", "Requirements": [ + "R", "cli", "gitcreds", - "httr", + "httr2", "ini", - "jsonlite" - ] + "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.3.5", + "Version": "0.4.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "c4fbd853653f38cccdd009d75abb344c", "Requirements": [ + "R", "attempt", - "cli", "config", - "crayon", - "desc", - "fs", "here", "htmltools", - "pkgload", - "roxygen2", - "rstudioapi", + "rlang", "shiny", - "usethis", + "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.1", + "Version": "0.3.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "36b4265fb818f6a342bed217549cd896", - "Requirements": [] + "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", - "Hash": "5b8a2dd0fdbe2ab4f6081e6c7be6dfca", "Requirements": [ "ellipsis", "lifecycle", + "methods", "pkgconfig", "rlang", "vctrs" - ] + ], + "Hash": "5b8a2dd0fdbe2ab4f6081e6c7be6dfca" }, "htmltools": { "Package": "htmltools", - "Version": "0.5.4", + "Version": "0.5.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "9d27e99cc90bd701c0a7a63e5923f9b7", "Requirements": [ + "R", "base64enc", "digest", "ellipsis", "fastmap", - "rlang" - ] + "grDevices", + "rlang", + "utils" + ], + "Hash": "ba0240784ad50a62165058a27459304a" }, "htmlwidgets": { "Package": "htmlwidgets", - "Version": "1.6.0", + "Version": "1.6.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "f894e7b76e36258a483c602a786d7270", "Requirements": [ + "grDevices", "htmltools", "jsonlite", "knitr", "rmarkdown", "yaml" - ] + ], + "Hash": "a865aa85bcb2697f47505bfd70422471" }, "httpuv": { "Package": "httpuv", - "Version": "1.6.7", + "Version": "1.6.9", "Source": "Repository", "Repository": "CRAN", - "Hash": "13fdc650c853fffbffee66b2a5b9fdbf", "Requirements": [ + "R", "R6", "Rcpp", "later", - "promises" - ] + "promises", + "utils" + ], + "Hash": "1046aa31a57eae8b357267a56a0b6d8b" }, "httr": { "Package": "httr", - "Version": "1.4.4", + "Version": "1.4.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "57557fac46471f0dbbf44705cc6a5c8c", "Requirements": [ + "R", "R6", "curl", "jsonlite", "mime", "openssl" - ] + ], + "Hash": "f6844033201269bec3ca0097bc6c97b3" + }, + "httr2": { + "Package": "httr2", + "Version": "0.2.2", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "R6", + "cli", + "curl", + "glue", + "magrittr", + "openssl", + "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": [] - }, - "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" - ] + "methods" + ], + "Hash": "a4269a09a9b865579b2635c77e572374" }, "knitr": { "Package": "knitr", - "Version": "1.41", + "Version": "1.42", "Source": "Repository", "Repository": "CRAN", - "Hash": "6d4971f3610e75220534a1befe81bc92", "Requirements": [ + "R", "evaluate", "highr", - "stringr", + "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", - "Hash": "d908914ae53b04d4c0c0fd72ecc35370", - "Requirements": [] + "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.0", + "Version": "1.9.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "2af4550c2f0f7fbe7cbbf3dbf4ea3902", "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.5", + "Version": "2.0.6", "Source": "Repository", "Repository": "CRAN", - "Hash": "b04c27110bf367b4daa93f34f3d58e75", "Requirements": [ "askpass" - ] + ], + "Hash": "0f7cd2962e3044bb940cca4f4b5cecbe" }, "parsedate": { "Package": "parsedate", "Version": "1.3.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "7f5024cc7af45eeecef657fa62beb568", - "Requirements": [] + "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.8.1", + "Version": "1.9.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "f2316df30902c81729ae9de95ad5a608", "Requirements": [ "cli", "fansi", @@ -987,41 +1383,47 @@ "lifecycle", "rlang", "utf8", + "utils", "vctrs" - ] + ], + "Hash": "15da5a8412f317beeee6175fbc76f4bb" }, "pkgbuild": { "Package": "pkgbuild", - "Version": "1.3.1", + "Version": "1.4.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "66d2adfed274daf81ccfe77d974c3b9b", "Requirements": [ + "R", "R6", "callr", "cli", "crayon", "desc", "prettyunits", + "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", @@ -1042,186 +1444,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" - ] - }, - "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" - ] + ], + "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.0", + "Version": "3.8.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "a33ee2d9bf07564efb888ad98410da84", "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", - "Hash": "14dc9f7a3c91ebb14ec5bb9208a07061", "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.2", + "Version": "1.7.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "68dd03d98a5efd1eb3012436de45ba83", - "Requirements": [] + "Requirements": [ + "R", + "utils" + ], + "Hash": "709d852d33178db54b17c722e5b1e594" }, "purrr": { "Package": "purrr", - "Version": "1.0.0", + "Version": "1.0.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "1ad491d27989ec6c26a2918ad6df116b", "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" - ] - }, - "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", @@ -1233,17 +1607,19 @@ "prettyunits", "rprojroot", "sessioninfo", + "utils", "withr", "xopen" - ] + ], + "Hash": "8f25ebe2ec38b1f2aef3b0d2ef76f6c4" }, "readr": { "Package": "readr", "Version": "2.1.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "9c59de1357dc209868b5feb5c9f0fe2f", "Requirements": [ + "R", "R6", "cli", "clipr", @@ -1251,69 +1627,97 @@ "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", - "Requirements": [] + "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.16.0", + "Version": "0.17.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "c9e8442ab69bc21c9697ecf856c1e6c7", - "Requirements": [] + "Requirements": [ + "utils" + ], + "Hash": "4543b8cd233ae25c6aba8548be9e747e" }, - "reticulate": { - "Package": "reticulate", - "Version": "1.26", + "reprex": { + "Package": "reprex", + "Version": "2.0.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "91c176c84a2e3558572d2cbaddc08bd4", "Requirements": [ - "Matrix", - "Rcpp", - "RcppTOML", - "here", - "jsonlite", - "png", - "rappdirs", + "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", - "Hash": "e0880f6783f720d136755fb92d63c78b", "Requirements": [ "R6", "assertthat", @@ -1332,45 +1736,55 @@ "rcmdcheck", "rematch", "tibble", + "utils", "uuid", "whoami", "withr" - ] + ], + "Hash": "e0880f6783f720d136755fb92d63c78b" }, "rlang": { "Package": "rlang", - "Version": "1.0.6", + "Version": "1.1.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "4ed1f8336c8d52c3e750adcdc57228a7", - "Requirements": [] + "Requirements": [ + "R", + "utils" + ], + "Hash": "a85c767b55f0bf9b7ad16c6d7baee5bb" }, "rmarkdown": { "Package": "rmarkdown", - "Version": "2.19", + "Version": "2.21", "Source": "Repository", "Repository": "CRAN", - "Hash": "4e29299e1f4c7eabb0b8365b338adf3c", "Requirements": [ + "R", "bslib", "evaluate", + "fontawesome", "htmltools", "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", @@ -1378,49 +1792,54 @@ "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", - "Hash": "bb099886deffecd6f9b298b7d4492943", "Requirements": [ + "R", "httr", "lifecycle", "magrittr", @@ -1428,7 +1847,8 @@ "selectr", "tibble", "xml2" - ] + ], + "Hash": "bb099886deffecd6f9b298b7d4492943" }, "sagethemes": { "Package": "sagethemes", @@ -1440,37 +1860,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.4", + "Version": "0.4.5", "Source": "Repository", "Repository": "CRAN", - "Hash": "c76cbac7ca04ce82d8c38e29729987a3", "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", @@ -1479,36 +1901,42 @@ "munsell", "rlang", "viridisLite" - ] + ], + "Hash": "906cb23d2f1c5680b8ce439b44c6fa63" }, "selectr": { "Package": "selectr", "Version": "0.4-2", "Source": "Repository", "Repository": "CRAN", - "Hash": "3838071b66e0c566d55cc26bd6e27bf4", "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", @@ -1518,94 +1946,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" - ] - }, - "shinydashboardPlus": { - "Package": "shinydashboardPlus", - "Version": "2.0.3", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "5045276dcad7ad9b785d593b1a710681", - "Requirements": [ - "fresh", - "htmltools", - "lifecycle", "shiny", - "shinydashboard", - "waiter" - ] + "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", + "Version": "0.1.7-1", "Source": "Repository", "Repository": "CRAN", - "Hash": "947e4e02a79effa5d512473e10f41797", - "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.8", + "Version": "1.7.12", "Source": "Repository", "Repository": "CRAN", - "Hash": "a68b980681bcbc84c7a67003fa796bfb", - "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", @@ -1613,55 +2041,34 @@ "rlang", "stringi", "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" - ] + ], + "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", @@ -1673,49 +2080,56 @@ "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.1.8", + "Version": "3.2.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "56b6934ef0f8c68225949a8672fe1a8f", "Requirements": [ + "R", "fansi", "lifecycle", "magrittr", + "methods", "pillar", "pkgconfig", "rlang", + "utils", "vctrs" - ] + ], + "Hash": "a84e2cc86d07289b3b6f5069df7a004c" }, "tidyr": { "Package": "tidyr", "Version": "1.2.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "d8b95b7fee945d7da6888cf7eb71a49c", "Requirements": [ + "R", "cpp11", "dplyr", "ellipsis", @@ -1726,73 +2140,119 @@ "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.1.1", + "Version": "0.2.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "4657195cc632097bb8d140d626b519fb", "Requirements": [ + "R", "cpp11" - ] + ], + "Hash": "8548b44f79a35ba1791308b61e6012d7" }, "tinytex": { "Package": "tinytex", - "Version": "0.43", + "Version": "0.45", "Source": "Repository", "Repository": "CRAN", - "Hash": "facc02f3d63ed7dd765513c004c394ce", "Requirements": [ "xfun" - ] + ], + "Hash": "e4e357f28c2edff493936b6cb30c3d65" }, "tzdb": { "Package": "tzdb", "Version": "0.3.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "b2e1cbce7c903eaf23ec05c58e59fb5e", "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", @@ -1809,55 +2269,65 @@ "rlang", "rprojroot", "rstudioapi", + "stats", + "utils", "whisker", "withr", "yaml" - ] + ], + "Hash": "a67a22c201832b12c036cc059f1d137d" }, "utf8": { "Package": "utf8", - "Version": "1.2.2", + "Version": "1.2.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "c9c462b759a5cc844ae25b5942654d13", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "1fe17157424bb09c48a8b3b550c753bc" }, "uuid": { "Package": "uuid", "Version": "1.1-0", "Source": "Repository", "Repository": "CRAN", - "Hash": "f1cb46c157d080b729159d407be83496", - "Requirements": [] + "Requirements": [ + "R" + ], + "Hash": "f1cb46c157d080b729159d407be83496" }, "vctrs": { "Package": "vctrs", - "Version": "0.5.1", + "Version": "0.6.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "970324f6572b4fd81db507b5d4062cb0", "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", - "Hash": "976507b5a105bc3bdf6a5a5f29e0684f", "Requirements": [ + "R", "bit64", "cli", "cpp11", @@ -1865,131 +2335,137 @@ "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" - ] - }, - "webshot": { - "Package": "webshot", - "Version": "0.5.4", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "cfd9342c76693ae53108a474aafa1641", - "Requirements": [ - "callr", - "jsonlite", - "magrittr" - ] + ], + "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", - "Hash": "ef0f4d9b8f2cc2ebeccae1d725b8a023", "Requirements": [ "httr", - "jsonlite" - ] + "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.36", + "Version": "0.39", "Source": "Repository", "Repository": "CRAN", - "Hash": "f5baec54606751aa53ac9c0e05848ed6", - "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.6", + "Version": "2.3.7", "Source": "Repository", "Repository": "CRAN", - "Hash": "9b570515751dcbae610f29885e025b41", - "Requirements": [] + "Hash": "0d0056cc5383fbc240ccd0cb584bf436" }, "zip": { "Package": "zip", "Version": "2.2.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "c42bfcec3fa6a0cce17ce1f8bc684f88", - "Requirements": [] + "Hash": "c42bfcec3fa6a0cce17ce1f8bc684f88" } } } diff --git a/renv/activate.R b/renv/activate.R index 019b5a6..a8fdc32 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() @@ -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) } 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 +} 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