-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from allaway/drug-selector
Drug selector
- Loading branch information
Showing
6 changed files
with
123 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#' cell_line_selector UI Function | ||
#' | ||
#' @description A shiny Module. | ||
#' | ||
#' @param id,input,output,session Internal parameters for {shiny}. | ||
#' | ||
#' @noRd | ||
#' | ||
#' @importFrom shiny NS tagList | ||
mod_cell_line_selector_ui <- function(id){ | ||
ns <- NS(id) | ||
tagList( | ||
box( | ||
column(checkboxGroupInput(ns("nf1_genotypes"),label = "NF1 Genotype", choices = unique(kairos::drug_screening$nf1Genotype), | ||
selected = unique(kairos::drug_screening$nf1Genotype)), | ||
width = 2), | ||
column(checkboxGroupInput(ns("nf2_genotypes"),label = "NF2 Genotype", choices = unique(kairos::drug_screening$nf2Genotype), | ||
selected = unique(kairos::drug_screening$nf2Genotype)), | ||
width = 2), | ||
checkboxGroupInput(ns("nf2_knockdowns"),label = "NF1 Knockdowns", choices = unique(kairos::drug_screening$nf1Knockdown), | ||
selected = unique(kairos::drug_screening$nf1Knockdown)), | ||
checkboxGroupInput(ns("nf2_knockdowns"),label = "NF2 Knockdowns", choices = unique(kairos::drug_screening$nf2Knockdown), | ||
selected = unique(kairos::drug_screening$nf2Knockdown)), | ||
width = 12), | ||
box("Selected Cell Lines:", | ||
DT::dataTableOutput(ns("cell_lines_table")), | ||
width = 12) | ||
) | ||
} | ||
|
||
#' cell_line_selector Server Function | ||
#' | ||
#' @noRd | ||
mod_cell_line_selector_server <- function(input, output, session){ | ||
ns <- session$ns | ||
|
||
models <- reactive({ | ||
kairos::drug_screening %>% | ||
dplyr::select(model_name, disease_name, symptom_name, nf1Genotype, nf2Genotype, nf1Knockdown, nf2Knockdown) %>% | ||
dplyr::distinct() | ||
}) | ||
|
||
output$cell_lines_table <- DT::renderDataTable({ | ||
models() %>% dplyr::filter(nf1Genotype %in% input$nf1_genotypes, | ||
nf2Genotype %in% input$nf2_genotypes) | ||
}) | ||
|
||
cell_lines <- reactive({models() %>% | ||
purrr::pluck('model_name') %>% | ||
unique()}) | ||
} | ||
|
||
## To be copied in the UI | ||
# mod_cell_line_selector_ui("cell_line_selector_ui_1") | ||
|
||
## To be copied in the server | ||
# callModule(mod_cell_line_selector_server, "cell_line_selector_ui_1") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#' compound_selector UI Function | ||
#' | ||
#' @description A shiny Module. | ||
#' | ||
#' @param id,input,output,session Internal parameters for {shiny}. | ||
#' | ||
#' @noRd | ||
#' | ||
#' @importFrom shiny NS tagList | ||
mod_compound_selector_ui <- function(id){ | ||
ns <- NS(id) | ||
tagList( | ||
|
||
) | ||
} | ||
|
||
#' compound_selector Server Function | ||
#' | ||
#' @noRd | ||
mod_compound_selector_server <- function(input, output, session){ | ||
ns <- session$ns | ||
|
||
} | ||
|
||
## To be copied in the UI | ||
# mod_compound_selector_ui("compound_selector_ui_1") | ||
|
||
## To be copied in the server | ||
# callModule(mod_compound_selector_server, "compound_selector_ui_1") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
## code to prepare `drug_screening` dataset goes here | ||
library(synapser) | ||
library(tidyverse) | ||
synLogin() | ||
|
||
drug_screening <- synGet("syn20700260")$path %>% readr::read_csv( | ||
col_types = "cccccdcdccccdcdccdc" | ||
) | ||
|
||
genotypes <- synTableQuery('select * from syn21830362', includeRowIdAndRowVersion = F)$filepath %>% | ||
read_csv() %>% | ||
rename(model_name = specimenID) | ||
|
||
drug_screening <- left_join(drug_screening, genotypes) | ||
|
||
usethis::use_data(drug_screening, | ||
#overwrite = T | ||
) |
Binary file not shown.