ui.R 4.19 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/
dmattek's avatar
dmattek committed
11 12

shinyUI(fluidPage(
dmattek's avatar
dmattek committed
13 14
  useShinyjs(),
  # Include shinyjs
dmattek's avatar
dmattek committed
15 16 17 18
  
  # Application title
  title = "Timecourse Inspector",
  
dmattek's avatar
dmattek committed
19 20 21 22 23
  sidebarLayout(
    sidebarPanel(
      #Selector for file upload
      fileInput(
        'inFileLoadNuc',
Maciej Dobrzynski's avatar
Maciej Dobrzynski committed
24
        'Select data file (e.g. file.csv) and press "Load Data"',
dmattek's avatar
dmattek committed
25 26 27 28 29
        accept = c('text/csv', 'text/comma-separated-values,text/plain')
      ),
      actionButton("inButLoadNuc", "Load Data"),
      actionButton("butReset", "Reset file input"),
      actionButton('inDataGen1', 'Generate artificial dataset'),
dmattek's avatar
dmattek committed
30 31 32 33 34 35 36 37 38 39 40 41 42
      
      tags$hr(),
      checkboxInput('chBtrajRem', 'Upload IDs to remove'),
      helpPopup(
        title = 'Remove time series',
        content = help.text[1],
        placement = 'right',
        trigger = 'hover'
      ),
      
      uiOutput('uiFileLoadTrajRem'),
      uiOutput('uiButLoadTrajRem'),
      
43 44 45 46 47 48 49 50 51 52 53 54
      tags$hr(),
      checkboxInput('chBstim', 'Upload stimulation pattern'),
      helpPopup(
        title = 'Upload stimulations',
        content = help.text[4],
        placement = 'right',
        trigger = 'hover'
      ),
      
      uiOutput('uiFileLoadStim'),
      uiOutput('uiButLoadStim'),
      
dmattek's avatar
dmattek committed
55
      tags$hr(),
56
      checkboxInput('chBtrajInter', 'Interpolate NAs and missing data?', value = F),
57 58 59 60 61 62 63 64
      helpPopup(
        title = 'Interpolation of NAs and missing data',
        content = help.text[3],
        placement = 'right',
        trigger = 'hover'
      ),
      
      uiOutput('varSelTimeFreq'),
65
      checkboxInput('chBtrackUni', 'Create unique TrackLabel', F),
dmattek's avatar
dmattek committed
66 67 68 69 70 71
      helpPopup(
        title = 'Create unique cell ID',
        content = help.text[2],
        placement = 'right',
        trigger = 'hover'
      ),
dmattek's avatar
dmattek committed
72 73
      uiOutput('varSelSite'),
      uiOutput('varSelTrackLabel'),
74
      
dmattek's avatar
dmattek committed
75
      tags$hr(),
76
      checkboxInput('chBgroup', 'Dataset contains grouping column (e.g. treatment, condition)', F),                
dmattek's avatar
dmattek committed
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
      uiOutput('varSelGroup'),
      uiOutput('varSelTime'),
      uiOutput('varSelMeas1'),
      radioButtons(
        'inSelMath',
        'Math operation 1st and 2nd meas.:',
        c(
          'None' = '',
          'Divide' = " / ",
          'Sum' = " + ",
          'Multiply' = " * ",
          'Subtract' = ' - ',
          '1 / X' = '1 / '
        )
      ),
dmattek's avatar
dmattek committed
92 93
      uiOutput('varSelMeas2'),
      
dmattek's avatar
dmattek committed
94 95 96
      tags$hr(),
      checkboxInput('chBtimeTrim', 'Trim x-axis', FALSE),
      uiOutput('uiSlTimeTrim'),
dmattek's avatar
dmattek committed
97 98 99 100 101
      tags$hr(),
      checkboxInput('chBnorm', 'Normalization', FALSE),
      uiOutput('uiChBnorm'),
      uiOutput('uiSlNorm'),
      uiOutput('uiChBnormRobust'),
dmattek's avatar
dmattek committed
102 103
      uiOutput('uiChBnormGroup'),
      tags$hr(),
dmattek's avatar
dmattek committed
104
      downloadButton('downloadDataClean', 'Download mod\'d data')
105
    ),
dmattek's avatar
dmattek committed
106
    
107 108 109 110 111 112 113 114
    mainPanel(
      tabsetPanel(
        tabPanel(
          "Time series",
          h4(
            "Plot time series: means per group or individual"
          ),
          br(),
dmattek's avatar
dmattek committed
115
          modSelOutliersUI('returnOutlierIDs'),
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
          tabsetPanel(
            tabPanel("Means",
                     br(),
                     modTrajRibbonPlotUI('modTrajRibbon')
            ),
            
            tabPanel(
              "Individual",
              br(),
              checkboxInput('chBhighlightTraj', 'Highlight trajectories?', FALSE),
              uiOutput('varSelHighlight'),
              br(),
              modTrajPlotUI('modTrajPlot')
            )
          )
dmattek's avatar
dmattek committed
131
        ),
dmattek's avatar
dmattek committed
132
        
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
        tabPanel(
          "AUC",
          modAUCplotUI('tabAUC')
        ),
        
        tabPanel(
          "Box-plots",
          tabBoxPlotUI('tabBoxPlot')
        ),
        
        
        # scatter plot
        tabPanel(
          'Scatter',
          tabScatterPlotUI('tabScatter')
        ),
        
        tabPanel(
          'Hierarchical',
          clustHierUI('tabClHier')
dmattek's avatar
dmattek committed
153
        ),
154 155
        
        # sparse hierarchical clustering package sparcl temporarily unavailable from CRAN
dmattek's avatar
dmattek committed
156 157 158 159
         tabPanel(
           'Hierarchical Sparse',
           clustHierSparUI('tabClHierSpar')
        )
160
      ))
dmattek's avatar
dmattek committed
161 162
  )
))