-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec1e7f1
commit 3095aea
Showing
6 changed files
with
150 additions
and
3 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
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,96 @@ | ||
#' normalisation tab (section) ui builder | ||
#' | ||
#' @return A shiny tagList object that contains the normalisation tab UI components | ||
#' @rdname INTERNAL_interface_module_normalisation_tab | ||
#' @keywords internal | ||
#' | ||
#' @importFrom shiny fluidRow NS actionButton icon uiOutput | ||
#' @importFrom shinydashboardPlus box | ||
#' @importFrom htmltools tagList | ||
#' @importFrom shinyBS bsTooltip | ||
#' | ||
interface_module_normalisation_tab <- function(id) { | ||
tagList( | ||
actionButton( | ||
NS(id, "reload"), | ||
"Load assays from previous step", | ||
icon("hand-pointer", class = "fa-solid"), | ||
width = "100%", | ||
class = "load-button" | ||
), | ||
shinyBS::bsTooltip( | ||
id = NS(id, "reload"), | ||
title = paste("Load the assays from the previous step.", | ||
"Click on this button the first time you visit this page", | ||
"or if you updated the assays from the previous steps.", | ||
sep = " " | ||
), | ||
trigger = "hover" | ||
), | ||
box( | ||
title = "Normalisation", | ||
status = "primary", | ||
width = 12, | ||
solidHeader = TRUE, | ||
collapsible = FALSE, | ||
fluidRow( | ||
box( | ||
title = "Prior Distribution", | ||
status = "primary", | ||
width = 5, | ||
solidHeader = TRUE, | ||
collapsible = TRUE, | ||
withSpinner(plotlyOutput(outputId = NS(id, "prior_dist")), | ||
type = 6, | ||
color = "#3c8dbc" | ||
) | ||
), | ||
box( | ||
title = "Post Distribution", | ||
status = "primary", | ||
width = 5, | ||
solidHeader = TRUE, | ||
collapsible = TRUE, | ||
withSpinner(plotlyOutput(outputId = NS(id, "post_dist")), | ||
type = 6, | ||
color = "#3c8dbc" | ||
) | ||
), | ||
box( | ||
title = "Normalisation Settings", | ||
status = "primary", | ||
width = 2, | ||
solidHeader = TRUE, | ||
collapsible = TRUE, | ||
selectInput(inputId = NS(id, "method"), | ||
label = "method", | ||
choices = c(2, 10), | ||
selected = 2 | ||
), | ||
numericInput(inputId = NS(id, "pseudocount"), | ||
label = "Pseudocount", | ||
value = 0, | ||
min = 0, | ||
step = 1 | ||
) | ||
) | ||
) | ||
), | ||
actionButton( | ||
NS(id, "export"), | ||
"Save the processed assays", | ||
icon("hand-pointer", class = "fa-solid"), | ||
width = "100%", | ||
class = "load-button" | ||
), | ||
shinyBS::bsTooltip( | ||
id = NS(id, "export"), | ||
title = paste("Write the processed assays to the QFeatures object.", | ||
"This is needed to proceed to the next steps.", | ||
sep = " " | ||
), | ||
trigger = "hover", | ||
placement = "top" | ||
) | ||
) | ||
} |
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,41 @@ | ||
#' Server for the module normalisation tab | ||
#' | ||
#' @param id module id | ||
#' @return The server logic for the normalisation tab | ||
#' @rdname INTERNAL_server_module_normalisation_tab | ||
#' @keywords internal | ||
#' | ||
#' @importFrom shiny moduleServer updateSelectInput observeEvent eventReactive is.reactive | ||
#' @importFrom MultiAssayExperiment getWithColData | ||
#' | ||
server_module_normalisation_tab <- function(id, step_number) { | ||
moduleServer(id, function(input, output, session) { | ||
assays_to_process <- eventReactive(input$reload, { | ||
error_handler(page_assays_subset, | ||
component_name = "Page assays subset", | ||
qfeatures = global_rv$qfeatures, | ||
pattern = paste0("_(QFeaturesGUI#", step_number - 1, ")") | ||
) | ||
}) | ||
|
||
processed_assays <- reactive({ | ||
return(assays_to_process()) | ||
}) | ||
|
||
observeEvent(input$export, { | ||
req(processed_assays()) | ||
loading(paste("Be aware that this operation", | ||
"can be quite time consuming for large data sets", | ||
sep = " " | ||
)) | ||
error_handler( | ||
add_assays_to_global_rv, | ||
component_name = "Add assays to global_rv", | ||
processed_qfeatures = processed_assays(), | ||
step_number = step_number, | ||
type = "normalisation" | ||
) | ||
removeModal() | ||
}) | ||
}) | ||
} |
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