Skip to content

Commit

Permalink
tooltip and other ui changes, #62
Browse files Browse the repository at this point in the history
  • Loading branch information
raysinensis committed Feb 27, 2021
1 parent 542f199 commit 62db42a
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 32 deletions.
1 change: 1 addition & 0 deletions global.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ library(rsconnect)
library(ExperimentHub)
library(Seurat)
library(shinydashboard)
library(bsplus)
library(dashboardthemes)
library(tidyverse)
library(data.table)
Expand Down
18 changes: 14 additions & 4 deletions server.R
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ server <- function(input, output, session) {
h4("")
)
)

w9 <- Waiter$new(
id = "someta",
html = tagList(
spin_flower(),
h4("Preview loading..."),
h4("")
)
)

data1 <- reactive({

Expand Down Expand Up @@ -318,9 +327,10 @@ server <- function(input, output, session) {
})

output$ref_summary <- renderUI({
HTML(paste0("cell types: ", ncol(data3()),
HTML(paste0("<b>", "cell types: ", ncol(data3()),
"<br>",
"genes: ", nrow(data3())))
"genes: ", nrow(data3()),
"<b>"))
})

data3b <- reactive({
Expand Down Expand Up @@ -813,7 +823,7 @@ server <- function(input, output, session) {
if (length(input$someta_cell_clicked) != 0) {
sel <- input$someta_cell_clicked
rv$lastgeo <- someta$id[sel$row]
w6$show()
w9$show()
rv$links <- list_geo(rv$lastgeo)
message(rv$links)
if (rv$links != "error_get") {
Expand All @@ -836,7 +846,7 @@ server <- function(input, output, session) {
}

url <- str_c("https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=", input$geoid)
w6$hide()
w9$hide()
showModal(modalDialog(
size = "l",
div(id = "modalfiles",
Expand Down
79 changes: 51 additions & 28 deletions ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ ui <- dashboardPage(
tabName = "dashboard",
# js stuff ----
useShinyjs(),
use_bs_tooltip(),
tags$head(
tags$script(HTML(js2))
),
Expand Down Expand Up @@ -65,9 +66,10 @@ ui <- dashboardPage(

# load example data ----
actionButton("example",
"load example data",
"Load example data",
icon = icon("space-shuttle")
),
) %>%
bs_embed_tooltip("Use example data from GSE113049 for walkthrough", placement = "right"),

# Horizontal line ----
tags$hr(),
Expand Down Expand Up @@ -118,7 +120,7 @@ ui <- dashboardPage(
),
tabItem(
tabName = "matrixLoad",
h2("Load UMI Counts Matrix"),
h2("Load Counts (raw or normalized) Matrix"),
# Input: Select a file ----
fileInput("file1", "Choose Matrix File",
multiple = TRUE,
Expand All @@ -130,22 +132,27 @@ ui <- dashboardPage(
".tsv",
".rds",
".rda",
".rdata"
".rdata",
".gz"
)
),
) %>%
bs_embed_tooltip("Accepted file types: plain or gz text files, and rds/rda/rdata for Seurat/SCE",
placement = "right"),

# GEO id load ----
actionButton("geo1",
"or from GEO id",
icon = icon("search")),
icon = icon("search")) %>%
bs_embed_tooltip("Alternatively, load data directly from GEO with ID", placement = "right"),

actionButton("matrixPopup", "Display UMI Matrix in popup"),
tags$hr(),
DTOutput("contents1"), # UMI Count Matrix
tags$hr()
),
tabItem(
tabName = "metadataLoad",
h2("Load Metadata table"),
h2("Load Metadata"),
fileInput("file2", "Choose Metadata File",
multiple = FALSE,
accept = c(
Expand All @@ -156,21 +163,27 @@ ui <- dashboardPage(
".tsv",
".rds",
".rda",
".rdata"
".rdata",
".gz"
)
),
) %>%
bs_embed_tooltip("Accepted file types: plain or gz text files, and rds/rda/rdata for Seurat/SCE",
placement = "right"),

# GEO id load ----
actionButton("geo2",
"or from GEO id",
icon = icon("search")),
icon = icon("search")) %>%
bs_embed_tooltip("Alternatively, load data directly from GEO with ID", placement = "right"),

actionButton("metadataPopup", "Display Metadata table in popup"),
h2("Choose column in metadata with cluster information"),
selectInput("metadataCellType", "Cell Type Metadata Column:",
h2("Choose column in metadata with cluster info"),
selectInput("metadataCellType", NULL,
choice = list("")
),
fluidRow(column(12, DTOutput('contents2'))),
) %>%
bs_embed_tooltip("Select from dropdown, or click on preview column below", placement = "right"),
tags$hr(),
DTOutput('contents2'),
#DT::dataTableOutput("contents2"), # Metadata table
tags$hr(),
uiOutput("colclicked")
Expand All @@ -185,10 +198,12 @@ ui <- dashboardPage(
"ref_cortex_dev", "ref_pan_indrop", "ref_pan_smartseq2",
"ref_mouse_atlas"
)
),
) %>%
bs_embed_tooltip("Select from pre-built references in clustifyrdatahub", placement = "right"),
actionButton("ref_linkgo",
label = "Go to original source",
icon = icon("link")),
icon = icon("link")) %>%
bs_embed_tooltip("For more info on the reference datasets", placement = "right"),
tags$hr(),
h2("Or load reference table"),
fileInput("file3", "Choose Reference Average Expression File",
Expand All @@ -197,14 +212,16 @@ ui <- dashboardPage(
"text/csv",
"text/comma-separated-values,text/plain",
".csv",
".xlsx",
".tsv",
".rds",
".rda"
".xlsx",
".gz"
)
),
) %>%
bs_embed_tooltip("Alternatively, choose local file of average gene expression by cell type", placement = "right"),
tags$hr(),
uiOutput("ref_summary"),
DTOutput("contents3", height = "300px"),
uiOutput("ref_summary")
tags$hr()
),
tabItem(
tabName = "clustifyres",
Expand All @@ -214,20 +231,26 @@ ui <- dashboardPage(
solidHeader = TRUE,
status = "info",
title = "clustifyr messages",
htmlOutput("clustifym")),
downloadButton("downloadReference", "Download average expression matrix"),
downloadButton("downloadClustify", "Download clustify results matrices"),
htmlOutput("clustifym")) %>%
bs_embed_tooltip("Console messages from run", "right"),
div(style="display:inline-block",
downloadButton("downloadReference", "Download average expression matrix") %>%
bs_embed_tooltip("Note: this is the same file needed to use the current dataset as reference in the future", "bottom"),
downloadButton("downloadClustify", "Download clustify results matrices") %>%
bs_embed_tooltip("Cell type inference as sheet1, correlation matrix as sheet2, of xlsx", "bottom")
),
# actionButton("uploadClustify", "Upload reference matrix"),
h2("average matrix"),
h2("Average Expression Matrix"),
DT::dataTableOutput("reference", height = "300px"), # Reference Matrix
tags$hr(),
h2("ranked correlation matrix"),
h2("Ranked Correlation Matrix"),
DT::dataTableOutput("clustify", height = "300px"), # Clustify Matrix
tags$hr(),
h2("cell type results"),
h2("Cell Type Inference Results"),
DT::dataTableOutput("corToCall", height = "300px"),
tags$hr(),
plotOutput("hmap", height = "900px")
plotOutput("hmap", height = "900px"),
tags$hr(),
),
tabItem(
tabName = "someta",
Expand Down

0 comments on commit 62db42a

Please sign in to comment.