Commit 3086a926 authored by dmattek's avatar dmattek

Changed UI labels.

Added test case dataset.
parent d11f606f
# Test case dataset
This dataset contains around 234 time-series with 121 time points each. The set comes from a microfluidic time-lapse microscopy experiment. In this experiment, PC-12 cells were stimulated with 3 dosages of fibroblast growth factor 2 (FGF2): 2.5 ng/ml, 25 ng/ml, and 250 ng/ml. The stimulation was performed with 3' pulses of FGF2 at 20' intervals. The readout is the measurement of ERK activity using a FRET biosensor.
The set comes from a publication Blum *et al.* (2019) *Temporal perturbation of Erk dynamics reveals network architecture of FGF2-MAPK signaling* (**preprint**), available in [bioRxiv](https://www.biorxiv.org/content/10.1101/629287v1"bioRxiv")].
Files in this set:
**`mp3-20_FGF_ekar.csv.gz`**
Main dataset in the long format with following columns:
- `intensity_ekar` - measurement of the biosensor
- `realtime` - time points in minutes
- `id` - identifiers of time-series
- `group` - grouping according to treatment with 3 concentrations of FGF2
- `fov` - additional grouping according to the field of view during experiment acquisition.
Note, the `id` column contains identifiers that are unique only within a single field of view. Thus, in order to create data-wide unique identifiers, you need to combine the `fov` and `id` columns.
The `csv.gz` file can be uploaded directly into Time Course Inspector (TCI).
**`mp3-20_FGF_badTraj.csv`**
A single-column csv file with identifiers of outlier trajectories. This file can be uploaded into TCI, and listed time series will be removed from further analysis. The IDs need to be in the same format as in the app. If a unique identifier was created within the app (e.g. by combining ''fov'' and ''id'' columns), then the IDs in this file need to be of the same form.
**`mp3-20_FGF_pulsey_y0-97.csv`** and **`mp3-20_FGF_pulse_y1100`**
Files with coordinates of segments to plot under time-series. Each row should contain x and y coordinates of the start and end of segments (4 columns: `tstart`, `tend`, `ystart`, `yend`), `group` column used for grouping of the main dataset in the app, a dummy `id` column.
\ No newline at end of file
id
12_6
2_3
15_2
12_1
2_37
7_35
14_19
14_8
12_5
2_12
0_40
3_19
2_20
1_8
0_27
5_9
4_23
8_3
8_1
3_38
0_4
0_16
11_15
3_28
12_21
13_38
12_7
6_2
10_25
11_11
7_13
15_7
14_14
10_20
\ No newline at end of file
group.idx,tstart,tend,ystart,yend,group,id
5,43,46,1100,1100,250,1
5,66,69,1100,1100,250,1
5,89,92,1100,1100,250,1
5,112,115,1100,1100,250,1
6,43,46,1100,1100,25,1
6,66,69,1100,1100,25,1
6,89,92,1100,1100,25,1
6,112,115,1100,1100,25,1
7,43,46,1100,1100,2.5,1
7,66,69,1100,1100,2.5,1
7,89,92,1100,1100,2.5,1
7,112,115,1100,1100,2.5,1
\ No newline at end of file
group.idx,tstart,tend,ystart,yend,group,id
5,43,46,0.97,0.97,250,1
5,66,69,0.97,0.97,250,1
5,89,92,0.97,0.97,250,1
5,112,115,0.97,0.97,250,1
6,43,46,0.97,0.97,25,1
6,66,69,0.97,0.97,25,1
6,89,92,0.97,0.97,25,1
6,112,115,0.97,0.97,25,1
7,43,46,0.97,0.97,2.5,1
7,66,69,0.97,0.97,2.5,1
7,89,92,0.97,0.97,2.5,1
7,112,115,0.97,0.97,2.5,1
\ No newline at end of file
......@@ -2,7 +2,7 @@
# Time Course Inspector: Shiny app for plotting time series data
# Author: Maciej Dobrzynski
#
# These are auxilary functions
# Auxilary functions & definitions of global constants
#
......@@ -25,6 +25,7 @@ DEB = T
# PLOTFONTFACETSTRIP = 10
# PLOTFONTLEGEND = 8
# font sizes in pts for screen display
PLOTFONTBASE = 16
PLOTFONTAXISTEXT = 16
PLOTFONTAXISTITLE = 16
......@@ -155,28 +156,16 @@ helpPopup <- function(title, content,
)
}
help.text = c(
'Accepts CSV file with a column of cell IDs for removal.
IDs should correspond to those used for plotting.
Say, the main data file contains columns Metadata_Site and TrackLabel.
These two columns should be then selected in UI to form a unique cell ID, e.g. 001_0001 where former part corresponds to Metadata_Site and the latter to TrackLabel.',
'Plotting and data processing requires a unique cell ID across entire dataset. A typical dataset from CellProfiler assigns unique cell ID (TrackLabel) within each field of view (Metadata_Site).
Therefore, a unique ID is created by concatenating these two columns. If the dataset already contains a unique ID, UNcheck this box and select a single column only.',
'This option allows to interpolate NAs or missing data. Some rows in the input file might be missing because a particular time point might not had been acquired.
This option, interpolates such missing points as well as points with NAs in the measurement column. When this option is checked, the interval of time column must be provided!',
'Accepts CSV file with 5 columns: grouping (e.g. condition), start and end time points of stimulation, start and end points of y-position, dummy column with id.'
)
help.text.short = c(
'Load CSV file with a column of cell IDs for removal. IDs should correspond to those used for plotting.',
'Load CSV file with a column of track IDs for removal. IDs should correspond to those used for plotting.',
'If the track ID is unique only within a group, make it unique globally by combining with the grouping column.',
'Interpolate missing tpts and pre-existing NAs. When checked, the interval of time column must be provided!',
'Load CSV file with 5 columns: grouping, start and end tpts of stimulation, start and end of y-position, dummy column with id.',
'Interpolate missing time points and pre-existing NAs. The interval of the time column must be provided!',
'Load CSV file with 5 columns: grouping, start and end tpts of stimulation, start and end of y-position, dummy column with ID.',
'Select columns to group data according to treatment, condition, etc.',
'Select math operation to perform on a single or two columns,',
'Select range of time for further processing.',
'Normalise data to a selected region.',
'Download data after modification in this section.'
'Normalise time series to a selected region.',
'Download time series after modification in this section.'
)
# Functions for data processing ----
......
# Module for plotting a choice of box/violin/dot-plots
#
# Time Course Inspector: Shiny app for plotting time series data
# Author: Maciej Dobrzynski
#
# This module is for plotting a choice of box/violin/dot-plots
# Assumes in.data contains columns:
# realtime
# y
# group
# id
# UI ----
modBoxPlotUI = function(id, label = "Plot Box-plots") {
ns <- NS(id)
......@@ -68,7 +73,7 @@ modBoxPlotUI = function(id, label = "Plot Box-plots") {
)
}
# SERVER ----
modBoxPlot = function(input, output, session,
in.data,
in.cols = list(meas.x = 'realtime',
......
modClDistPlotUI = function(id, label = "Plot Fractions WIthin Clusters") {
#
# Time Course Inspector: Shiny app for plotting time series data
# Author: Maciej Dobrzynski
#
# This module is for plotting stacked bar plot with percentages of time series in clusters
#
# UI ----
modClDistPlotUI = function(id, label = "Plot Fractions Within Clusters") {
ns <- NS(id)
tagList(
......@@ -14,6 +22,8 @@ modClDistPlotUI = function(id, label = "Plot Fractions WIthin Clusters") {
# SERVER ----
# Params:
# in.data - data prepared with data4clDistPlot f-n
# in.cols - table with 1st column as cluster number, 2nd column colour assignments
......@@ -55,7 +65,7 @@ modClDistPlot = function(input, output, session, in.data, in.cols = NULL, in.fna
p.out = p.out +
scale_y_continuous(labels = percent) +
ylab("percentage of cells\n") +
ylab("Percentage of time-series\n") +
xlab("") +
LOCggplotTheme(in.font.base = PLOTFONTBASE,
in.font.axis.text = PLOTFONTAXISTEXT,
......
#
# Time Course Inspector: Shiny app for plotting time series data
# Author: Maciej Dobrzynski
#
# This module is for displaying time series statistics
#
require(DT)
require(data.table)
# UI ----
modTrackStatsUI = function(id, label = "Comparing t-points") {
ns <- NS(id)
......@@ -10,7 +19,7 @@ modTrackStatsUI = function(id, label = "Comparing t-points") {
)
}
# SERVER ----
modTrackStats = function(input, output, session,
in.data) {
......@@ -61,7 +70,7 @@ modTrackStats = function(input, output, session,
if (is.null(loc.dt))
return(NULL)
sprintf('<b>Number of tracks: %d <br>Average track length: %.2f time units</b>',
sprintf('<b>Number of time-series: %d <br>Average length: %.2f time units</b>',
length(unique(loc.dt[['id']])),
loc.dt[, .(trackLength = .N), by = 'id'][, mean(trackLength)])
......
......@@ -2,8 +2,7 @@
# Time Course Inspector: Shiny app for plotting time series data
# Author: Maciej Dobrzynski
#
# This is the module of a Shiny web application.
# Download CSV with data
# This module is for downloading CSV with data
#
# Usage:
# in ui.R
......
# RShiny module for downloading pdf of the plot
#
# Time Course Inspector: Shiny app for plotting time series data
# Author: Maciej Dobrzynski
#
# This module is for downloading pdf of the plot
# Use:
# in ui.R
# downPlotUI('uniqueID', "your_label")
......@@ -6,7 +10,7 @@
# in server.R
# callModule(downPlot, "uniqueID", 'fname.pdf', input_plot_to_save)
# UI ----
downPlotUI <- function(id, label = "Download Plot") {
ns <- NS(id)
......@@ -41,6 +45,8 @@ downPlotUI <- function(id, label = "Download Plot") {
)
}
# SERVER ----
downPlot <- function(input, output, session, in.fname, in.plot, in.gg = FALSE) {
output$uiDownButton = renderUI({
......
......@@ -2,7 +2,7 @@
# Time Course Inspector: Shiny app for plotting time series data
# Author: Maciej Dobrzynski
#
# This is the module of a Shiny web application.
# This is a module of a Shiny web application.
# Outlier identification, selection
# UI-remove-outliers ----
......
#
# Time Course Inspector: Shiny app for plotting time series data
# Author: Maciej Dobrzynski
#
# This module is a tab for plotting Area Under Curve
#
# Calculates area under curve (AUC) for every single time course provided in the input
require(pracma) # for trapz
# UI ----
modAUCplotUI = function(id, label = "Plot Area Under Curves") {
ns <- NS(id)
......@@ -19,6 +26,7 @@ modAUCplotUI = function(id, label = "Plot Area Under Curves") {
)
}
# SERVER ----
modAUCplot = function(input, output, session, in.data, in.fname) {
ns <- session$ns
......
#
# Time Course Inspector: Shiny app for plotting time series data
# Author: Maciej Dobrzynski
#
# This module is a tab for plotting box-plots at selected time points
#
# UI ----
tabBoxPlotUI = function(id, label = "Comparing t-points") {
ns <- NS(id)
......@@ -19,8 +27,7 @@ tabBoxPlotUI = function(id, label = "Comparing t-points") {
)
}
####
## server box-plot
# SERVER ----
tabBoxPlot = function(input, output, session, in.data, in.fname) {
callModule(modStats, 'dispStats',
......
# RShiny module for performing Bayesian clustering using bclust
#
# Time Course Inspector: Shiny app for plotting time series data
# Author: Maciej Dobrzynski
#
# This module is for Bayesian clustering using bclust package
# NOT USED AT THE MOMENT!!!
#
# Use:
# in ui.R
# tabPanel(
......@@ -27,7 +33,7 @@ l.col.pal = list(
"Blues" = "Blues"
)
# UI
# UI ----
clustBayUI <- function(id, label = "Sparse Hierarchical CLustering") {
ns <- NS(id)
......@@ -142,7 +148,7 @@ clustBayUI <- function(id, label = "Sparse Hierarchical CLustering") {
)
}
# SERVER
# SERVER ----
clustBay <- function(input, output, session, dataMod) {
userFitBclus <- reactive({
cat(file = stderr(), 'userFitBclus \n')
......
......@@ -2,8 +2,7 @@
# Time Course Inspector: Shiny app for plotting time series data
# Author: Maciej Dobrzynski
#
# This is the module of a Shiny web application.
# Hierarchical clustering
# This module is a tab for hierarchical clustering (base R hclust + dist)
# UI ----
clustHierUI <- function(id, label = "Hierarchical CLustering") {
......@@ -51,9 +50,12 @@ clustHierUI <- function(id, label = "Hierarchical CLustering") {
ticks = TRUE,
round = TRUE
),
# These two lines are to manually assign colours to clusters; it doesn't really work well, so skip
# NOT USED AT THE MOMENT!
#checkboxInput(ns('chBPlotHierClAss'), 'Manually assign cluster colours'),
#uiOutput(ns('uiPlotHierClAss')),
checkboxInput(ns('chBPlotHierClSel'), 'Manually select clusters to display'),
uiOutput(ns('uiPlotHierClSel')),
downloadButton(ns('downCellCl'), 'Download CSV with cell IDs and cluster no.')
......@@ -279,9 +281,10 @@ clustHier <- function(input, output, session, in.data4clust, in.data4trajPlot, i
loc.col = get(input$selectPlotHierPaletteDend)(n = loc.k)
# take into account manual assignment of cluster numbers
if (input$chBPlotHierClAss) {
loc.col = loc.col[as.numeric(input$inPlotHierClAss)]
}
# NOT USED AT THE MOMENT
#if (input$chBPlotHierClAss) {
# loc.col = loc.col[as.numeric(input$inPlotHierClAss)]
#}
dend <- as.dendrogram(cl.hc)
dend <- color_branches(dend,
......
#
# Time Course Inspector: Shiny app for plotting time series data
# Author: Maciej Dobrzynski
#
# This module is for sparse hierarchical clustering using sparcl package
#
# UI
# UI ----
clustHierSparUI <- function(id, label = "Sparse Hierarchical CLustering") {
ns <- NS(id)
......@@ -183,7 +189,7 @@ clustHierSparUI <- function(id, label = "Sparse Hierarchical CLustering") {
)
}
# SERVER
# SERVER ----
clustHierSpar <- function(input, output, session, in.data4clust, in.data4trajPlot, in.data4stimPlot) {
# UI for advanced options
......
# RShiny module for the scatter plot
#
# Time Course Inspector: Shiny app for plotting time series data
# Author: Maciej Dobrzynski
#
# This module is a tab for plotting scatter plots between two time points
#
# Use:
# in ui.R
# tabPanel(
......@@ -14,7 +19,7 @@ require(plotly) # interactive plot
require(robust)
require(MASS)
# UI
# UI ----
tabScatterPlotUI <- function(id, label = "Comparing t-points") {
ns <- NS(id)
......@@ -65,7 +70,7 @@ tabScatterPlotUI <- function(id, label = "Comparing t-points") {
)
}
# SERVER
# SERVER ----
tabScatterPlot <- function(input, output, session, in.data, in.fname) {
# return all unique time points (real time)
......
......@@ -2,7 +2,7 @@
# Time Course Inspector: Shiny app for plotting time series data
# Author: Maciej Dobrzynski
#
# This is the module for plotting individual time series
# This module is for plotting individual time series
#
......
#
# Time Course Inspector: Shiny app for plotting time series data
# Author: Marc-Antoine Jacques
#
# This module is for plotting Power Spectral Analysis
#
require(DT)
require(scales)
......@@ -82,10 +89,6 @@ modPSDPlot = function(input, output, session,
})
callModule(modTrackStats, 'dispTrackStats',
in.data = in.data)
output$outPlotTraj <- renderPlot({
loc.p = plotTraj()
......
#
# Time Course Inspector: Shiny app for plotting time series data
# Author: Maciej Dobrzynski
#
# This module is for plotting group averages as ribbon plots (mean + 95%CI)
#
require(DT)
modTrajRibbonPlotUI = function(id, label = "Plot Individual Time Series") {
......
......@@ -166,7 +166,7 @@ shinyServer(function(input, output, session) {
selectInput(
'inSelTrackLabel',
'Select Track Label:',
'Select ID:',
locCols,
width = '100%',
selected = locColSel
......
......@@ -49,7 +49,7 @@ shinyUI(fluidPage(
uiOutput('varSelTimeFreq'),
checkboxInput('chBtrackUni', 'Create unique track ID', F),
checkboxInput('chBtrackUni', 'Create unique ID', F),
bsTooltip('chBtrackUni', help.text.short[2], placement = "right", trigger = "hover", options = NULL),
tags$hr(),
......
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