Skip to content

Commit

Permalink
Improve text and behaviour of selected dataset and AS event selectize…
Browse files Browse the repository at this point in the history
… fields

- Remove selected AS event when there's no quantification available, closes #228
  • Loading branch information
nuno-agostinho authored and Nuno Agostinho committed Dec 16, 2016
1 parent 9d6851d commit 2ef4018
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Correctly load files and quantify alternative splicing for PRAD, OV and
PAAD tumour types from The Cancer Genome Atlas (TCGA)
* Fix session disconnecting when exporting plots in Firefox
* Improve text and behaviour of fields to select datasets and AS events
* Fix author names and add contributor

1.0.3
Expand Down
2 changes: 1 addition & 1 deletion R/analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ loadRequiredData <- function(dataType) {
panel <- switch(dataType,
"Clinical data"="TCGA",
"Junction quantification"="TCGA",
"Inclusion levels"="alternative"
"Inclusion levels"="Alternative splicing"
)

return(sprintf("showDataPanel('%s');", panel))
Expand Down
20 changes: 12 additions & 8 deletions R/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ navSelectize <- function(id, label, placeholder=label) {
'$("#', id, '")[0].style.display = "block";',
'$("#', id, ' > div > select")[0].selectize.clear();',
'$("#', id, ' > div > select")[0].selectize.focus();'))),
tags$br(), textOutput(value)))
tags$br(), uiOutput(value)))
}

#' Modified tabPanel function to show icon and title
Expand Down Expand Up @@ -182,8 +182,8 @@ appUI <- function() {
nav[[3]][[1]][[3]][[1]][[3]][[2]] <- tagAppendChild(
nav[[3]][[1]][[3]][[1]][[3]][[2]],
tags$ul(class="nav navbar-nav navbar-right",
navSelectize("selectizeCategory", "Selected data category",
"Select data category"),
navSelectize("selectizeCategory", "Selected dataset",
"Select dataset"),
navSelectize("selectizeEvent", "Selected splicing event",
"Search by gene, chromosome and coordinates")))
shinyUI(nav)
Expand All @@ -198,8 +198,11 @@ appUI <- function() {
#' @param session Session object
#'
#' @importFrom shiny observe stopApp
#'
#' @return NULL (this function is used to modify the Shiny session's state)
appServer <- function(input, output, session) {
ns <- session$ns

getServerFunctions("app", priority=c("dataServer", "analysesServer"))

# Update selectize input to show available categories
Expand Down Expand Up @@ -236,25 +239,26 @@ appServer <- function(input, output, session) {
# Replace with empty list since NULLs are dropped
updateSelectizeInput(session, "selectizeEventElem", choices=list(),
selected=list())
setEvent(NULL)
}
})

# Show the selected category
output$selectizeCategoryValue <- renderText({
output$selectizeCategoryValue <- renderUI({
category <- getCategory()
if (is.null(category))
return("No data loaded")
return("No dataset loaded")
else if(category == "")
return("No category selected")
return("No dataset selected")
else
return(category)
})

# Show the selected event
output$selectizeEventValue <- renderText({
output$selectizeEventValue <- renderUI({
event <- getEvent()
if (is.null(event))
return("No data loaded")
return("No events quantified")
else if (event == "")
return("No event selected")
else
Expand Down
2 changes: 1 addition & 1 deletion R/data_inclusionLevels.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ inclusionLevelsInterface <- function(ns) {
#' @return HTML elements
inclusionLevelsUI <- function(id, panel) {
ns <- NS(id)
title <- "Quantify alternative splicing events"
title <- "Alternative splicing quantification"
panel(style="info", title=tagList(icon("calculator"), title), value=title,
inclusionLevelsInterface(ns))
}
Expand Down

0 comments on commit 2ef4018

Please sign in to comment.