Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cohort builder first pass #2

Merged
merged 2 commits into from
Jan 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ Imports:
htmltools,
ggplot2,
plotly,
shinydashboard
RoxygenNote: 6.1.0
shinydashboard,
readr
RoxygenNote: 7.0.1
Suggests:
testthat (>= 2.1.0),
knitr,
Expand Down
14 changes: 14 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# Generated by roxygen2: do not edit by hand

export(includeRMarkdown)
export(mod_cohort_server)
export(mod_cohort_ui)
export(run_app)
import(shiny)
import(shinydashboard)
importFrom(glue,glue)
importFrom(golem,with_golem_options)
importFrom(htmltools,HTML)
importFrom(htmltools,tagAppendAttributes)
importFrom(htmltools,tagList)
importFrom(htmltools,tags)
importFrom(markdown,markdownToHTML)
importFrom(rmarkdown,render)
importFrom(shiny,NS)
importFrom(shiny,column)
importFrom(shiny,shinyApp)
importFrom(shiny,tagList)
2 changes: 1 addition & 1 deletion R/app_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ app_ui <- function() {
# Leave this function for adding external resources
golem_add_external_resources(),
# List the first level UI elements here
kashboardPage(
dashboardPage(
dashboardHeader(),
dashboardSidebar(
mod_cohort_ui("cohort_ui_1")
Expand Down
23 changes: 22 additions & 1 deletion R/mod_cohort.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,16 @@
mod_cohort_ui <- function(id){
ns <- NS(id)
tagList(

checkboxGroupInput(ns("isCellLine"), label = "Is Cell Line", choices = unique(cohort$isCellLine),
selected = unique(cohort$isCellLine)),
checkboxGroupInput(ns("tumorType"), label = "Tumor Type", choices = unique(cohort$tumorType),
selected = unique(cohort$tumorType)),
checkboxGroupInput(ns("species"), label = "Species", choices = unique(cohort$species),
selected = unique(cohort$species)),
selectizeInput(ns("modelSystemName"), label = "Model System Name", choices = unique(cohort$modelSystemName),
selected = unique(cohort$modelSystemName), multiple = T),
selectizeInput(ns("studyName"), label = "Study Name", choices = unique(cohort$studyName),
selected = unique(cohort$studyName), multiple = T)
)
}

Expand All @@ -28,6 +37,18 @@ mod_cohort_ui <- function(id){

mod_cohort_server <- function(input, output, session){
ns <- session$ns

samples <- reactive({
cohort %>%
dplyr::filter(studyName %in% input$studyName,
modelSystemName %in% input$modelSystemName,
isCellLine %in% input$isCellLine,
tumorType %in% input$tumorType,
species %in% input$species) %>%
purrr::pluck(specimenID) %>%
unique()
})

}

## To be copied in the UI
Expand Down
4 changes: 4 additions & 0 deletions data-raw/cohort.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## code to prepare `cohort` dataset goes here

cohort <- readr::read_csv("data-raw/cohort_metadata.csv")
usethis::use_data(cohort)
1,838 changes: 1,838 additions & 0 deletions data-raw/cohort_metadata.csv

Large diffs are not rendered by default.

Binary file added data/cohort.rda
Binary file not shown.
Loading