ui.R 5.39 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 57
      #tags$hr(),
      checkboxInput('chBtrajInter', 'Interpolate NAs and missing data', value = F),
dmattek's avatar
dmattek committed
58 59
      bsAlert("alertAnchorSidePanelNAsPresent"),
      bsTooltip('chBtrajInter', helpText.server[["chBtrajInter"]], placement = "top", trigger = "hover", options = NULL),
60
      uiOutput('varSelTimeFreq'),
61

dmattek's avatar
dmattek committed
62
      checkboxInput('chBtrackUni', 'Create unique track ID', F),
dmattek's avatar
dmattek committed
63
      bsTooltip('chBtrackUni', helpText.server[["chBtrackUni"]], placement = "top", trigger = "hover", options = NULL),
dmattek's avatar
dmattek committed
64
      uiOutput('varSelSite'),
65 66 67
      
      tags$hr(),

dmattek's avatar
dmattek committed
68
      uiOutput('varSelTrackLabel'),
69
      
dmattek's avatar
dmattek committed
70 71
      checkboxInput('chBgroup', 'Group data', F),                
      bsTooltip('chBgroup', helpText.server[["chBgroup"]], placement = "top", trigger = "hover", options = NULL),
72

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

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
  )
))