From f2d4f5475e4b3942ed6d9675699125cfc5764a57 Mon Sep 17 00:00:00 2001 From: heimannch Date: Fri, 14 Jun 2024 15:57:32 -0700 Subject: [PATCH 1/2] add tab for testing sc cohort selection --- .gitignore | 1 + R/cohort_dataset_selection_server.R | 12 ++++++++++-- R/server.R | 8 ++++++++ R/ui.R | 1 + 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 5b6a065..7b732e7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .Rhistory .RData .Ruserdata +.DS_Store diff --git a/R/cohort_dataset_selection_server.R b/R/cohort_dataset_selection_server.R index 096eea3..8244f7b 100644 --- a/R/cohort_dataset_selection_server.R +++ b/R/cohort_dataset_selection_server.R @@ -13,7 +13,8 @@ cohort_dataset_selection_server <- function( options <- iatlasGraphQLClient::query_datasets(types = dataset_type()) %>% dplyr::select("display", "name") %>% tibble::deframe(.) - if(dataset_type() == "analysis") return(options) + + if(dataset_type() %in% c("analysis", "scrna")) return(options) else return(create_ici_options(options)) #for the ICI Cohort Selection, we have RNA-Seq and Nanostring data. This function returns a list organizing them. }) @@ -27,6 +28,13 @@ cohort_dataset_selection_server <- function( choices = choices(), selected = default_datasets() ) + }else if(dataset_type() == "scrna"){ + shiny::checkboxGroupInput( + inputId = ns("dataset_choices"), + label = "Select Datasets", + choices = choices(), #list scRNA-seq datasets + selected = default_datasets() + ) }else{ #ICI Cohort selection will have two dataset columns, one for RNA-Seq and the other for Nanostring datasets shiny::fluidRow( shiny::column( @@ -52,7 +60,7 @@ cohort_dataset_selection_server <- function( }) dataset_selection <- shiny::reactive({ - if(dataset_type() == "analysis") return(input$dataset_choices) + if(dataset_type() %in% c("analysis", "scrna")) return(input$dataset_choices) else return(c(input$dataset_choices, input$dataset_choices_ns)) #ICI Cohort selection can have RNA-Seq and Nanostring ds selected }) diff --git a/R/server.R b/R/server.R index 026f6db..ffd891c 100644 --- a/R/server.R +++ b/R/server.R @@ -8,6 +8,14 @@ server <- function(input, output, session) { dataset_type = shiny::reactive("ici"), display_module_availibility_string = shiny::reactive(F) ) + + cohort_object3 <- cohort_selection_server( + "scrna_cohort_selection_module", + default_datasets = shiny::reactive(c("MSK", "Vanderbilt")), + default_group = shiny::reactive("Responder"), + dataset_type = shiny::reactive("scrna"), + display_module_availibility_string = shiny::reactive(F) + ) output$cohort_text_output <- shiny::renderText({ shiny::req(cohort_object()) diff --git a/R/ui.R b/R/ui.R index bbc4e68..2d31ca7 100644 --- a/R/ui.R +++ b/R/ui.R @@ -5,6 +5,7 @@ ui <- function() { shiny::tabPanel("Start", shiny::textOutput("cohort_text_output")), shiny::tabPanel("Cohort Selection", cohort_selection_ui("cohort_selection_module")), shiny::tabPanel("ICI Cohort Selection", cohort_selection_ui("ici_cohort_selection_module")), + shiny::tabPanel("scRNAseq Cohort Selection", cohort_selection_ui("scrna_cohort_selection_module")), shiny::tabPanel("Driver Associations", univariate_driver_ui("driver_module")) ) ) From 3b9102efccb8ec4274baa4bd81a4329556fc2af0 Mon Sep 17 00:00:00 2001 From: heimannch Date: Tue, 24 Sep 2024 16:23:06 -0700 Subject: [PATCH 2/2] update links to notebooks --- inst/markdown/cohort_selection1.markdown | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/inst/markdown/cohort_selection1.markdown b/inst/markdown/cohort_selection1.markdown index 7c3079c..893d03f 100644 --- a/inst/markdown/cohort_selection1.markdown +++ b/inst/markdown/cohort_selection1.markdown @@ -1,3 +1,6 @@ Use this module to create your own custom cohort and to specify how cancer genomics samples are grouped and used for contrasts in iAtlas. You can also upload a file to specify the cohort and sample groups. When you are done, cohort and sample group selection will be saved, and used throughout iAtlas. **You can refer back to this module at any time to review or modify your choices.** A summary of your cohort and sample groups is shown at the bottom of this page. -You can also access the iAtlas data by querying our database. Check our Jupyter Notebooks on how to [query the CRI-iAtlas database](https://github.com/CRI-iAtlas/iatlas-notebooks/blob/main/querying_TCGA_features_and_expression.ipynb). Information specific to the immune checkpoint inhibitor data is avaliable in the [Immune Checkpoint Inhibition data available in iAtlas](https://github.com/CRI-iAtlas/iatlas-notebooks/blob/main/ici_query_iatlas_data.ipynb) notebook. \ No newline at end of file +You can also access the iAtlas data by querying our database. We have Jupyter Notebooks detailing how to use the CRI iAtlas API to query our database: +- [Query the TCGA dataset](https://github.com/CRI-iAtlas/iatlas-notebooks/blob/main/querying_TCGA_features_and_expression.ipynb) +- Query the Immune Checkpoint Inhibition datasets [in R](https://github.com/CRI-iAtlas/iatlas-notebooks/blob/main/ici_query_iatlas_data.ipynb) and [in Python](https://github.com/CRI-iAtlas/iatlas-notebooks/blob/main/ici_query_iatlas_data_python.ipynb) +- [Query the pseudobulk single-cell RNAseq data](https://github.com/CRI-iAtlas/iatlas-notebooks/blob/main/query_iatlas_single_cell_datasets.ipynb) \ No newline at end of file