ui.R 5.4 KB
Newer Older
dmattek's avatar
dmattek committed
1
#
dmattek's avatar
dmattek committed
2
3
# Time Course Inspector: Shiny app for plotting time series data
# Author: Maciej Dobrzynski
dmattek's avatar
dmattek committed
4
#
dmattek's avatar
dmattek committed
5
6
7
# This is the user-interface definition for a Shiny web application.
#

dmattek's avatar
dmattek committed
8
9

library(shiny)
dmattek's avatar
dmattek committed
10
11
library(shinyjs) # http://deanattali.com/shinyjs/
library(shinyBS) # for tooltips
dmattek's avatar
dmattek committed
12
library(shinycssloaders) # for loader animations
dmattek's avatar
dmattek committed
13
14

shinyUI(fluidPage(
dmattek's avatar
dmattek committed
15
16
  useShinyjs(),
  # Include shinyjs
dmattek's avatar
dmattek committed
17
18
19
20
  
  # Application title
  title = "Timecourse Inspector",
  
dmattek's avatar
dmattek committed
21
  sidebarLayout(
Maciej Dobrzynski's avatar
Maciej Dobrzynski committed
22
    sidebarPanel(width = 3,
dmattek's avatar
dmattek committed
23
24
25
      #Selector for file upload
      fileInput(
        'inFileLoadNuc',
dmattek's avatar
dmattek committed
26
        "Select data file and click Load Data",
dmattek's avatar
dmattek committed
27
28
29
30
        accept = c("text/csv", 
                   "text/comma-separated-values,text/plain", 
                   "application/gzip", 
                   "application/bz2"), 
dmattek's avatar
dmattek committed
31
      ),
dmattek's avatar
dmattek committed
32

dmattek's avatar
dmattek committed
33
34
      radioButtons("inRbutLongWide", actionLink("alDataFormat", "Data Format:"), c("Long" = 0, "Wide" = 1), inline = T),
      bsAlert("alertAnchorSidePanelDataFormat"),
dmattek's avatar
dmattek committed
35
      
dmattek's avatar
dmattek committed
36
37
      actionButton("inButLoadNuc", "Load Data"),
      actionButton("butReset", "Reset file input"),
dmattek's avatar
dmattek committed
38
      
39
      actionButton('inDataGen1', 'Synthetic data'),
dmattek's avatar
dmattek committed
40
      bsTooltip('inDataGen1', helpText.server[["inDataGen1"]], placement = "top", trigger = "hover", options = NULL),
dmattek's avatar
Added:    
dmattek committed
41
42
      
      tags$hr(),
dmattek's avatar
dmattek committed
43
      checkboxInput('chBtrajRem', 'Upload tracks to remove'),
dmattek's avatar
dmattek committed
44
      bsTooltip('chBtrajRem', helpText.server[["chBtrajRem"]], placement = "top", trigger = "hover", options = NULL),
dmattek's avatar
Added:    
dmattek committed
45
46
47
48
      
      uiOutput('uiFileLoadTrajRem'),
      uiOutput('uiButLoadTrajRem'),
      
49
      #tags$hr(),
50
      checkboxInput('chBstim', 'Upload stimulation pattern'),
dmattek's avatar
dmattek committed
51
      bsTooltip('chBstim', helpText.server[["chBstim"]], placement = "top", trigger = "hover", options = NULL),
52
53
54
55
      
      uiOutput('uiFileLoadStim'),
      uiOutput('uiButLoadStim'),
      
56
      #tags$hr(),
dmattek's avatar
dmattek committed
57
      checkboxInput('chBtrackUni', 'Create unique track ID', F),
dmattek's avatar
dmattek committed
58
      bsTooltip('chBtrackUni', helpText.server[["chBtrackUni"]], placement = "top", trigger = "hover", options = NULL),
dmattek's avatar
dmattek committed
59
      uiOutput('varSelSite'),
60
61
62
      
      tags$hr(),

dmattek's avatar
dmattek committed
63
      uiOutput('varSelTrackLabel'),
64
      
dmattek's avatar
dmattek committed
65
66
      checkboxInput('chBgroup', 'Group data', F),                
      bsTooltip('chBgroup', helpText.server[["chBgroup"]], placement = "top", trigger = "hover", options = NULL),
67

dmattek's avatar
dmattek committed
68
69
70
71
      uiOutput('varSelGroup'),
      uiOutput('varSelTime'),
      uiOutput('varSelMeas1'),
      radioButtons(
Maciej Dobrzynski's avatar
Maciej Dobrzynski committed
72
        'inSelMath', width = '50%',
73
        'Math on 1st and 2nd meas.:',
dmattek's avatar
dmattek committed
74
75
76
77
78
79
80
81
82
        c(
          'None' = '',
          'Divide' = " / ",
          'Sum' = " + ",
          'Multiply' = " * ",
          'Subtract' = ' - ',
          '1 / X' = '1 / '
        )
      ),
dmattek's avatar
dmattek committed
83
      bsTooltip('inSelMath', helpText.server[["inSelMath"]], placement = "top", trigger = "hover", options = NULL),
84
      
dmattek's avatar
dmattek committed
85
86
      uiOutput('varSelMeas2'),
      
dmattek's avatar
dmattek committed
87
      tags$hr(),
dmattek's avatar
dmattek committed
88
89
      checkboxInput('chBtimeTrim', 'Trim X-axis', FALSE),
      bsTooltip('chBtimeTrim', helpText.server[["chBtimeTrim"]], placement = "top", trigger = "hover", options = NULL),
dmattek's avatar
dmattek committed
90
      uiOutput('uiSlTimeTrim'),
91

dmattek's avatar
dmattek committed
92
93
94
95
96
      checkboxInput('chBtrajInter', 'Interpolate NAs and missing data', value = F),
      bsAlert("alertAnchorSidePanelNAsPresent"),
      bsTooltip('chBtrajInter', helpText.server[["chBtrajInter"]], placement = "top", trigger = "hover", options = NULL),
      uiOutput('varSelTimeFreq'),
      
dmattek's avatar
dmattek committed
97
      checkboxInput('chBnorm', 'Normalization', FALSE),
dmattek's avatar
dmattek committed
98
      bsTooltip('chBnorm', helpText.server[["chBnorm"]], placement = "top", trigger = "hover", options = NULL),
dmattek's avatar
dmattek committed
99
100
101
      uiOutput('uiChBnorm'),
      uiOutput('uiSlNorm'),
      uiOutput('uiChBnormRobust'),
dmattek's avatar
dmattek committed
102
      uiOutput('uiChBnormGroup'),
103

dmattek's avatar
dmattek committed
104
      tags$hr(),
dmattek's avatar
dmattek committed
105
      downloadButton('downloadDataClean', 'Download processed data'),
dmattek's avatar
dmattek committed
106
      bsTooltip('downloadDataClean', helpText.server[["downloadDataClean"]], placement = "top", trigger = "hover", options = NULL)
107
    ),
dmattek's avatar
dmattek committed
108
    
109
110
111
112
113
    mainPanel(
      tabsetPanel(
        tabPanel(
          "Time series",
          h4(
dmattek's avatar
dmattek committed
114
            "Plot time series: averages per group or individual"
115
116
          ),
          br(),
dmattek's avatar
dmattek committed
117
          modSelOutliersUI('returnOutlierIDs'),
118
          tabsetPanel(
dmattek's avatar
dmattek committed
119
            tabPanel("Averages",
120
121
122
123
124
125
126
                     br(),
                     modTrajRibbonPlotUI('modTrajRibbon')
            ),
            
            tabPanel(
              "Individual",
              br(),
127
              checkboxInput('chBhighlightTraj', 'Highlight trajectories', FALSE),
128
129
130
              uiOutput('varSelHighlight'),
              br(),
              modTrajPlotUI('modTrajPlot')
131
132
133
134
135
136
            ),
            
            tabPanel(
              "Power Spectral Density",
              br(),
              modPSDPlotUI('modPSDPlot')
137
138
            )
          )
dmattek's avatar
Added:    
dmattek committed
139
        ),
dmattek's avatar
Added:    
dmattek committed
140
        
141
142
        tabPanel(
          "AUC",
dmattek's avatar
dmattek committed
143
          tabAUCplotUI('tabAUC')
144
145
146
        ),
        
        tabPanel(
dmattek's avatar
dmattek committed
147
          "Distributions",
dmattek's avatar
dmattek committed
148
          tabDistPlotUI('tabDistPlot')
149
150
151
152
153
154
155
156
157
        ),
        
        
        # scatter plot
        tabPanel(
          'Scatter',
          tabScatterPlotUI('tabScatter')
        ),
        
dmattek's avatar
dmattek committed
158
        # hierarchical clustering
159
160
161
        tabPanel(
          'Hierarchical',
          clustHierUI('tabClHier')
dmattek's avatar
dmattek committed
162
        ),
163
164
        
        # sparse hierarchical clustering package sparcl temporarily unavailable from CRAN
dmattek's avatar
dmattek committed
165
        tabPanel(
dmattek's avatar
dmattek committed
166
167
           'Hierarchical Sparse',
           clustHierSparUI('tabClHierSpar')
dmattek's avatar
dmattek committed
168
169
170
171
172
173
        ),
        
        # cluster validation
        tabPanel(
          'Validation',
          clustValidUI('tabClValid')
dmattek's avatar
dmattek committed
174
        )
175
      ))
dmattek's avatar
dmattek committed
176
177
  )
))