From 0b8cdebea860b565fee79ad844e9e493e3b02738 Mon Sep 17 00:00:00 2001 From: andrewelamb Date: Wed, 13 Apr 2022 12:02:42 -0700 Subject: [PATCH] change package names --- DESCRIPTION | 4 +- R/cohort.R | 16 +++--- R/cohort_dataset_selection_server.R | 2 +- R/cohort_filter_selection_server.R | 2 +- R/cohort_filters.R | 6 +-- R/cohort_group_selection_functions.R | 4 +- R/cohort_group_selection_server.R | 2 +- R/cohort_manual_selection_server.R | 2 +- ...iver_associations_multivariate_functions.R | 2 +- R/driver_associations_multivariate_server.R | 4 +- R/driver_associations_univariate_server.R | 8 +-- R/elements_functions.R | 2 +- R/elements_server.R | 2 +- R/group.R | 10 ++-- renv.lock | 50 +++++++++---------- tests/testthat/helper-globals.R | 20 ++++---- ...iver_associations_multivariate_functions.R | 2 +- tests/testthat/test-model_selection_server.R | 2 +- 18 files changed, 70 insertions(+), 70 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 06536dd..f21d622 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -22,7 +22,7 @@ Imports: DT, dplyr (>= 1.0), forcats (>= 0.5), - iatlas.api.client, + iatlasGraphQLClient, iatlas.modules, magrittr (>= 2.0), plotly(>= 4.9), @@ -42,7 +42,7 @@ Imports: URL: https://github.com/CRI-iAtlas/iatlas.modules2 BugReports: https://github.com/CRI-iAtlas/iatlas.modules2/issues Remotes: - CRI-iAtlas/iatlas.api.client@main, + CRI-iAtlas/iatlasGraphQLClient@main, CRI-iAtlas/iatlas.modules@master Depends: R (>= 2.10) diff --git a/R/cohort.R b/R/cohort.R index 5f5bf28..0a80ef1 100644 --- a/R/cohort.R +++ b/R/cohort.R @@ -40,11 +40,11 @@ Cohort <- R6::R6Class( tibble::deframe(.) dataset_displays <- - iatlas.api.client::query_datasets() %>% + iatlasGraphQLClient::query_datasets() %>% dplyr::filter(.data$name %in% dataset_names) %>% dplyr::pull("display") - feature_tbl <- iatlas.api.client::query_features(cohorts = cohort_names) + feature_tbl <- iatlasGraphQLClient::query_features(cohorts = cohort_names) # set values ---- @@ -91,7 +91,7 @@ Cohort <- R6::R6Class( features = NA, feature_classes = NA, groups = NA ){ tbl <- - iatlas.api.client::query_feature_values( + iatlasGraphQLClient::query_feature_values( cohorts = self$cohort_names, features = features, feature_classes = feature_classes @@ -117,7 +117,7 @@ Cohort <- R6::R6Class( }, get_gene_values = function(entrez = NA, gene_types = NA){ - iatlas.api.client::query_gene_expression( + iatlasGraphQLClient::query_gene_expression( cohorts = self$cohort_names, gene_types = gene_types, entrez = entrez @@ -178,7 +178,7 @@ UploadCohort <- R6::R6Class( stop("group_name must be a column in upload_tbl") } - dataset_sample_tbl <- iatlas.api.client::query_dataset_samples( + dataset_sample_tbl <- iatlasGraphQLClient::query_dataset_samples( samples = upload_tbl$Sample ) @@ -222,7 +222,7 @@ UploadCohort <- R6::R6Class( "dataset_display" ) - feature_tbl <- iatlas.api.client::query_features( + feature_tbl <- iatlasGraphQLClient::query_features( cohorts = dataset_tbl$dataset_name ) @@ -273,7 +273,7 @@ UploadCohort <- R6::R6Class( features = NA, feature_classes = NA, groups = NA ){ tbl <- - iatlas.api.client::query_feature_values( + iatlasGraphQLClient::query_feature_values( cohorts = self$cohort_names, features = features, feature_classes = feature_classes @@ -298,7 +298,7 @@ UploadCohort <- R6::R6Class( return(tbl) }, get_gene_values = function(entrez = NA, gene_types = NA){ - iatlas.api.client::query_gene_expression( + iatlasGraphQLClient::query_gene_expression( cohorts = self$cohort_names, gene_types = gene_types, entrez = entrez diff --git a/R/cohort_dataset_selection_server.R b/R/cohort_dataset_selection_server.R index e93eb8d..5d6b3d1 100644 --- a/R/cohort_dataset_selection_server.R +++ b/R/cohort_dataset_selection_server.R @@ -10,7 +10,7 @@ cohort_dataset_selection_server <- function( ns <- session$ns choices <- shiny::reactive({ - iatlas.api.client::query_datasets(types = dataset_type()) %>% + iatlasGraphQLClient::query_datasets(types = dataset_type()) %>% dplyr::select("display", "name") %>% tibble::deframe(.) }) diff --git a/R/cohort_filter_selection_server.R b/R/cohort_filter_selection_server.R index b11325d..71c3cca 100644 --- a/R/cohort_filter_selection_server.R +++ b/R/cohort_filter_selection_server.R @@ -11,7 +11,7 @@ cohort_filter_selection_server <- function( # group filters ----------------------------------------------------------- group_filter_list <- shiny::reactive({ shiny::req(datasets()) - iatlas.api.client::query_dataset_tags(dataset = datasets()) %>% + iatlasGraphQLClient::query_dataset_tags(dataset = datasets()) %>% dplyr::group_by(.data$tag_name) %>% dplyr::mutate(count = dplyr::n()) %>% dplyr::ungroup() %>% diff --git a/R/cohort_filters.R b/R/cohort_filters.R index ee8169b..9262b23 100644 --- a/R/cohort_filters.R +++ b/R/cohort_filters.R @@ -20,7 +20,7 @@ CohortFilters <- R6::R6Class("CohortFilters", list( }, get_sample_tbl = function(cohorts){ samples <- self$get_samples(cohorts) - sample_tbl <- iatlas.api.client::query_cohort_samples(cohorts = cohorts) + sample_tbl <- iatlasGraphQLClient::query_cohort_samples(cohorts = cohorts) if(length(samples) > 0) { sample_tbl <- dplyr::filter(sample_tbl, .data$sample_name %in% samples) } @@ -79,7 +79,7 @@ CohortNumericFilter <- R6::R6Class("CohortNumericFilter", list( }, get_samples = function(cohorts){ samples <- - iatlas.api.client::query_feature_values( + iatlasGraphQLClient::query_feature_values( cohorts = cohorts, features = self$name, max_value = self$max, @@ -101,7 +101,7 @@ CohortGroupFilter <- R6::R6Class("CohortGroupFilter", list( }, get_samples = function(cohorts){ samples <- - iatlas.api.client::query_tag_samples( + iatlasGraphQLClient::query_tag_samples( cohorts = cohorts, tags = self$values ) %>% dplyr::pull("sample_name") diff --git a/R/cohort_group_selection_functions.R b/R/cohort_group_selection_functions.R index 9449ef7..8034587 100644 --- a/R/cohort_group_selection_functions.R +++ b/R/cohort_group_selection_functions.R @@ -1,5 +1,5 @@ build_tag_group_tbl <- function(datasets){ - tbl <- iatlas.api.client::query_cohorts(datasets = datasets) + tbl <- iatlasGraphQLClient::query_cohorts(datasets = datasets) if(!"tag_name" %in% names(tbl)) { return(dplyr::tibble("display" = character(), "name" = character())) } @@ -24,7 +24,7 @@ build_custom_group_tbl <- function(datasets){ ), dplyr::tibble( "name" = "Immune Feature Bins", - "dataset" = iatlas.api.client::query_datasets(types = "ici")$name + "dataset" = iatlasGraphQLClient::query_datasets(types = "ici")$name ) ) %>% dplyr::filter(.data$dataset %in% datasets) %>% diff --git a/R/cohort_group_selection_server.R b/R/cohort_group_selection_server.R index aa4b9a0..7f0f7ff 100644 --- a/R/cohort_group_selection_server.R +++ b/R/cohort_group_selection_server.R @@ -68,7 +68,7 @@ cohort_group_selection_server <- function( ) mutation_tbl <- shiny::reactive({ - iatlas.api.client::query_mutations(type = "driver_mutation") + iatlasGraphQLClient::query_mutations(type = "driver_mutation") }) output$select_driver_mutation_group_ui <- shiny::renderUI({ diff --git a/R/cohort_manual_selection_server.R b/R/cohort_manual_selection_server.R index 1b4c622..c6cace0 100644 --- a/R/cohort_manual_selection_server.R +++ b/R/cohort_manual_selection_server.R @@ -24,7 +24,7 @@ cohort_manual_selection_server <- function( dataset_feature_tbl <- shiny::reactive({ shiny::req(datasets()) - iatlas.api.client::query_features(cohorts = datasets()) + iatlasGraphQLClient::query_features(cohorts = datasets()) }) group_object <- cohort_group_selection_server( diff --git a/R/driver_associations_multivariate_functions.R b/R/driver_associations_multivariate_functions.R index 849961a..24fb732 100644 --- a/R/driver_associations_multivariate_functions.R +++ b/R/driver_associations_multivariate_functions.R @@ -4,7 +4,7 @@ build_md_tag_covariate_tbl <- function(cohort_obj, cov_obj){ tbl <- purrr::map( parent_tags, - ~iatlas.api.client::query_tag_samples( + ~iatlasGraphQLClient::query_tag_samples( cohorts = cohort_obj$dataset_names, parent_tags = .x ) diff --git a/R/driver_associations_multivariate_server.R b/R/driver_associations_multivariate_server.R index 720b1b2..e81aa57 100644 --- a/R/driver_associations_multivariate_server.R +++ b/R/driver_associations_multivariate_server.R @@ -76,7 +76,7 @@ multivariate_driver_server <- function(id, cohort_obj) { }) status_tbl <- shiny::reactive({ - iatlas.api.client::query_mutation_statuses( + iatlasGraphQLClient::query_mutation_statuses( samples = cohort_obj()$sample_tbl$sample ) %>% dplyr::select( @@ -128,7 +128,7 @@ multivariate_driver_server <- function(id, cohort_obj) { total_associations <- shiny::reactive({ n_mutations <- - iatlas.api.client::query_mutations( + iatlasGraphQLClient::query_mutations( datasets = "TCGA", types = "driver_mutation" ) %>% nrow() diff --git a/R/driver_associations_univariate_server.R b/R/driver_associations_univariate_server.R index 1efcc41..be73d00 100644 --- a/R/driver_associations_univariate_server.R +++ b/R/driver_associations_univariate_server.R @@ -49,7 +49,7 @@ univariate_driver_server <- function(id, cohort_obj) { length(cohort_obj()$group_name) == 1, ) - iatlas.api.client::query_tags( + iatlasGraphQLClient::query_tags( cohorts = cohort_obj()$dataset_names, parent_tags = cohort_obj()$group_name ) %>% @@ -65,7 +65,7 @@ univariate_driver_server <- function(id, cohort_obj) { ) tbl <- - iatlas.api.client::query_driver_results( + iatlasGraphQLClient::query_driver_results( datasets = cohort_obj()$dataset_names, tags = tags(), features = input$response_choice, @@ -88,7 +88,7 @@ univariate_driver_server <- function(id, cohort_obj) { total_associations <- shiny::reactive({ n_mutations <- - iatlas.api.client::query_cohort_mutations( + iatlasGraphQLClient::query_cohort_mutations( cohorts = cohort_obj()$dataset_names ) %>% nrow() @@ -200,7 +200,7 @@ univariate_driver_server <- function(id, cohort_obj) { dplyr::select("sample_name", "feature_value", "group_short_name") status_tbl <- - iatlas.api.client::query_mutation_statuses( + iatlasGraphQLClient::query_mutation_statuses( entrez = selected_volcano_result()$entrez, codes = selected_volcano_result()$mutation_code, types = "driver_mutation", diff --git a/R/elements_functions.R b/R/elements_functions.R index 2005699..3ec2235 100644 --- a/R/elements_functions.R +++ b/R/elements_functions.R @@ -1,6 +1,6 @@ build_tag_filter_list <- function(parent_tag_name, datasets){ - iatlas.api.client::query_tags( + iatlasGraphQLClient::query_tags( cohorts = datasets, parent_tags = parent_tag_name ) %>% diff --git a/R/elements_server.R b/R/elements_server.R index 3de1556..e083416 100644 --- a/R/elements_server.R +++ b/R/elements_server.R @@ -36,7 +36,7 @@ numeric_filter_element_server <- function( features_tbl <- shiny::reactive({ shiny::req(datasets(), input$numeric_choice) tbl <- - iatlas.api.client::query_features_range( + iatlasGraphQLClient::query_features_range( cohorts = datasets(), features = input$numeric_choice ) %>% diff --git a/R/group.R b/R/group.R index 787330f..b29c70c 100644 --- a/R/group.R +++ b/R/group.R @@ -21,7 +21,7 @@ TagGroup <- R6::R6Class( } group_display <- group_name %>% - iatlas.api.client::query_tags(tags = .) %>% + iatlasGraphQLClient::query_tags(tags = .) %>% dplyr::pull("tag_short_display") if(length(group_display) == 0) { @@ -29,7 +29,7 @@ TagGroup <- R6::R6Class( } cohort_names <- - iatlas.api.client::query_cohorts( + iatlasGraphQLClient::query_cohorts( datasets = dataset_names, tags = group_name ) %>% @@ -98,7 +98,7 @@ FeatureBinGroup <- R6::R6Class( initialize = function(dataset_names, feature_name, feature_bins){ feature_display <- - iatlas.api.client::query_features(features = feature_name) %>% + iatlasGraphQLClient::query_features(features = feature_name) %>% dplyr::pull("display") group_name = stringr::str_c("Immune Feature Bins: ", feature_display) @@ -113,7 +113,7 @@ FeatureBinGroup <- R6::R6Class( }, get_tables = function(sample_tbl){ - sample_tbl <- iatlas.api.client::query_feature_values( + sample_tbl <- iatlasGraphQLClient::query_feature_values( features = self$feature_name, cohorts = self$dataset_names ) %>% dplyr::mutate("group_name" = as.character(cut(.data$feature_value, self$feature_bins))) %>% @@ -172,7 +172,7 @@ MutationStatusGroup <- R6::R6Class( get_tables = function(sample_tbl){ sample_tbl <- - iatlas.api.client::query_mutation_statuses( + iatlasGraphQLClient::query_mutation_statuses( mutations = self$mutation_name, cohorts = self$cohort_names ) %>% diff --git a/renv.lock b/renv.lock index acb1918..812859b 100644 --- a/renv.lock +++ b/renv.lock @@ -637,31 +637,6 @@ "openssl" ] }, - "iatlas.api.client": { - "Package": "iatlas.api.client", - "Version": "0.29.0", - "Source": "GitHub", - "RemoteType": "github", - "RemoteUsername": "CRI-iAtlas", - "RemoteRepo": "iatlas.api.client", - "RemoteRef": "main", - "RemoteSha": "3a919b12e4afbd41ae6b23f756c8aebd2ce76d29", - "RemoteHost": "api.github.com", - "Hash": "fe91864da09cdacdb3cbac7617b9f4e1", - "Requirements": [ - "assertthat", - "dplyr", - "ghql", - "jsonlite", - "magrittr", - "purrr", - "rlang", - "snakecase", - "stringr", - "tibble", - "tidyr" - ] - }, "iatlas.modules": { "Package": "iatlas.modules", "Version": "0.9.0", @@ -696,6 +671,31 @@ "viridis" ] }, + "iatlasGraphQLClient": { + "Package": "iatlasGraphQLClient", + "Version": "0.1.0", + "Source": "GitHub", + "RemoteType": "github", + "RemoteHost": "api.github.com", + "RemoteUsername": "CRI-iAtlas", + "RemoteRepo": "iatlasGraphQLClient", + "RemoteRef": "main", + "RemoteSha": "d97a8b7c4162ee0f31f717ff4b2e7c61ae77edca", + "Hash": "92d3a568c2fbd8b97267dc67a5f4a9c1", + "Requirements": [ + "assertthat", + "dplyr", + "ghql", + "jsonlite", + "magrittr", + "purrr", + "rlang", + "snakecase", + "stringr", + "tibble", + "tidyr" + ] + }, "ini": { "Package": "ini", "Version": "0.3.1", diff --git a/tests/testthat/helper-globals.R b/tests/testthat/helper-globals.R index d1026bc..24efe65 100644 --- a/tests/testthat/helper-globals.R +++ b/tests/testthat/helper-globals.R @@ -1,31 +1,31 @@ get_tcga_samples_tbl <- memoise::memoise( function(){ - iatlas.api.client::query_cohort_samples(cohorts = "TCGA") + iatlasGraphQLClient::query_cohort_samples(cohorts = "TCGA") } ) get_tcga_study_samples_tbl <- memoise::memoise( function(){ - iatlas.api.client::query_cohort_samples(cohorts = "TCGA_TCGA_Study") + iatlasGraphQLClient::query_cohort_samples(cohorts = "TCGA_TCGA_Study") } ) get_tcga_immune_subtypes_samples_tbl <- memoise::memoise( function(){ - iatlas.api.client::query_cohort_samples(cohorts = "TCGA_Immune_Subtype") + iatlasGraphQLClient::query_cohort_samples(cohorts = "TCGA_Immune_Subtype") } ) get_pcawg_gender_samples_tbl <- memoise::memoise( function(){ - iatlas.api.client::query_cohort_samples(cohorts = "PCAWG_Gender") + iatlasGraphQLClient::query_cohort_samples(cohorts = "PCAWG_Gender") } ) get_ici_samples_tbl <- memoise::memoise( function(){ cohorts <- c("Gide_Cell_2019_Responder", "HugoLo_IPRES_2016_Responder") - iatlas.api.client::query_cohort_samples(cohorts = cohorts) + iatlasGraphQLClient::query_cohort_samples(cohorts = cohorts) } ) @@ -43,25 +43,25 @@ get_tcga_samples_50 <- memoise::memoise( get_tcga_features_tbl <- memoise::memoise( function(){ - iatlas.api.client::query_features(cohorts = "TCGA") + iatlasGraphQLClient::query_features(cohorts = "TCGA") } ) get_ici_features_tbl <- memoise::memoise( function(){ - iatlas.api.client::query_features(cohorts = c("Gide_Cell_2019_Responder", "HugoLo_IPRES_2016_Responder")) + iatlasGraphQLClient::query_features(cohorts = c("Gide_Cell_2019_Responder", "HugoLo_IPRES_2016_Responder")) } ) get_pcawg_samples_tbl <- memoise::memoise( function(){ - iatlas.api.client::query_cohort_samples(cohorts = "PCAWG") + iatlasGraphQLClient::query_cohort_samples(cohorts = "PCAWG") } ) get_pcawg_study_samples_tbl <- memoise::memoise( function(){ - iatlas.api.client::query_cohort_samples(cohorts = "PCAWG_PCAWG_Study") + iatlasGraphQLClient::query_cohort_samples(cohorts = "PCAWG_PCAWG_Study") } ) @@ -79,7 +79,7 @@ get_pcawg_samples_50 <- memoise::memoise( get_pcawg_features_tbl <- memoise::memoise( function(){ - iatlas.api.client::query_features(cohorts = "PCAWG") + iatlasGraphQLClient::query_features(cohorts = "PCAWG") } ) diff --git a/tests/testthat/test-driver_associations_multivariate_functions.R b/tests/testthat/test-driver_associations_multivariate_functions.R index 59ebc64..fc47f01 100644 --- a/tests/testthat/test-driver_associations_multivariate_functions.R +++ b/tests/testthat/test-driver_associations_multivariate_functions.R @@ -72,7 +72,7 @@ test_that("Build Multivariate Driver Response Tibble", { ) }) -status_tbl1 <- iatlas.api.client::query_mutation_statuses( +status_tbl1 <- iatlasGraphQLClient::query_mutation_statuses( samples = cohort_obj1$sample_tbl$sample_name, entrez = 1, ) %>% diff --git a/tests/testthat/test-model_selection_server.R b/tests/testthat/test-model_selection_server.R index 3935b48..a338b86 100644 --- a/tests/testthat/test-model_selection_server.R +++ b/tests/testthat/test-model_selection_server.R @@ -1,4 +1,4 @@ -numerical_covariate_tbl <- iatlas.api.client::query_features() %>% +numerical_covariate_tbl <- iatlasGraphQLClient::query_features() %>% dplyr::select("class", "display", "feature" = "name") %>% shiny::reactiveVal()