From 7a79d42590f52587bc6dc4c63e72ed412b888aac Mon Sep 17 00:00:00 2001 From: andrewelamb Date: Mon, 14 Aug 2023 09:37:20 -0700 Subject: [PATCH 1/2] fix bug --- R/api_cohorts_queries.R | 2 ++ R/api_functions.R | 3 +-- R/api_tags_queries.R | 60 ++++++++++++++++++++--------------------- 3 files changed, 33 insertions(+), 32 deletions(-) diff --git a/R/api_cohorts_queries.R b/R/api_cohorts_queries.R index 0799888..580aa01 100644 --- a/R/api_cohorts_queries.R +++ b/R/api_cohorts_queries.R @@ -229,7 +229,9 @@ query_cohort_samples <- function( if(nrow(tbl) == 0) return(tbl) else { tbl <- tbl %>% + print() %>% tidyr::unnest(cols = "samples", keep_empty = T) %>% + print() %>% dplyr::select( "cohort_name", "sample_name" = "name", diff --git a/R/api_functions.R b/R/api_functions.R index a90821a..ea854c6 100644 --- a/R/api_functions.R +++ b/R/api_functions.R @@ -30,12 +30,11 @@ perform_api_query <- function( variables, query_file, query_dir = system.file("queries", package = "iatlasGraphQLClient"), - api_url = "https://api.cri-iatlas.org/api" + api_url = "https://api-staging.cri-iatlas.org/api" ){ if(!is.null(.GlobalEnv$API_URL)){ api_url <- .GlobalEnv$API_URL } - api_url <- "https://api-staging.cri-iatlas.org/api" ghql_con <- ghql::GraphqlClient$new(api_url) ghql_query_obj <- ghql::Query$new() query_path <- file.path(query_dir, query_file) diff --git a/R/api_tags_queries.R b/R/api_tags_queries.R index 1506a39..7a5e119 100644 --- a/R/api_tags_queries.R +++ b/R/api_tags_queries.R @@ -61,12 +61,12 @@ query_tags <- function( #' @export #' @importFrom magrittr %>% query_tag_samples <- function( - cohorts = NA, - samples = NA, - datasets = NA, - parent_tags = NA, - tags = NA, - type = NA, + cohorts = NA_character_, + samples = NA_character_, + datasets = NA_character_, + parent_tags = NA_character_, + tags = NA_character_, + type = NA_character_, paging = NA, ... ){ @@ -122,12 +122,12 @@ query_tag_samples <- function( #' @export #' @importFrom magrittr %>% query_tag_samples_parents <- function( - cohorts = NA, - samples = NA, - datasets = NA, - parent_tags = NA, - tags = NA, - type = NA, + cohorts = NA_character_, + samples = NA_character_, + datasets = NA_character_, + parent_tags = NA_character_, + tags = NA_character_, + type = NA_character_, paging = NA, ... ){ @@ -191,12 +191,12 @@ query_tag_samples_parents <- function( #' @export #' @importFrom magrittr %>% query_tag_sample_count <- function( - cohorts = NA, - samples = NA, - datasets = NA, - parent_tags = NA, - tags = NA, - type = NA, + cohorts = NA_character_, + samples = NA_character_, + datasets = NA_character_, + parent_tags = NA_character_, + tags = NA_character_, + type = NA_character_, paging = NA, ... ){ @@ -243,12 +243,12 @@ query_tag_sample_count <- function( #' @export #' @importFrom magrittr %>% query_tag_publications <- function( - cohorts = NA, - samples = NA, - datasets = NA, - parent_tags = NA, - tags = NA, - type = NA, + cohorts = NA_character_, + samples = NA_character_, + datasets = NA_character_, + parent_tags = NA_character_, + tags = NA_character_, + type = NA_character_, paging = NA, ... ){ @@ -316,12 +316,12 @@ query_tag_publications <- function( #' @export #' @importFrom magrittr %>% query_tags_with_parent_tags <- function( - cohorts = NA, - samples = NA, - datasets = NA, - parent_tags = NA, - tags = NA, - type = NA, + cohorts = NA_character_, + samples = NA_character_, + datasets = NA_character_, + parent_tags = NA_character_, + tags = NA_character_, + type = NA_character_, paging = NA, ... ){ From 09ccaf1c43c75daf85aa373df2b007127a7c6600 Mon Sep 17 00:00:00 2001 From: andrewelamb Date: Mon, 14 Aug 2023 09:43:28 -0700 Subject: [PATCH 2/2] remove print statements --- R/api_cohorts_queries.R | 2 -- 1 file changed, 2 deletions(-) diff --git a/R/api_cohorts_queries.R b/R/api_cohorts_queries.R index 580aa01..0799888 100644 --- a/R/api_cohorts_queries.R +++ b/R/api_cohorts_queries.R @@ -229,9 +229,7 @@ query_cohort_samples <- function( if(nrow(tbl) == 0) return(tbl) else { tbl <- tbl %>% - print() %>% tidyr::unnest(cols = "samples", keep_empty = T) %>% - print() %>% dplyr::select( "cohort_name", "sample_name" = "name",