Commit aab0de85 authored by dmattek's avatar dmattek
Browse files

UI displays upon checkbox activation.

parent 780770b7
...@@ -10,9 +10,33 @@ modSelOutliersUI = function(id, label = "Outlier Selection") { ...@@ -10,9 +10,33 @@ modSelOutliersUI = function(id, label = "Outlier Selection") {
ns <- NS(id) ns <- NS(id)
tagList( tagList(
h4( checkboxInput(ns('chbRemoveOut'), 'Remove otliers', value = F),
"Remove outliers" uiOutput(ns('uiSelOutliers'))
), )
}
# Server-remove-outliers ----
modSelOutliers = function(input, output, session, in.data) {
# reactive counter to hold number of tracks before and after outlier removal
nCellsCounter <- reactiveValues(
nCellsOrig = 0,
nCellsAfter = 0,
nOutlierTpts = 0
)
# reactive vector with cell ids
vOut = reactiveValues(
id = NULL
)
# UI for the entire module
output$uiSelOutliers = renderUI({
cat(file = stderr(), 'modSelOutliers:uiSelOutliers\n')
ns <- session$ns
if(input$chbRemoveOut) {
tagList(
fluidRow( fluidRow(
column(2, column(2,
numericInput(ns('numOutliersPerc'), numericInput(ns('numOutliersPerc'),
...@@ -44,23 +68,8 @@ modSelOutliersUI = function(id, label = "Outlier Selection") { ...@@ -44,23 +68,8 @@ modSelOutliersUI = function(id, label = "Outlier Selection") {
checkboxInput(ns('chBplotDist'), 'Plot data distribution', value = F), checkboxInput(ns('chBplotDist'), 'Plot data distribution', value = F),
uiOutput(ns('uiDistPlot')) uiOutput(ns('uiDistPlot'))
) )
} }
})
# Server-remove-outliers ----
modSelOutliers = function(input, output, session, in.data) {
# reactive counter to hold number of tracks before and after outlier removal
nCellsCounter <- reactiveValues(
nCellsOrig = 0,
nCellsAfter = 0,
nOutlierTpts = 0
)
# reactive vector with cell ids
vOut = reactiveValues(
id = NULL
)
# Display number of tracks and outliers # Display number of tracks and outliers
...@@ -207,6 +216,10 @@ modSelOutliers = function(input, output, session, in.data) { ...@@ -207,6 +216,10 @@ modSelOutliers = function(input, output, session, in.data) {
return(NULL) return(NULL)
} }
if (!input$chbRemoveOut) {
return(loc.out)
}
# store the number of trajectories before prunning # store the number of trajectories before prunning
nCellsCounter[['nCellsOrig']] = length(unique(loc.out[['id']])) nCellsCounter[['nCellsOrig']] = length(unique(loc.out[['id']]))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment