ui.R 4.27 KB
Newer Older
dmattek's avatar
dmattek committed
1

dmattek's avatar
dmattek committed
2

dmattek's avatar
dmattek committed
3 4 5 6 7 8 9
# This is the user-interface definition of a Shiny web application.
# You can find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com
#

library(shiny)
dmattek's avatar
dmattek committed
10
library(shinyjs) #http://deanattali.com/shinyjs/
dmattek's avatar
dmattek committed
11 12 13
library(plotly)

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',
dmattek's avatar
dmattek committed
25
        'Select data file (e.g. tCoursesSelected.csv) and press "Load Data"',
dmattek's avatar
dmattek committed
26 27 28 29 30
        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
31

dmattek's avatar
dmattek committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
      tags$hr(),
      uiOutput('varSelSite'),
      uiOutput('varSelTrackLabel'),
      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
50 51 52 53 54 55 56 57
      uiOutput('varSelMeas2'),
      
      tags$hr(),
      checkboxInput('chBnorm', 'Normalization', FALSE),
      uiOutput('uiChBnorm'),
      uiOutput('uiSlNorm'),
      uiOutput('uiChBnormRobust'),
      uiOutput('uiChBnormGroup')
58
    ),
dmattek's avatar
dmattek committed
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
    
    mainPanel(tabsetPanel(
      tabPanel(
        "Time courses",
        br(),
        fluidRow(
          column(
            4,
            numericInput(
              'inPlotTrajFacetNcol',
              '#Columns:',
              value = 4,
              min = 1,
              width = '100px',
              step = 1
            )
          ),
          column(
            4,
            numericInput(
              'inPlotTrajHeight',
              'Height [px]:',
              value = 800,
              min = 100,
              width = '100px',
              step = 50
            )
          ),
          column(
            4,
            numericInput(
              'inPlotTrajWidth',
              'Width [%]:',
              value = 100,
              min = 10,
              max = 100,
              width = '100px',
              step = 10
            )
          )
        ),
        checkboxInput('chBhighlightTraj', 'Highlight trajectories?', FALSE),
        uiOutput('varSelHighlight'),
        br(),
        actionButton('butPlotTraj', 'Plot!'),
        uiOutput('uiPlotTraj')
      ),
      tabPanel("Box-plots",
               br(),
               fluidRow(
                 column(
                   6,
                   checkboxInput('inPlotBoxNotches', 'Box plot notches?', FALSE),
                   checkboxInput('inPlotBoxOutliers', 'Box plot outliers?', TRUE)
                 ),
                 column(
                   6,
                   selectInput('selPlotBoxLegendPos', 
                               label = 'Select legend position',
                               choices = list(
                                 "Top" = 'top',
                                 "Right" = 'right',
                                 "Bottom" = 'bottom'
                               ),
                               selected = 'top')
                 )
               ),
               
               uiOutput('varSelTpts'),
               
               actionButton('butPlotBox', 'Plot!'),
               plotOutput('outPlotBox', height = 800),
               h4('Download plot'),
               fluidRow(
                 column(
                   3,
                   numericInput(
                     'inPlotBoxWidth',
                     "Width",
                     10,
                     min = 1,
                     width = 100
                   )
                 ),
                 column(
                   3,
                   numericInput(
                     'inPlotBoxHeight',
                     "Height",
                     7,
                     min = 1,
                     width = 100
                   )
                 ),
                 column(6,
                        downloadButton('downPlotBox', 'PDF'))
               )
               #uiOutput('uiPlotBox')
      )
    ))
  )
))