ui.R 5.33 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",
27
        accept = c('text/csv', 'text/comma-separated-values,text/plain', "application/gzip", "application/bz2"), 
dmattek's avatar
dmattek committed
28
      ),
dmattek's avatar
dmattek committed
29

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

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

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

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

dmattek's avatar
dmattek committed
94
      checkboxInput('chBnorm', 'Normalization', FALSE),
dmattek's avatar
dmattek committed
95
      bsTooltip('chBnorm', helpText.server[["chBnorm"]], placement = "top", trigger = "hover", options = NULL),
dmattek's avatar
dmattek committed
96 97 98
      uiOutput('uiChBnorm'),
      uiOutput('uiSlNorm'),
      uiOutput('uiChBnormRobust'),
dmattek's avatar
dmattek committed
99
      uiOutput('uiChBnormGroup'),
100

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