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
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'),
      
55
      #tags$hr(),
dmattek's avatar
dmattek committed
56
      checkboxInput('chBtrackUni', 'Create unique track ID', F),
dmattek's avatar
dmattek committed
57
      bsTooltip('chBtrackUni', helpText.server[["chBtrackUni"]], placement = "top", trigger = "hover", options = NULL),
dmattek's avatar
dmattek committed
58
      uiOutput('varSelSite'),
59 60 61
      
      tags$hr(),

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

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

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

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