Skip to content

Commit 908fc44

Browse files
committed
[FEAT] - backbone of a log transform step
1 parent db6d9ba commit 908fc44

5 files changed

+82
-12
lines changed
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#' log transform tab (section) ui builder
2+
#'
3+
#' @return A shiny tagList object that contains the log transform tab UI components
4+
#' @rdname INTERNAL_interface_module_log_transform_tab
5+
#' @keywords internal
6+
#'
7+
#' @importFrom shiny fluidRow NS actionButton icon uiOutput
8+
#' @importFrom shinydashboardPlus box
9+
#' @importFrom htmltools tagList
10+
#' @importFrom shinyBS bsTooltip
11+
#'
12+
interface_module_log_transform_tab <- function(id) {
13+
tagList(
14+
actionButton(
15+
NS(id, "reload"),
16+
"Load assays from previous step",
17+
icon("hand-pointer", class = "fa-solid"),
18+
width = "100%",
19+
class = "load-button"
20+
),
21+
shinyBS::bsTooltip(
22+
id = NS(id, "reload"),
23+
title = paste("Load the assays from the previous step.",
24+
"Click on this button the first time you visit this page",
25+
"or if you updated the assays from the previous steps.",
26+
sep = " "
27+
),
28+
trigger = "hover"
29+
),
30+
)
31+
}
32+
33+
interface_box_distribution <- function(id) {
34+
box(
35+
title = "Log Transformation",
36+
status = "primary",
37+
width = 12,
38+
solidHeader = TRUE,
39+
collapsible = FALSE,
40+
41+
withSpinner(plotlyOutput(outputId = NS(id, "dist")),
42+
type = 6,
43+
color = "#3c8dbc"
44+
)
45+
)
46+
}

R/server_dynamic_workflow.R

+16-8
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,17 @@ server_dynamic_workflow <- function(input, output, session) {
3434
dynamic_tabs <- lapply(seq_along(global_rv$workflow_config), function(i) {
3535
tabItem(
3636
tabName = paste0("step_", i),
37-
if (global_rv$workflow_config[[i]] == "Cells Filtering") {
37+
if (global_rv$workflow_config[[i]] == "Samples Filtering") {
3838
interface_module_samples_filtering_tab(
39-
paste0("filtering_", i)
39+
paste0("samples_filtering_", i)
4040
)
41-
} else {
41+
} else if(global_rv$workflow_config[[i]] == "Features Filtering") {
4242
interface_module_features_filtering_tab(
43-
paste0("filtering_", i)
43+
paste0("features_filtering_", i)
44+
)
45+
} else if(global_rv$workflow_config[[i]] == "Log Transformation") {
46+
interface_module_log_transform_tab(
47+
paste0("log_transform_", i)
4448
)
4549
}
4650
)
@@ -50,12 +54,16 @@ server_dynamic_workflow <- function(input, output, session) {
5054
})
5155

5256
lapply(seq_along(global_rv$workflow_config), function(i) {
53-
if (global_rv$workflow_config[[i]] == "Cells Filtering") {
54-
server_module_samples_filtering_tab(paste0("filtering_", i),
57+
if (global_rv$workflow_config[[i]] == "Samples Filtering") {
58+
server_module_samples_filtering_tab(paste0("samples_filtering_", i),
59+
step_number = i
60+
)
61+
} else if(global_rv$workflow_config[[i]] == "Features Filtering") {
62+
server_module_features_filtering_tab(paste0("features_filtering_", i),
5563
step_number = i
5664
)
57-
} else {
58-
server_module_features_filtering_tab(paste0("filtering_", i),
65+
} else if(global_rv$workflow_config[[i]] == "Log Transformation") {
66+
server_module_log_transform_tab(paste0("log_transform_", i),
5967
step_number = i
6068
)
6169
}

R/server_module_log_transform_tab.R

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#' Server for the module log transformation tab
2+
#'
3+
#' @param id module id
4+
#' @return The server logic for the log transformation tab
5+
#' @rdname INTERNAL_server_module_log_transformation_tab
6+
#' @keywords internal
7+
#'
8+
#' @importFrom shiny moduleServer updateSelectInput observeEvent eventReactive is.reactive
9+
#' @importFrom MultiAssayExperiment getWithColData
10+
#'
11+
server_module_log_transform_tab <- function(id, step_number) {
12+
moduleServer(id, function(input, output, session) {
13+
return(NULL)
14+
})
15+
}

R/server_module_qc_metrics.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Title
1+
#' Server module for qc metrics box
22
#'
33
#' @param id module id
44
#' @param assays_to_process a reactiveVal that contains the different assays that will be used in the module

R/server_module_workflow_config.R

+4-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ server_module_workflow_config <- function(id) {
3030
output$tabs <- renderUI({
3131
if (n_steps() > 0) {
3232
lapply(seq_len(n_steps()), function(i) {
33-
selected <- "Cells Filtering"
33+
selected <- "Samples Filtering"
3434
if (!is.null(steps[[paste0("step_", i)]])) {
3535
selected <- steps[[paste0("step_", i)]]
3636
}
@@ -39,8 +39,9 @@ server_module_workflow_config <- function(id) {
3939
inputId = NS(id, paste0("step_", i)),
4040
label = paste0("Step ", i),
4141
choices = c(
42-
"Cells Filtering",
43-
"Features Filtering"
42+
"Samples Filtering",
43+
"Features Filtering",
44+
"Log Transformation"
4445
),
4546
selected = selected,
4647
width = "90%"

0 commit comments

Comments
 (0)