Commit 4d081673 authored by dmattek's avatar dmattek
Browse files

Bug fixes

parent 082b907a
...@@ -176,24 +176,23 @@ helpPopup <- function(title, content, ...@@ -176,24 +176,23 @@ helpPopup <- function(title, content,
) )
} }
help.text.short = c( helpText.server = c(
'Load CSV file with a column of track IDs for removal. IDs should correspond to those used for plotting.', #1 'Load main data as a CSV or compressed CSV file (gz or bz2).', #1
'If the track ID is unique only within a group, make it unique globally by combining with the grouping column.', #2 'Long format: a row is a single data point. Wide format: a row is a time series with columns as time points.', #2
'Interpolate missing time points and pre-existing NAs. The interval of the time column must be provided!', #3 'Generate 60 random synthetic time series distributed evenly among 6 groups. Every time series has 60 time points.', #3
'Load CSV file with 5 columns: grouping, start and end tpts of stimulation, start and end of y-position, dummy column with ID.', #4 'Load CSV file with a column of track IDs for removal. IDs should correspond to those used for plotting.', #4
'Select columns to group data according to treatment, condition, etc.', #5 'Load CSV file with 5 columns: grouping, start and end tpts of stimulation, start and end of y-position, dummy column with ID.', #5
'Select math operation to perform on a single or two columns,', #6 'Interpolate missing time points and pre-existing NAs. The interval of the time column must be provided!', #6
'Select range of time for further processing.', #7 'If the track ID is unique only within a group, make it unique globally by combining with grouping columns.', #7
'Divide measurments by the mean/median or calculate z-score with respect to selected time span.', #8 'Select columns to group data according to treatment, condition, etc.', #8
'Download time series after modification in this section.', #9 'Select math operation to perform on a single or two columns,', #9
'Long format: a row is a single data point. Wide format: a row is a time series with columns as time points.', #10 'Select range of time for further processing.', #10
'Fold-change or z-score with respect to selected time span.', #11 'Divide measurments by the mean/median or calculate z-score with respect to selected time span.', #11
'Normalise with respect to this time span.', #12 'Fold-change or z-score with respect to selected time span.', #12
'Calculate fold-change and z-score using the median and Median Absolute Deviation, instead of the mean and sd.', #13 'Normalise with respect to this time span.', #13
'Normalise to mean/median of selected time calculated globally, per group, or for individual time series.', #14 'Calculate fold-change and z-score using the median and Median Absolute Deviation, instead of the mean and sd.', #14
'Instead of the value at a selected time point, y-axis can display a difference between values at two selected time points.', #15 'Normalise to mean/median of selected time calculated globally, per group, or for individual time series.', #15
'Add a line with linear regression and regions of 95% confidence interval.', #16 'Download time series after modification in this section.' #16
'A number of time points left & right of selected time points; use the mean of values from these time points for the scatterplot.' #17
) )
# Functions for data processing ---- # Functions for data processing ----
......
...@@ -5,12 +5,17 @@ ...@@ -5,12 +5,17 @@
# This module is for displaying stats in an interactive table using DT package # This module is for displaying stats in an interactive table using DT package
# #
helpText.dispStats = c("Display statistics aggregated per group, e.g. mean/median/CV per group." #1
)
# UI ---- # UI ----
modStatsUI = function(id, label = "Comparing t-points") { modStatsUI = function(id, label = "Comparing t-points") {
ns <- NS(id) ns <- NS(id)
tagList( tagList(
checkboxInput(ns('chbTabStats'), 'Show statistics', FALSE), checkboxInput(ns('chbTabStats'), 'Show statistics', FALSE),
bsTooltip(ns('chbTabStats'), helpText.dispStats[1], placement = "bottom", trigger = "hover", options = NULL),
uiOutput(ns('uiTabStats')), uiOutput(ns('uiTabStats')),
uiOutput(ns('uiDownSingleCellData')) uiOutput(ns('uiDownSingleCellData'))
) )
......
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
# #
# Calculates area under curve (AUC) for every single time course provided in the input # Calculates area under curve (AUC) for every single time course provided in the input
helpText.tabAUC = c("Calculate area under curve (AUC) for every time series using trapezoidal rule." #1
)
# UI ---- # UI ----
tabAUCplotUI = function(id, label = "Plot Area Under Curves") { tabAUCplotUI = function(id, label = "Plot Area Under Curves") {
ns <- NS(id) ns <- NS(id)
...@@ -96,7 +99,7 @@ tabAUCplot = function(input, output, session, in.data, in.fname) { ...@@ -96,7 +99,7 @@ tabAUCplot = function(input, output, session, in.data, in.fname) {
addPopover(session, addPopover(session,
id = ns("alAUC"), id = ns("alAUC"),
title = "AUC", title = "AUC",
content = "Calculate area under curve (AUC) for every time series using trapezoidal rule", content = helpText.tabAUC[1],
trigger = "click") trigger = "click")
} }
......
...@@ -149,8 +149,8 @@ clustHierUI <- function(id, label = "Hierarchical CLustering") { ...@@ -149,8 +149,8 @@ clustHierUI <- function(id, label = "Hierarchical CLustering") {
) )
), ),
actionButton(ns('butPlotHierHeatMap'), 'Plot!'),
withSpinner(plotOutput(ns('outPlotHier'))), withSpinner(plotOutput(ns('outPlotHier'))),
actionButton(ns('butPlotHierHeatMap'), 'Plot!'),
downPlotUI(ns('downPlotHier'), "Download PNG") downPlotUI(ns('downPlotHier'), "Download PNG")
), ),
......
...@@ -14,6 +14,14 @@ ...@@ -14,6 +14,14 @@
# callModule(clustHier, 'TabClustHier', dataMod) # callModule(clustHier, 'TabClustHier', dataMod)
# where dataMod is the output from a reactive function that returns dataset ready for clustering # where dataMod is the output from a reactive function that returns dataset ready for clustering
helpText.tabScatter = c("Display measurement values from two different time points as a scatter plot.",
'Y-axis can display a value at a selected time point or a difference between values at two selected time points.', #1
'Add a line with linear regression and regions of 95% confidence interval.', #2
'A number of time points left & right of selected time points; use the mean of values from these time points for the scatterplot.', #3
'Height in pixels of the displayed plot', #4
'Number of facets in a row. Each facet displayes a scatter plot for a single group.' #5
)
# UI ---- # UI ----
tabScatterPlotUI <- function(id, label = "Comparing t-points") { tabScatterPlotUI <- function(id, label = "Comparing t-points") {
ns <- NS(id) ns <- NS(id)
...@@ -31,17 +39,19 @@ tabScatterPlotUI <- function(id, label = "Comparing t-points") { ...@@ -31,17 +39,19 @@ tabScatterPlotUI <- function(id, label = "Comparing t-points") {
uiOutput(ns('uiSelTptX')), uiOutput(ns('uiSelTptX')),
uiOutput(ns('uiSelTptY')), uiOutput(ns('uiSelTptY')),
bsAlert("alert2differentTpts"), bsAlert("alert2differentTpts"),
radioButtons(ns('rBfoldChange'), 'Y-axis',
choices = c("Y" = "y", "Y-X" = "diff"),
width = "100px", inline = T),
bsTooltip(ns('rBfoldChange'), help.text.short[15], placement = "right", trigger = "hover", options = NULL),
checkboxInput(ns('chBregression'), 'Linear regression with 95% CI'), checkboxInput(ns('chBregression'), 'Linear regression with 95% CI'),
bsTooltip(ns('chBregression'), help.text.short[16], placement = "right", trigger = "hover", options = NULL) bsTooltip(ns('chBregression'), helpText.tabScatter[3], placement = "bottom", trigger = "hover", options = NULL)
), ),
column( column(
4, 4,
numericInput(ns('inNeighTpts'), 'Smoothing', value = 0, step = 1, min = 0, width = "150px"), numericInput(ns('inNeighTpts'), 'Smoothing', value = 0, step = 1, min = 0, width = "120px"),
bsTooltip(ns('inNeighTpts'), help.text.short[17], placement = "right", trigger = "hover", options = NULL) bsTooltip(ns('inNeighTpts'), helpText.tabScatter[4], placement = "bottom", trigger = "hover", options = NULL),
radioButtons(ns('rBfoldChange'), 'Y-axis',
choices = c("Y" = "y", "Y-X" = "diff"),
width = "100px", inline = T),
bsTooltip(ns('rBfoldChange'), helpText.tabScatter[2], placement = "bottom", trigger = "hover", options = NULL)
), ),
column( column(
4, 4,
...@@ -53,6 +63,8 @@ tabScatterPlotUI <- function(id, label = "Comparing t-points") { ...@@ -53,6 +63,8 @@ tabScatterPlotUI <- function(id, label = "Comparing t-points") {
step = 100, step = 100,
width = "100px" width = "100px"
), ),
bsTooltip(ns('inPlotHeight'), helpText.tabScatter[5], placement = "bottom", trigger = "hover", options = NULL),
numericInput( numericInput(
ns('inPlotNcolFacet'), ns('inPlotNcolFacet'),
'#columns', '#columns',
...@@ -60,8 +72,8 @@ tabScatterPlotUI <- function(id, label = "Comparing t-points") { ...@@ -60,8 +72,8 @@ tabScatterPlotUI <- function(id, label = "Comparing t-points") {
min = 1, min = 1,
step = 1, step = 1,
width = "100px" width = "100px"
),
) bsTooltip(ns('inPlotNcolFacet'), helpText.tabScatter[6], placement = "bottom", trigger = "hover", options = NULL)
) )
), ),
...@@ -94,7 +106,7 @@ getDataTpts <- reactive({ ...@@ -94,7 +106,7 @@ getDataTpts <- reactive({
}) })
output$uiSelTptX = renderUI({ output$uiSelTptX = renderUI({
cat(file = stderr(), 'UI uiSelTptX\n') cat(file = stderr(), 'tabScatter:uiSelTptX\n')
ns <- session$ns ns <- session$ns
...@@ -104,7 +116,7 @@ output$uiSelTptX = renderUI({ ...@@ -104,7 +116,7 @@ output$uiSelTptX = renderUI({
ns('inSelTptX'), ns('inSelTptX'),
'Time point for X-axis', 'Time point for X-axis',
loc.v, loc.v,
width = '200px', width = '180px',
selected = 0, selected = 0,
multiple = FALSE multiple = FALSE
) )
...@@ -112,7 +124,7 @@ output$uiSelTptX = renderUI({ ...@@ -112,7 +124,7 @@ output$uiSelTptX = renderUI({
}) })
output$uiSelTptY = renderUI({ output$uiSelTptY = renderUI({
cat(file = stderr(), 'UI uiSelTptY\n') cat(file = stderr(), 'tabScatter:uiSelTptY\n')
ns <- session$ns ns <- session$ns
...@@ -122,7 +134,25 @@ output$uiSelTptY = renderUI({ ...@@ -122,7 +134,25 @@ output$uiSelTptY = renderUI({
ns('inSelTptY'), ns('inSelTptY'),
'Time point for Y-axis', 'Time point for Y-axis',
loc.v, loc.v,
width = '200px', width = '180px',
selected = 1,
multiple = FALSE
)
}
})
output$uiNcolFacet = renderUI({
cat(file = stderr(), 'tabScatter:uiNcolFacet\n')
ns <- session$ns
loc.v = getDataTpts()
if (!is.null(loc.v)) {
selectInput(
ns('inSelTptY'),
'Time point for Y-axis',
loc.v,
width = '180px',
selected = 1, selected = 1,
multiple = FALSE multiple = FALSE
) )
...@@ -217,10 +247,6 @@ plotScatter <- function() { ...@@ -217,10 +247,6 @@ plotScatter <- function() {
cat(file=stderr(), 'plotScatter:dt not NULL\n') cat(file=stderr(), 'plotScatter:dt not NULL\n')
## FIX: r.squared is unavailable for lm
# loc.fit.rsq = ifelse(input$inRobustFit, loc.fit$r.squared, )
p.out = LOCggplotScat( p.out = LOCggplotScat(
dt.arg = loc.dt, dt.arg = loc.dt,
...@@ -283,7 +309,7 @@ output$outPlotScatterInt <- renderPlotly({ ...@@ -283,7 +309,7 @@ output$outPlotScatterInt <- renderPlotly({
addPopover(session, addPopover(session,
id = ns("alScatter"), id = ns("alScatter"),
title = "Scatter plot", title = "Scatter plot",
content = "Display measurement values from two different time points as a scatter plot.", content = helpText.tabScatter[1],
trigger = "click") trigger = "click")
......
...@@ -178,7 +178,7 @@ shinyServer(function(input, output, session) { ...@@ -178,7 +178,7 @@ shinyServer(function(input, output, session) {
selectInput( selectInput(
'inSelTrackLabel', 'inSelTrackLabel',
'Select ID:', 'Track ID column:',
locCols, locCols,
width = '100%', width = '100%',
selected = locColSel selected = locColSel
...@@ -194,7 +194,7 @@ shinyServer(function(input, output, session) { ...@@ -194,7 +194,7 @@ shinyServer(function(input, output, session) {
selectInput( selectInput(
'inSelTime', 'inSelTime',
'Select time column:', 'Time column:',
locCols, locCols,
width = '100%', width = '100%',
selected = locColSel selected = locColSel
...@@ -235,7 +235,7 @@ shinyServer(function(input, output, session) { ...@@ -235,7 +235,7 @@ shinyServer(function(input, output, session) {
#cat('UI varSelGroup::locColSel ', locColSel, '\n') #cat('UI varSelGroup::locColSel ', locColSel, '\n')
selectInput( selectInput(
'inSelGroup', 'inSelGroup',
'Select columns for plot grouping:', 'Select:',
locCols, locCols,
width = '100%', width = '100%',
selected = locColSel, selected = locColSel,
...@@ -257,7 +257,7 @@ shinyServer(function(input, output, session) { ...@@ -257,7 +257,7 @@ shinyServer(function(input, output, session) {
selectInput( selectInput(
'inSelSite', 'inSelSite',
'Select grouping columns to add to track label:', 'Columns to add to track ID:',
locCols, locCols,
width = '100%', width = '100%',
selected = locColSel, selected = locColSel,
...@@ -277,7 +277,7 @@ shinyServer(function(input, output, session) { ...@@ -277,7 +277,7 @@ shinyServer(function(input, output, session) {
selectInput( selectInput(
'inSelMeas1', 'inSelMeas1',
'Select 1st meas.:', 'Column with 1st measurement:',
locCols, locCols,
width = '100%', width = '100%',
selected = locColSel selected = locColSel
...@@ -298,7 +298,7 @@ shinyServer(function(input, output, session) { ...@@ -298,7 +298,7 @@ shinyServer(function(input, output, session) {
selectInput( selectInput(
'inSelMeas2', 'inSelMeas2',
'Select 2nd meas.', 'Column with 2nd measurement',
locCols, locCols,
width = '100%', width = '100%',
selected = locColSel selected = locColSel
...@@ -349,7 +349,7 @@ shinyServer(function(input, output, session) { ...@@ -349,7 +349,7 @@ shinyServer(function(input, output, session) {
choices = list('fold-change' = 'mean', 'z-score' = 'z.score'), choices = list('fold-change' = 'mean', 'z-score' = 'z.score'),
width = "40%" width = "40%"
), ),
bsTooltip('rBnormMeth', help.text.short[11], placement = "right", trigger = "hover", options = NULL) bsTooltip('rBnormMeth', helpText.server[12], placement = "bottom", trigger = "hover", options = NULL)
) )
} }
}) })
...@@ -377,7 +377,7 @@ shinyServer(function(input, output, session) { ...@@ -377,7 +377,7 @@ shinyServer(function(input, output, session) {
value = c(locRTmin, 0.1 * locRTmax), value = c(locRTmin, 0.1 * locRTmax),
step = 1 step = 1
), ),
bsTooltip('slNormRtMinMax', help.text.short[12], placement = "right", trigger = "hover", options = NULL) bsTooltip('slNormRtMinMax', helpText.server[13], placement = "bottom", trigger = "hover", options = NULL)
) )
} }
}) })
...@@ -393,7 +393,7 @@ shinyServer(function(input, output, session) { ...@@ -393,7 +393,7 @@ shinyServer(function(input, output, session) {
label = 'Robust stats', label = 'Robust stats',
FALSE, FALSE,
width = "40%"), width = "40%"),
bsTooltip('chBnormRobust', help.text.short[13], placement = "right", trigger = "hover", options = NULL) bsTooltip('chBnormRobust', helpText.server[14], placement = "bottom", trigger = "hover", options = NULL)
) )
} }
}) })
...@@ -409,7 +409,7 @@ shinyServer(function(input, output, session) { ...@@ -409,7 +409,7 @@ shinyServer(function(input, output, session) {
label = 'Normalisation grouping', label = 'Normalisation grouping',
choices = list('Entire dataset' = 'none', 'Per group' = 'group', 'Per trajectory' = 'id'), choices = list('Entire dataset' = 'none', 'Per group' = 'group', 'Per trajectory' = 'id'),
width = "40%"), width = "40%"),
bsTooltip('chBnormGroup', help.text.short[14], placement = "right", trigger = "hover", options = NULL) bsTooltip('chBnormGroup', helpText.server[15], placement = "bottom", trigger = "hover", options = NULL)
) )
} }
}) })
......
...@@ -23,45 +23,50 @@ shinyUI(fluidPage( ...@@ -23,45 +23,50 @@ shinyUI(fluidPage(
#Selector for file upload #Selector for file upload
fileInput( fileInput(
'inFileLoadNuc', 'inFileLoadNuc',
'Select main data file and press "Load Data"', 'Select data file and click "Load Data"',
accept = c('text/csv', 'text/comma-separated-values,text/plain') accept = c('text/csv', 'text/comma-separated-values,text/plain')
), ),
bsTooltip('inFileLoadNuc', helpText.server[1], placement = "bottom", trigger = "hover", options = NULL),
radioButtons("inRbutLongWide", "Data format:", c("Long" = 0, "Wide" = 1), width = "40%"), radioButtons("inRbutLongWide", "Data format:", c("Long" = 0, "Wide" = 1), width = "40%"),
bsTooltip('inRbutLongWide', help.text.short[10], placement = "right", trigger = "hover", options = NULL), bsTooltip('inRbutLongWide', helpText.server[2], placement = "bottom", trigger = "hover", options = NULL),
actionButton("inButLoadNuc", "Load Data"), actionButton("inButLoadNuc", "Load Data"),
actionButton("butReset", "Reset file input"), actionButton("butReset", "Reset file input"),
actionButton('inDataGen1', 'Synthetic data'), actionButton('inDataGen1', 'Synthetic data'),
bsTooltip('inDataGen1', helpText.server[3], placement = "bottom", trigger = "hover", options = NULL),
tags$hr(), tags$hr(),
checkboxInput('chBtrajRem', 'Upload IDs to remove'), checkboxInput('chBtrajRem', 'Upload tracks to remove'),
bsTooltip('chBtrajRem', help.text.short[1], placement = "right", trigger = "hover", options = NULL), bsTooltip('chBtrajRem', helpText.server[4], placement = "bottom", trigger = "hover", options = NULL),
uiOutput('uiFileLoadTrajRem'), uiOutput('uiFileLoadTrajRem'),
uiOutput('uiButLoadTrajRem'), uiOutput('uiButLoadTrajRem'),
#tags$hr(), #tags$hr(),
checkboxInput('chBstim', 'Upload stimulation pattern'), checkboxInput('chBstim', 'Upload stimulation pattern'),
bsTooltip('chBstim', help.text.short[4], placement = "right", trigger = "hover", options = NULL), bsTooltip('chBstim', helpText.server[5], placement = "bottom", trigger = "hover", options = NULL),
uiOutput('uiFileLoadStim'), uiOutput('uiFileLoadStim'),
uiOutput('uiButLoadStim'), uiOutput('uiButLoadStim'),
#tags$hr(), #tags$hr(),
checkboxInput('chBtrajInter', 'Interpolate NAs and missing data', value = F), checkboxInput('chBtrajInter', 'Interpolate NAs and missing data', value = F),
bsTooltip('chBtrajInter', help.text.short[3], placement = "right", trigger = "hover", options = NULL), bsTooltip('chBtrajInter', helpText.server[6], placement = "bottom", trigger = "hover", options = NULL),
uiOutput('varSelTimeFreq'), uiOutput('varSelTimeFreq'),
checkboxInput('chBtrackUni', 'Create unique ID', F), checkboxInput('chBtrackUni', 'Create unique track ID', F),
bsTooltip('chBtrackUni', help.text.short[2], placement = "right", trigger = "hover", options = NULL), bsTooltip('chBtrackUni', helpText.server[7], placement = "bottom", trigger = "hover", options = NULL),
uiOutput('varSelSite'),
tags$hr(), tags$hr(),
uiOutput('varSelSite'),
uiOutput('varSelTrackLabel'), uiOutput('varSelTrackLabel'),
checkboxInput('chBgroup', 'Select grouping column', F), checkboxInput('chBgroup', 'Columns for plot grouping', F),
bsTooltip('chBgroup', help.text.short[5], placement = "right", trigger = "hover", options = NULL), bsTooltip('chBgroup', helpText.server[8], placement = "bottom", trigger = "hover", options = NULL),
uiOutput('varSelGroup'), uiOutput('varSelGroup'),
uiOutput('varSelTime'), uiOutput('varSelTime'),
...@@ -78,17 +83,17 @@ shinyUI(fluidPage( ...@@ -78,17 +83,17 @@ shinyUI(fluidPage(
'1 / X' = '1 / ' '1 / X' = '1 / '
) )
), ),
bsTooltip('inSelMath', help.text.short[6], placement = "right", trigger = "hover", options = NULL), bsTooltip('inSelMath', helpText.server[9], placement = "bottom", trigger = "hover", options = NULL),
uiOutput('varSelMeas2'), uiOutput('varSelMeas2'),
tags$hr(), tags$hr(),
checkboxInput('chBtimeTrim', 'Trim x-axis', FALSE), checkboxInput('chBtimeTrim', 'Trim x-axis', FALSE),
bsTooltip('chBtimeTrim', help.text.short[7], placement = "right", trigger = "hover", options = NULL), bsTooltip('chBtimeTrim', helpText.server[10], placement = "bottom", trigger = "hover", options = NULL),
uiOutput('uiSlTimeTrim'), uiOutput('uiSlTimeTrim'),
checkboxInput('chBnorm', 'Normalization', FALSE), checkboxInput('chBnorm', 'Normalization', FALSE),
bsTooltip('chBnorm', help.text.short[8], placement = "right", trigger = "hover", options = NULL), bsTooltip('chBnorm', helpText.server[11], placement = "bottom", trigger = "hover", options = NULL),
uiOutput('uiChBnorm'), uiOutput('uiChBnorm'),
uiOutput('uiSlNorm'), uiOutput('uiSlNorm'),
uiOutput('uiChBnormRobust'), uiOutput('uiChBnormRobust'),
...@@ -96,7 +101,7 @@ shinyUI(fluidPage( ...@@ -96,7 +101,7 @@ shinyUI(fluidPage(
tags$hr(), tags$hr(),
downloadButton('downloadDataClean', 'Download mod\'d data'), downloadButton('downloadDataClean', 'Download mod\'d data'),
bsTooltip('downloadDataClean', help.text.short[9], placement = "right", trigger = "hover", options = NULL) bsTooltip('downloadDataClean', helpText.server[16], placement = "bottom", trigger = "hover", options = NULL)
), ),
mainPanel( mainPanel(
......
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