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
library(shiny)
dmattek's avatar
dmattek committed
9 10
library(shinyjs) # http://deanattali.com/shinyjs/
library(shinyBS) # for tooltips
dmattek's avatar
dmattek committed
11
library(shinycssloaders) # for loader animations
dmattek's avatar
dmattek committed
12 13

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

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

      uiOutput('varSelTrackLabel'),
58
      #tags$hr(),
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
      
dmattek's avatar
dmattek committed
63 64
      checkboxInput('chBgroup', 'Group data', F),                
      bsTooltip('chBgroup', helpText.server[["chBgroup"]], placement = "top", trigger = "hover", options = NULL),
65

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

90 91 92 93 94
      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
95
      checkboxInput('chBnorm', 'Normalization', FALSE),
dmattek's avatar
dmattek committed
96
      bsTooltip('chBnorm', helpText.server[["chBnorm"]], placement = "top", trigger = "hover", options = NULL),
dmattek's avatar
dmattek committed
97 98 99
      uiOutput('uiChBnorm'),
      uiOutput('uiSlNorm'),
      uiOutput('uiChBnormRobust'),
dmattek's avatar
dmattek committed
100
      uiOutput('uiChBnormGroup'),
101

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