Skip to content

Commit

Permalink
Merge pull request #35 from CRI-iAtlas/add_sc_cohort_selection
Browse files Browse the repository at this point in the history
Add sc cohort selection
  • Loading branch information
heimannch authored Sep 25, 2024
2 parents ee1829e + 6f23e24 commit be5aa0f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
.Rhistory
.RData
.Ruserdata
.DS_Store
.DS_Store
14 changes: 11 additions & 3 deletions R/cohort_dataset_selection_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
})

Expand All @@ -36,7 +37,14 @@ cohort_dataset_selection_server <- function(
choices = choices(),
selected = default_datasets()
)
}else{
}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(
width = 6,
Expand All @@ -63,7 +71,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
})

Expand Down
3 changes: 2 additions & 1 deletion R/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ server <- function(input, output, session) {
dataset_type = shiny::reactive("ici"),
display_module_availibility_string = shiny::reactive(F)
)

cohort_object3 <- cohort_selection_server(
"sc_cohort_selection_module",
"scrna_cohort_selection_module",
default_datasets = shiny::reactive(c("MSK", "Vanderbilt")),
default_group = shiny::reactive("Responder"),
dataset_type = shiny::reactive("scrna"),
Expand Down
2 changes: 1 addition & 1 deletion R/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +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("SC Cohort Selection", cohort_selection_ui("sc_cohort_selection_module")),
shiny::tabPanel("scRNAseq Cohort Selection", cohort_selection_ui("scrna_cohort_selection_module")),
shiny::tabPanel("Driver Associations", univariate_driver_ui("driver_module"))
)
)
Expand Down
8 changes: 4 additions & 4 deletions inst/markdown/cohort_selection1.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +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:
- [Query the CRI-iAtlas database, get TCGA features and expression](https://github.com/CRI-iAtlas/iatlas-notebooks/blob/main/querying_TCGA_features_and_expression.ipynb)
- [Immune Checkpoint Inhibition data available in iAtlas](https://github.com/CRI-iAtlas/iatlas-notebooks/blob/main/ici_query_iatlas_data.ipynb)
- [Single-cell RNA-seq data available in iAtlas](https://github.com/CRI-iAtlas/iatlas-notebooks/blob/main/query_iatlas_single_cell_datasets.ipynb)
You can also access the CRI 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)

0 comments on commit be5aa0f

Please sign in to comment.