diff --git a/plotTreeShiny/plotTree.R b/plotTreeShiny/plotTree.R index 991a191..b208848 100644 --- a/plotTreeShiny/plotTree.R +++ b/plotTreeShiny/plotTree.R @@ -111,7 +111,9 @@ y.ordered<-y.ordered[,rev(as.numeric(reordered))] else { # cluster columns + if (cluster==TRUE) {cluster="ward.D2"} # set default clustering algorithm + h<-hclust(dist(t(na.omit(y.ordered))),cluster) y.ordered<-y.ordered[,h$order] } diff --git a/plotTreeShiny/server.R b/plotTreeShiny/server.R index b39f094..4399408 100644 --- a/plotTreeShiny/server.R +++ b/plotTreeShiny/server.R @@ -10,22 +10,24 @@ shinyServer( function(input, output, session) { # read the CSV file and get the column names. # re-reading this file repeatedly is inefficient df = read.table(input$info_file$datapath, header=TRUE, sep=',') + # build a list of values, this is what is required by update methods info_cols = list() for (v in colnames(df)) { info_cols[v] = v } # update the two input widgets using the column names + updateSelectInput(session, inputId='colour_tips_by', choices=c('(none)',info_cols[-1])) - updateSelectInput(session, inputId='print_column', choices=c(info_cols[-1])) + updateSelectInput(session, inputId='select_columns', choices=c(info_cols[-1])) # switch on the meta data plotting option - updateCheckboxInput(session, inputId='info_data', value=TRUE) + updateCheckboxInput(session, inputId='chk_data', value=TRUE) } ) # An event observer for changes to HEATMAP file - observeEvent(input$heatmap, + observeEvent(input$heatmap_file, { # switch on the heatmap plotting option updateCheckboxInput(session, inputId='chk_heatmap', value=TRUE) @@ -33,7 +35,7 @@ shinyServer( function(input, output, session) { ) # An event observer for changes to BAR DATA file - observeEvent(input$barData, + observeEvent(input$bar_data_file, { # switch on the heatmap plotting option updateCheckboxInput(session, inputId='chk_barplot', value=TRUE) @@ -41,7 +43,7 @@ shinyServer( function(input, output, session) { ) # An event observer for changes to BLOCKS file - observeEvent(input$blockFile, + observeEvent(input$blocks_file, { # switch on the heatmap plotting option updateCheckboxInput(session, inputId='chk_blocks', value=TRUE) @@ -49,37 +51,38 @@ shinyServer( function(input, output, session) { ) # An event observer for changes to SNPs file - observeEvent(input$snpFile, + observeEvent(input$snps_file, { # switch on the heatmap plotting option updateCheckboxInput(session, inputId='chk_snps', value=TRUE) } ) + output$Tree <- renderPlot({ - input$drawButton == 0 + input$draw_button == 0 ### ALL VARIABLES PULLED FROM 'input' GO INSIDE HERE isolate ( { l<-input$Layout t<-input$Tree - i<-input$Info + i<-input$Metadata o<-input$Other - d<-input$Data + d<-input$Heatmap - treeFile <- input$tree$datapath + tree_file <- input$tree_file$datapath # tree plotting options label_tips <- input$label_tips tree_line_width <- as.integer(input$tree_line_width) branch_colour <- input$branch_colour - tipLabelSize <- as.integer(input$tipLabelSize) + tip_label_size <- as.integer(input$tip_label_size) offset <- as.integer(input$offset) # metadata variables - infoFile <- input$info_file$datapath + info_file <- input$info_file$datapath tip_size <- input$tip_size colour_tips_by <- input$colour_tips_by if (colour_tips_by == '(none)') {colour_tips_by <- NULL} @@ -87,15 +90,15 @@ shinyServer( function(input, output, session) { pie_size <- input$pie_size legend <- input$legend legend_pos <- input$legend_pos - print_column <- input$print_column - print_metadata <- input$print_metadata - if (!print_metadata) { print_column <- NA } + select_columns <- input$select_columns + chk_print_metadata <- input$chk_print_metadata + if (!chk_print_metadata) { select_columns <- NA } # heatmap variables - heatmapFile <- input$heatmap$datapath + heatmap_file <- input$heatmap_file$datapath cluster <- input$clustering - heatmapDecimalPlaces <- as.integer(input$heatmapDecimalPlaces) - colLabelCex <- as.integer(input$colLabelCex) + heatmap_decimal_places <- as.integer(input$heatmap_decimal_places) + col_label_cex <- as.integer(input$col_label_cex) vlines_heatmap_col <-input$vlines_heatmap_col vlines_heatmap <- input$vlines_heatmap @@ -109,17 +112,17 @@ shinyServer( function(input, output, session) { # } # barplot variables - barDataFile <- input$barData$datapath - barDataCol <- input$barDataCol + bar_data_file <- input$bar_data_file$datapath + bar_data_col <- input$bar_data_col # block plot variables - blockFile <- input$blockFile$datapath - block_colour <- input$block_colour + blocks_file <- input$blocks_file$datapath + blocks_colour <- input$blocks_colour blwd <- input$blwd genome_size <- input$genome_size - snpFile <- input$snpFile$datapath - snp_colour <- input$snp_colour + snps_file <- input$snps_file$datapath + snps_colour <- input$snps_colour # Layout/spacing tree_width <- as.numeric(input$tree_width) @@ -133,27 +136,28 @@ shinyServer( function(input, output, session) { # TRACK DATA TYPES TO PLOT chk_heatmap <- input$chk_heatmap - info_data <- input$info_data + chk_info <- input$chk_info chk_barplot <- input$chk_barplot chk_blocks <- input$chk_blocks chk_snps <- input$chk_snps - if (is.null(treeFile)) { return(NULL) } + if (is.null(tree_file)) { return(NULL) } - if (!info_data) { infoFile <- NULL } - else { infoFile <- infoFile } + if (!chk_info) { info_file <- NULL } + else { info_file <- info_file } - if (!chk_heatmap) { heatmapFile <- NULL } - else { heatmapFile <- heatmapFile } + if (!chk_heatmap) { heatmap_file <- NULL } + else { heatmap_file <- heatmap_file } - if (!chk_barplot) { barDataFile <- NULL } - else { barDataFile <- barDataFile } + if (!chk_barplot) { bar_data_file <- NULL } + else { bar_data_file <- bar_data_file } - if (!chk_blocks) { blockFile <- NULL } - else { blockFile <- blockFile } + if (!chk_blocks) { blocks_file <- NULL } + else { blocks_file <- blocks_file } - if (!chk_snps) { snpFile <- NULL } - else { snpFile <- snpFile } + if (!chk_snps) { snps_file <- NULL } + else { snps_file <- snps_file } + }) # end isolate @@ -164,29 +168,32 @@ shinyServer( function(input, output, session) { doPlotTree <-function() { # underlying call to plotTree(), drawn to screen and to file - plotTree(tree=treeFile, - tip.labels=label_tips, tipLabelSize=tipLabelSize, offset=offset, + + plotTree(tree=tree_file, + tip.labels=label_tips, tipLabelSize=tip_label_size, offset=offset, lwd=tree_line_width, edge.color=branch_colour, - infoFile=infoFile, infoCols=print_column, + infoFile=info_file, infoCols=select_columns, colourNodesBy=colour_tips_by, tip.colour.cex=tip_size, ancestral.reconstruction=ancestral, pie.cex=pie_size, legend=legend, legend.pos=legend_pos, - heatmapData=heatmapFile, cluster=cluster, + heatmapData=heatmap_file, cluster=cluster, heatmap.colours=heatmap_colours, - heatmapDecimalPlaces=heatmapDecimalPlaces, colLabelCex=colLabelCex, + heatmapDecimalPlaces=heatmap_decimal_places, colLabelCex=col_label_cex, vlines.heatmap=vlines_heatmap, vlines.heatmap.col=vlines_heatmap_col, - barData=barDataFile, barDataCol=barDataCol, - blockFile=blockFile, block_colour=block_colour, blwd=blwd, + barData=bar_data_file, barDataCol=bar_data_col, + blockFile=blocks_file, block_colour=blocks_colour, blwd=blwd, genome_size=genome_size, - snpFile=snpFile, snp_colour=snp_colour, + snpFile=snps_file, snp_colour=snps_colour, treeWidth=tree_width, infoWidth=info_width, dataWidth=heatmap_width, barDataWidth=bar_width, blockPlotWidth=genome_width, mainHeight=main_height, labelHeight=label_height, edgeWidth=edge_width ) + } doPlotTree() }) # end render plot -}) # shinyServer \ No newline at end of file +}) # shinyServer + diff --git a/plotTreeShiny/ui.R b/plotTreeShiny/ui.R index b360dd1..43f0ce5 100644 --- a/plotTreeShiny/ui.R +++ b/plotTreeShiny/ui.R @@ -2,174 +2,274 @@ library(shiny) library(ape) library(RLumShiny) shinyUI(fluidPage( - #titlePanel("Plot tree"), - sidebarLayout( - sidebarPanel( - - tabsetPanel( - - tabPanel("Tree", - - ### UPLOAD TREE - br(), - fileInput('tree', 'Upload tree file (nwk)', multiple=F, - accept=c('biotree/newick','.nwk', '.tree')), - - checkboxInput("label_tips", "Label tree tips?", value=FALSE), - conditionalPanel( - condition = "input.label_tips", - textInput("tipLabelSize", label = "Text size", value = "1"), - textInput("offset", label = "Offset", value = "0") - ), - - textInput("tree_line_width", label = "Branch width", value = "1.5"), - jscolorInput(inputId="branch_colour", label="Branch colour:", value="#000000", position = "bottom", color = "transparent", mode = "HSV", slider = T, close = T), - br() - ), # finished tree tab - - tabPanel("Info", - - ### METADATA (info file) - br(), - fileInput('info_file', 'Upload metadata (CSV)'), - checkboxInput('info_data', 'Use metadata', value = FALSE), - conditionalPanel( - condition = "input.info_data", - checkboxInput('print_metadata', 'Print columns', value = FALSE), - conditionalPanel( - condition = "input.print_metadata", - selectInput('print_column', 'Metadata columns to print:', c(''), multiple=TRUE) - ), - "--------", - selectInput('colour_tips_by', 'Colour tips by:', c('')), - # options if colouring by tips - conditionalPanel( - condition = "input.colour_tips_by != '(none)'", - sliderInput("tip_size", label = "Tip size", min = 0.1, max = 20, value = 0.5), - ### COLOUR PANELS - checkboxInput("legend", "Legend for node colours?", value=TRUE), - selectInput("legend_pos", label = "Position for legend", - choices = list( "bottomleft"="bottomleft", "bottomright"="bottomright", - "top-left"="topleft", "topright"="topright") - ), - "--------", - checkboxInput("ancestral", "Ancestral state reconstruction?", value=FALSE), - sliderInput("pie_size", label = "Pie graph size", min = 0.1, max = 20, value = 0.5) - ) - ) - ), # finished metadata tab - - - tabPanel("Data", - - ### HEATMAP DATA - br(), - fileInput('heatmap', 'Upload heatmap file (CSV)', multiple = F, accept = c('text/csv', '.csv')), - checkboxInput('chk_heatmap', 'Plot heatmap', value = FALSE), - - conditionalPanel( - condition = "input.chk_heatmap", h4("Heatmap options"), - selectInput("clustering", label = h5("Clustering:"), - choices = list("Select..."=F, "Cluster columns by values"=T, "Square matrix"="square"), - selected = "Select"), - "--------", - - # OPTIONALLY DISPLAY COLOUR OPTIONS - checkboxInput("heatColoursPrompt", "Change heatmap colour ramp", value=FALSE), - conditionalPanel( - condition = "input.heatColoursPrompt", - jscolorInput(inputId="start_col", label="Start colour:", value="FFFFFF", position = "bottom", color = "transparent", mode = "HSV", slider = T, close = T), - jscolorInput(inputId="middle_col", label="Middle colour:", value="FFF94D", position = "bottom", color = "transparent", mode = "HSV", slider = T, close = T), - jscolorInput(inputId="end_col", label="End colour:", value="1755FF", position = "bottom", color = "transparent", mode = "HSV", slider = T, close = T), - textInput("heatmap_breaks", label = "Breaks:", value = "100") - ), - # checkboxInput("heatColoursSpecify", "Specify heatmap colours manually", value=FALSE), - # conditionalPanel( - # condition = "input.heatColoursSpecify", - # textInput("heatmap_colour_vector", label = "R code (vector), e.g. rev(gray(seq(0,1,0.1)))", value = "") - # ), - "--------", - textInput("heatmapDecimalPlaces", label = "Decimal places to show in heatmap legend:", value = "1"), - textInput("colLabelCex", label = "Text size for column labels:", value = "0.75") - # textInput("vlines_heatmap", label = "y-coordinates for vertical lines (e.g. c(2,5)):", value = ""), - # jscolorInput(inputId="vlines_heatmap_col", label=h5("Colour for vertical lines:"), value="1755FF", position = "bottom", color = "transparent", mode = "HSV", slider = T, close = T) - ) - ), # finished heatmap options - - tabPanel("Other", - tabsetPanel( - tabPanel("Barplots", - br(), - # bar plots - fileInput('barData', 'Upload data for bar plots (CSV)', multiple = F, accept = c('text/csv', '.csv')), - checkboxInput('chk_barplot', 'Plot bar graphs', value = FALSE), - - conditionalPanel( - condition = "input.chk_barplot", h5("Barplot options"), - jscolorInput(inputId="barDataCol", label="Colour for barplots:", value="1755FF", position = "bottom", color = "transparent", mode = "HSV", slider = T, close = T) - ) - ), - - tabPanel("Genome blocks", - br(), - # genome blocks - fileInput('blockFile', 'Upload genome block coordinates', multiple = F, accept = c('text/tab', '.txt')), - checkboxInput('chk_blocks', 'Plot genome blocks', value = FALSE), - - conditionalPanel( - condition = "input.chk_blocks", h5("Genome block plotting options"), - textInput("genome_size", label = "Genome size (bp):", value = "5E6"), - jscolorInput(inputId="block_colour", label="Colour for blocks:", value="1755FF", position = "bottom", color = "transparent", mode = "HSV", slider = T, close = T), - sliderInput("blwd", label = "Block size", min = 0.1, max = 20, value = 5) - ) - ), - - tabPanel("SNPs", - br(), - # snps - fileInput('snpFile', 'Upload SNP allele table (CSV)', multiple = F, accept = c('text/csv', '.csv')), - checkboxInput('chk_snps', 'Plot SNPs', value = FALSE), - - conditionalPanel( - condition = "input.chk_snps", h5("SNP plotting options"), - textInput("genome_size", label = "Genome size (bp):", value = "5E6"), # make this linked to previous conditional - jscolorInput(inputId="snp_colour", label="Colour for SNPs:", value="1755FF", position = "bottom", color = "transparent", mode = "HSV", slider = T, close = T) - ) - ) - ) #finished other data subtabs - ), # finished other data tab - - tabPanel("Layout", - br(), - h5("Relative widths"), - textInput("tree_width", label = "Tree", value = 10), - textInput("info_width", label = "Info columns", value = 10), - textInput("heatmap_width", label = "Heatmap", value = 30), - textInput("bar_width", label = "Bar plots", value = 10), - textInput("genome_width", label = "Genome data (blocks, SNPs)", value = 10), - br(), - h5("Relative heights"), - textInput("main_height", label = "Main panels", value = 100), - textInput("label_height", label = "Heatmap labels", value = 10), - br(), - h5("Borders"), - textInput("edge_width", label = "Border width/height", value = 1) - ) - - ), # finish tabpanel - - ### DRAW BUTTON - br(), - actionButton("drawButton", "Draw!") - - # ADD PRINT BUTTON HERE - - ), # finished sidebarPanel - - mainPanel( - plotOutput("Tree", height=800) - ) - - ) # finished sidebarLayout + fluidRow( ## top row to holds all dynamic input + ## column to hold all tabset panel + column(12, tabsetPanel( + ## Tree tab + tabPanel("Tree", + ## UPLOAD TREE + ## start tree fluidRow + fluidRow( + ## column for uploading tree + column(6, wellPanel( + br(), + fileInput('tree_file', 'Upload tree file (nwk)', multiple=F, + accept=c('biotree/newick','.nwk', '.tree')), + ## checkbox to display tree parameters list + checkboxInput("show_tree_param_list", "Show/hide tree display settings.", value=FALSE) + )), ## finish column for tree upload + + conditionalPanel( + condition = "input.show_tree_param_list", + ## column to hold tree parameters list on the right-hand side + column(6, wellPanel( + + ## checkbox to label tree tips with strain IDs + checkboxInput("label_tips", "Label tree tips?", value=FALSE), + conditionalPanel( + condition = "input.label_tips", + textInput("tip_label_size", label = "Text size", value = "1"), + textInput("offset", label = "Offset", value = "0")), ## finish condition for tips label + + ## Options for user to input branch thickness and colour + textInput("tree_line_width", label = "Branch width", value = "1.5"), + jscolorInput(inputId="branch_colour", label="Branch colour:", value="#000000", + position = "bottom", color = "transparent", mode = "HSV", slider = T, close = T) + )) ## finish column for param list + ) ## finish show param list condition + ) ## finish tree fluidRow + ), # Finished tree tab + + ## Metadata tab + tabPanel("Metadata", + + ### UPLOAD METADATA (info file) + ## start metadata fluidRow + fluidRow( + ## column for uploading metadata + column(6, wellPanel( + br(), + fileInput('info_file', 'Upload metadata (CSV)'), + + ## checkbox for server.R to track that metadata is uploaded + checkboxInput('chk_info', 'Use metadata', value = FALSE), + + ## checkbox to display metadata parameters list + checkboxInput("show_info_param_list", "Show/hide metadata display settings.", value=FALSE) + )), ## finish column for metadata upload + + conditionalPanel( + condition = "input.chk_info", + conditionalPanel( + condition="input.show_info_param_list", + fluidRow( + ## column for part1 of parameters list + column(3, wellPanel( + h4("Metadata options"), + + ## checkbox for printing metadata as text + checkboxInput('chk_print_metadata', 'Print metadata as text', value = FALSE), + conditionalPanel( + condition = "input.chk_print_metadata", + selectInput('select_columns', 'Metadata to print:', c(''), multiple=TRUE) + ), ## finish condition for metadata printing as text + "--------", + selectInput('colour_tips_by', 'Colour tips by:', c('')) + )), ## finish column for part1 + + # options if colouring tips + conditionalPanel( + condition = "input.colour_tips_by != '(none)'", + + ## column for part2 of parameters list + column(3, wellPanel( + + ## slider for adjusting tip node size + sliderInput("tip_size", label = "Tip size", min = 0.1, max = 20, value = 0.5), + + ## checkbox to display legend for selected metadata + checkboxInput("legend", "Legend for node colours?", value=TRUE), + + ## menu-list for location of the legened on user screen + selectInput("legend_pos", label = "Position for legend", + choices = list( "bottomleft"="bottomleft", "bottomright"="bottomright", + "top-left"="topleft", "topright"="topright") + ), + "--------", + ## checkbox for ancestral state reconstruction + checkboxInput("ancestral", "Ancestral state reconstruction?", value=FALSE), + + ## slider for adjusting pie-chart size, plotted on tree nodes + sliderInput("pie_size", label = "Pie graph size", min = 0.1, max = 20, value = 0.5) + )) ## finish column for part2 + ) ## finish condition for tips colouring + ) ## finish fluidRow for params part1 and part2 + )) ## finish conditions for chk_info && show param list + ) ## finish metadata fluidRow + ), # Finished metadata tab + + + ## Heatmap tab + tabPanel("Heatmap", + + ### UPLOAD HEATMAP DATA + ## Start heatmap fluidrow + fluidRow( + ## column for heatmap upload + column(6, wellPanel( + br(), + fileInput('heatmap_file', 'Upload heatmap file (CSV)', multiple = F, accept = c('text/csv', '.csv')), + + ## xheckbox for server.R to track that heatmap is uploaded + checkboxInput('chk_heatmap', 'Plot heatmap', value = FALSE), + + ## checkbox to display heatmap parameters list + checkboxInput("show_heatmap_param_list", "Show/hide heatmap display settings.", value=FALSE) + )), ## finish column for heatmap upload + + conditionalPanel( + condition = "input.chk_heatmap", + conditionalPanel( + condition="input.show_heatmap_param_list", + fluidRow( + ## column for part1 of parameters list + column(3, wellPanel( + h4("Heatmap options"), + selectInput("clustering", label = h5("Clustering:"), + choices = list("Select..."=F, "Cluster columns by values"=T, "Square matrix"="square"), + selected = "Select"), + + # checkboxInput("heatColoursSpecify", "Specify heatmap colours manually", value=FALSE), + # conditionalPanel( + # condition = "input.heatColoursSpecify", + # textInput("heatmap_colour_vector", label = "R code (vector), e.g. rev(gray(seq(0,1,0.1)))", value = "") + # ), + "--------", + textInput("heatmap_decimal_places", label = "Decimal places to show in heatmap legend:", value = "1"), + textInput("col_label_cex", label = "Text size for column labels:", value = "0.75") + # textInput("vlines_heatmap", label = "y-coordinates for vertical lines (e.g. c(2,5)):", value = ""), + # jscolorInput(inputId="vlines_heatmap_col", label=h5("Colour for vertical lines:"), value="1755FF", position = "bottom", color = "transparent", mode = "HSV", slider = T, close = T) + )), ## finish column for part1 + + ## column for part2 of parameters list + column(3, wellPanel( + + # OPTIONALLY DISPLAY COLOUR OPTIONS + checkboxInput("heat_colours_prompt", "Change heatmap colour ramp", value=FALSE), + conditionalPanel( + condition = "input.heat_colours_prompt", + jscolorInput(inputId="start_col", label="Start colour:", value="FFFFFF", position = "bottom", color = "transparent", mode = "HSV", slider = T, close = T), + jscolorInput(inputId="middle_col", label="Middle colour:", value="FFF94D", position = "bottom", color = "transparent", mode = "HSV", slider = T, close = T), + jscolorInput(inputId="end_col", label="End colour:", value="1755FF", position = "bottom", color = "transparent", mode = "HSV", slider = T, close = T), + textInput("heatmap_breaks", label = "Breaks:", value = "100") + ) ## finish condition for heatmap colours prompt + )) ## finish column for part2 + ) ## finish fluidrow for part1 and part2 + )) ## finish conditions for chk_heatmap && show param list + ) ## finish heatmap fluidRow + ), # finished heatmap tab + + tabPanel("Other", + ## start Others fluidRow + fluidRow( + ## column for others upload section + column(6, wellPanel( + tabsetPanel( + tabPanel("Barplots", + br(), + # bar plots file upload + fileInput('bar_data_file', 'Upload data for bar plots (CSV)', multiple = F, accept = c('text/csv', '.csv')), + + ## checkox for server.R to track bar plot file upload + checkboxInput('chk_barplot', 'Plot bar graphs', value = FALSE), + + conditionalPanel( + condition = "input.chk_barplot", h4("Barplot options"), + + ## options to of bar plot colour + jscolorInput(inputId="bar_data_col", label="Colour for barplots:", value="1755FF", position = "bottom", color = "transparent", mode = "HSV", slider = T, close = T) + ) ## finish condition on file upload + ), ## finish barplot tab + + tabPanel("Genome blocks", + br(), + + fileInput('blocks_file', 'Upload genome block coordinates', multiple = F, accept = c('text/tab', '.txt')), + + ## checkbox for server.R to track bar genome blocks file upload + checkboxInput('chk_blocks', 'Plot genome blocks', value = FALSE), + + conditionalPanel( + condition = "input.chk_blocks", h4("Genome block plotting options"), + + ## parameters settings for plotting genome blocks + textInput("genome_size", label = "Genome size (bp):", value = "5E6"), + jscolorInput(inputId="blocks_colour", label="Colour for blocks:", value="1755FF", position = "bottom", color = "transparent", mode = "HSV", slider = T, close = T), + sliderInput("blwd", label = "Block size", min = 0.1, max = 20, value = 5) + ) ## finish conditions for chk_blocks + ), ## finish genome blocks tab + + tabPanel("SNPs", + br(), + # snps file upload + fileInput('snps_file', 'Upload SNP allele table (CSV)', multiple = F, accept = c('text/csv', '.csv')), + + ## checkox for server.R to track snps file upload + checkboxInput('chk_snps', 'Plot SNPs', value = FALSE), + + conditionalPanel( + condition = "input.chk_snps", h4("SNP plotting options"), + + ## parameters settings for plotting snps data + textInput("genome_size", label = "Genome size (bp):", value = "5E6"), # make this linked to previous conditional + jscolorInput(inputId="snps_colour", label="Colour for SNPs:", value="1755FF", position = "bottom", color = "transparent", mode = "HSV", slider = T, close = T) + ) + ) ## finish snps tab + ) #finished other data subtabs + )))), # finished other data tab + + tabPanel("Layout", + ## start layout fluidrow + fluidRow( + ## column for all 'layout' contents + column(6, wellPanel( + br(), + h5("Relative widths"), + + ## options for adjusting tree/data dimensions + textInput("tree_width", label = "Tree", value = 10), + textInput("info_width", label = "Info columns", value = 10), + textInput("heatmap_width", label = "Heatmap", value = 30), + textInput("bar_width", label = "Bar plots", value = 10), + textInput("genome_width", label = "Genome data (blocks, SNPs)", value = 10), + br(), + h5("Relative heights"), + textInput("main_height", label = "Main panels", value = 100), + textInput("label_height", label = "Heatmap labels", value = 10), + br(), + h5("Borders"), + textInput("edge_width", label = "Border width/height", value = 1) + )) ## finish column layout + ) ## finish layout fluidrow + ) ## finish Layout tab + + ) # finish tabsetPanel + ) # finish tabsetpanel column + ), # finish first fluidRow + + ### DRAW BUTTON in a separate fluidRow + fluidRow( + column(12, + actionButton("draw_button", "Draw!"))), + + ## ADD PRINT BUTTON HERE ## + + br(), + ## main panel for displaying tree/data in a separate fluidRow + fluidRow( + column(12, wellPanel( + plotOutput("Tree", height=800) + ))) + ) # fluidPage ) # shinyUI \ No newline at end of file