Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pertz-lab
shiny-timecourse-inspector
Commits
4d081673
Commit
4d081673
authored
Oct 02, 2019
by
dmattek
Browse files
Bug fixes
parent
082b907a
Changes
7
Hide whitespace changes
Inline
Side-by-side
modules/auxfunc.R
View file @
4d081673
...
...
@@ -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 ----
...
...
modules/dispStats.R
View file @
4d081673
...
...
@@ -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'
))
)
...
...
modules/tabAUC.R
View file @
4d081673
...
...
@@ -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"
)
}
...
...
modules/tabClHier.R
View file @
4d081673
...
...
@@ -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"
)
),
...
...
modules/tabScatter.R
View file @
4d081673
...
...
@@ -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
.t
ext.
short
[
16
],
placement
=
"
right
"
,
trigger
=
"hover"
,
options
=
NULL
)
bsTooltip
(
ns
(
'chBregression'
),
help
T
ext.
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
=
'
20
0px'
,
width
=
'
18
0px'
,
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"
)
...
...
server.R
View file @
4d081673
...
...
@@ -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 t
ime column:'
,
'
T
ime 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 c
olumns to add to track
label
:'
,
'
C
olumns 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 meas
urement
:'
,
locCols
,
width
=
'100%'
,
selected
=
locColSel
...
...
@@ -298,7 +298,7 @@ shinyServer(function(input, output, session) {
selectInput
(
'inSelMeas2'
,
'
Select
2nd meas
.
'
,
'
Column with
2nd meas
urement
'
,
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
.t
ext.s
hort
[
1
1
],
placement
=
"
right
"
,
trigger
=
"hover"
,
options
=
NULL
)
bsTooltip
(
'rBnormMeth'
,
help
T
ext.s
erver
[
1
2
],
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
.t
ext.s
hort
[
1
2
],
placement
=
"
right
"
,
trigger
=
"hover"
,
options
=
NULL
)
bsTooltip
(
'slNormRtMinMax'
,
help
T
ext.s
erver
[
1
3
],
placement
=
"
bottom
"
,
trigger
=
"hover"
,
options
=
NULL
)
)
}
})
...
...
@@ -393,7 +393,7 @@ shinyServer(function(input, output, session) {
label
=
'Robust stats'
,
FALSE
,
width
=
"40%"
),
bsTooltip
(
'chBnormRobust'
,
help
.t
ext.s
hort
[
1
3
],
placement
=
"
right
"
,
trigger
=
"hover"
,
options
=
NULL
)
bsTooltip
(
'chBnormRobust'
,
help
T
ext.s
erver
[
1
4
],
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
.t
ext.s
hort
[
1
4
],
placement
=
"
right
"
,
trigger
=
"hover"
,
options
=
NULL
)
bsTooltip
(
'chBnormGroup'
,
help
T
ext.s
erver
[
1
5
],
placement
=
"
bottom
"
,
trigger
=
"hover"
,
options
=
NULL
)
)
}
})
...
...
ui.R
View file @
4d081673
...
...
@@ -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
ID
s to remove'
),
bsTooltip
(
'chBtrajRem'
,
help
.t
ext.s
hort
[
1
],
placement
=
"
right
"
,
trigger
=
"hover"
,
options
=
NULL
),
checkboxInput
(
'chBtrajRem'
,
'Upload
track
s to remove'
),
bsTooltip
(
'chBtrajRem'
,
help
T
ext.s
erver
[
4
],
placement
=
"
bottom
"
,
trigger
=
"hover"
,
options
=
NULL
),
uiOutput
(
'uiFileLoadTrajRem'
),
uiOutput
(
'uiButLoadTrajRem'
),
#tags$hr(),
checkboxInput
(
'chBstim'
,
'Upload stimulation pattern'
),
bsTooltip
(
'chBstim'
,
help
.t
ext.s
hort
[
4
],
placement
=
"
right
"
,
trigger
=
"hover"
,
options
=
NULL
),
bsTooltip
(
'chBstim'
,
help
T
ext.s
erver
[
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
.t
ext.s
hort
[
3
],
placement
=
"
right
"
,
trigger
=
"hover"
,
options
=
NULL
),
bsTooltip
(
'chBtrajInter'
,
help
T
ext.s
erver
[
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'
,
'
Selec
t grouping
column
'
,
F
),
bsTooltip
(
'chBgroup'
,
help
.t
ext.s
hort
[
5
],
placement
=
"
right
"
,
trigger
=
"hover"
,
options
=
NULL
),
checkboxInput
(
'chBgroup'
,
'
Columns for plo
t grouping'
,
F
),
bsTooltip
(
'chBgroup'
,
help
T
ext.s
erver
[
8
],
placement
=
"
bottom
"
,
trigger
=
"hover"
,
options
=
NULL
),
uiOutput
(
'varSelGroup'
),
uiOutput
(
'varSelTime'
),
...
...
@@ -78,17 +83,17 @@ shinyUI(fluidPage(
'1 / X'
=
'1 / '
)
),
bsTooltip
(
'inSelMath'
,
help
.t
ext.s
hort
[
6
],
placement
=
"
right
"
,
trigger
=
"hover"
,
options
=
NULL
),
bsTooltip
(
'inSelMath'
,
help
T
ext.s
erver
[
9
],
placement
=
"
bottom
"
,
trigger
=
"hover"
,
options
=
NULL
),
uiOutput
(
'varSelMeas2'
),
tags
$
hr
(),
checkboxInput
(
'chBtimeTrim'
,
'Trim x-axis'
,
FALSE
),
bsTooltip
(
'chBtimeTrim'
,
help
.t
ext.s
hort
[
7
],
placement
=
"
right
"
,
trigger
=
"hover"
,
options
=
NULL
),
bsTooltip
(
'chBtimeTrim'
,
help
T
ext.s
erver
[
10
],
placement
=
"
bottom
"
,
trigger
=
"hover"
,
options
=
NULL
),
uiOutput
(
'uiSlTimeTrim'
),
checkboxInput
(
'chBnorm'
,
'Normalization'
,
FALSE
),
bsTooltip
(
'chBnorm'
,
help
.t
ext.s
hort
[
8
],
placement
=
"
right
"
,
trigger
=
"hover"
,
options
=
NULL
),
bsTooltip
(
'chBnorm'
,
help
T
ext.s
erver
[
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
.t
ext.s
hort
[
9
],
placement
=
"
right
"
,
trigger
=
"hover"
,
options
=
NULL
)
bsTooltip
(
'downloadDataClean'
,
help
T
ext.s
erver
[
16
],
placement
=
"
bottom
"
,
trigger
=
"hover"
,
options
=
NULL
)
),
mainPanel
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment