ui.R 4.63 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
library(shinyjs) #http://deanattali.com/shinyjs/
11
library(shinyBS)
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 21 22 23 24
  sidebarLayout(
    sidebarPanel(
      #Selector for file upload
      fileInput(
        'inFileLoadNuc',
25
        'Select main data file and press "Load Data"',
dmattek's avatar
dmattek committed
26 27 28 29
        accept = c('text/csv', 'text/comma-separated-values,text/plain')
      ),
      actionButton("inButLoadNuc", "Load Data"),
      actionButton("butReset", "Reset file input"),
30
      actionButton('inDataGen1', 'Synthetic data'),
dmattek's avatar
dmattek committed
31 32 33
      
      tags$hr(),
      checkboxInput('chBtrajRem', 'Upload IDs to remove'),
34
      bsTooltip('chBtrajRem', help.text.short[1], placement = "right", trigger = "hover", options = NULL),
dmattek's avatar
dmattek committed
35 36 37 38
      
      uiOutput('uiFileLoadTrajRem'),
      uiOutput('uiButLoadTrajRem'),
      
39
      #tags$hr(),
40
      checkboxInput('chBstim', 'Upload stimulation pattern'),
41
      bsTooltip('chBstim', help.text.short[4], placement = "right", trigger = "hover", options = NULL),
42 43 44 45
      
      uiOutput('uiFileLoadStim'),
      uiOutput('uiButLoadStim'),
      
46 47 48
      #tags$hr(),
      checkboxInput('chBtrajInter', 'Interpolate NAs and missing data', value = F),
      bsTooltip('chBtrajInter', help.text.short[3], placement = "right", trigger = "hover", options = NULL),
49 50
      
      uiOutput('varSelTimeFreq'),
51 52 53 54 55 56

      checkboxInput('chBtrackUni', 'Create unique track ID', F),
      bsTooltip('chBtrackUni', help.text.short[2], placement = "right", trigger = "hover", options = NULL),
      
      tags$hr(),

dmattek's avatar
dmattek committed
57 58
      uiOutput('varSelSite'),
      uiOutput('varSelTrackLabel'),
59
      
60 61 62
      checkboxInput('chBgroup', 'Select grouping column', F),                
      bsTooltip('chBgroup', help.text.short[5], placement = "right", trigger = "hover", options = NULL),

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

dmattek's avatar
dmattek committed
87
      checkboxInput('chBnorm', 'Normalization', FALSE),
88
      bsTooltip('chBnorm', help.text.short[8], placement = "right", trigger = "hover", options = NULL),
dmattek's avatar
dmattek committed
89 90 91
      uiOutput('uiChBnorm'),
      uiOutput('uiSlNorm'),
      uiOutput('uiChBnormRobust'),
dmattek's avatar
dmattek committed
92
      uiOutput('uiChBnormGroup'),
93

dmattek's avatar
dmattek committed
94
      tags$hr(),
95 96
      downloadButton('downloadDataClean', 'Download mod\'d data'),
      bsTooltip('downloadDataClean', help.text.short[9], placement = "right", trigger = "hover", options = NULL)
97
    ),
dmattek's avatar
dmattek committed
98
    
99 100 101 102 103 104 105 106
    mainPanel(
      tabsetPanel(
        tabPanel(
          "Time series",
          h4(
            "Plot time series: means per group or individual"
          ),
          br(),
dmattek's avatar
dmattek committed
107
          modSelOutliersUI('returnOutlierIDs'),
108 109 110 111 112 113 114 115 116
          tabsetPanel(
            tabPanel("Means",
                     br(),
                     modTrajRibbonPlotUI('modTrajRibbon')
            ),
            
            tabPanel(
              "Individual",
              br(),
117
              checkboxInput('chBhighlightTraj', 'Highlight trajectories', FALSE),
118 119 120
              uiOutput('varSelHighlight'),
              br(),
              modTrajPlotUI('modTrajPlot')
121 122 123 124 125 126
            ),
            
            tabPanel(
              "Power Spectral Density",
              br(),
              modPSDPlotUI('modPSDPlot')
127 128
            )
          )
dmattek's avatar
dmattek committed
129
        ),
dmattek's avatar
dmattek committed
130
        
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
        tabPanel(
          "AUC",
          modAUCplotUI('tabAUC')
        ),
        
        tabPanel(
          "Box-plots",
          tabBoxPlotUI('tabBoxPlot')
        ),
        
        
        # scatter plot
        tabPanel(
          'Scatter',
          tabScatterPlotUI('tabScatter')
        ),
        
        tabPanel(
          'Hierarchical',
          clustHierUI('tabClHier')
dmattek's avatar
dmattek committed
151
        ),
152 153
        
        # sparse hierarchical clustering package sparcl temporarily unavailable from CRAN
dmattek's avatar
dmattek committed
154 155 156 157
         tabPanel(
           'Hierarchical Sparse',
           clustHierSparUI('tabClHierSpar')
        )
158
      ))
dmattek's avatar
dmattek committed
159 160
  )
))