diff --git a/exec/transformation_example.R b/exec/transformation_example.R index 693c743..5ccefac 100644 --- a/exec/transformation_example.R +++ b/exec/transformation_example.R @@ -3,21 +3,32 @@ library(shiny) source("../R/transformation.R") ui <- fluidPage( - transformationUI(id = "id", transposeOptions = TRUE) + h3("Module UI"), + transformationUI(id = "id", transposeOptions = TRUE), + hr(), + h3("Input parameter"), + numericInput(inputId = "pseudocount", label = "Pseudocount", value = 1), + checkboxInput(inputId = "transpose", label = "Transpose"), + checkboxInput(inputId = "replaceInf", label = "replace Inf with NA", value = TRUE), + checkboxInput(inputId = "replaceNA", label = "replace NA with 0", value = TRUE), + hr(), + h3("Module output"), + verbatimTextOutput(outputId = "module_out") ) server <- function(input, output) { - data_matrix <- matrix( 0:10, ncol = 10) + data_matrix <- matrix(c(0:9, 0:9), ncol = 10) data <- reactive({ data_matrix }) - mod <- callModule(transformation, "id", data, transpose = F, pseudocount = 0, replaceInf = T, replaceNA = T) + mod <- callModule(transformation, "id", data, transpose = reactive(input$transpose), pseudocount = reactive(input$pseudocount), replaceInf = reactive(input$replaceInf), replaceNA = reactive(input$replaceNA)) - observe({ + output$module_out <- renderPrint({ print(mod$method()) print(mod$data()) + print(mod$transpose()) }) }