Commit 4d081673 authored by dmattek's avatar dmattek

Bug fixes

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