### Author: Franck Soubès ### Bioinformatics Master Degree - University of Bordeaux, France ### Link: https://github.com/GeT-TRiX/MA_Trix_App/ ### Where: GET-TRiX's facility ### Application: MATRiX is a shiny application for Mining and functional Analysis of TRanscriptomics data ### Licence: GPL-3.0 ############################### ######## dashboardsidebar # ############################### dbHeader <- dashboardHeader(title = "MATRiX") dbHeader$children[[2]]$children <- tags$a(tags$img(src='matrix.png',height='40',width='40',style="margin:5px 0 5px 0;",align='left'), tags$h3("MATRiX",style="font-family:Purisa; margin:15px 25px 5px 0;color:white; ")) sidebar <- dashboardSidebar( ## init and load shinyjs functions useShinyjs(), tags$style(type="text/css", inactivity), shinyjs::extendShinyjs(script="shinyjs_gif_functions.js", functions=c("init","calcHeight","gifrender","gifrandom")), shinyjs::extendShinyjs(script="shinyjs_enrichr.js", functions=c("enrichr")), # must list the functions names tags$head( tags$script(src = "custom.js")), div(id = "loading-content-bar",p()), div(id = "matrixapp", sidebarMenu(id = "side", menuItem("Home", tabName = "Home", icon = icon("home")), menuItem("Upload Data", tabName = "Upload", icon = icon("upload")), hidden(tags$div(id = "menuitemsum", class= "menuitempca", menuItem("Data summary", tabName = "Datasummary", icon = icon("chart-line")))) , hidden(tags$div(id = "menuitempca", class= "menuitempca", menuItem("PCA", tabName = "PCA", icon = icon("chart-line")))) , hidden(tags$div(id = "menuitemvenn", class= "menuitempca", menuItem("Venn diagram", tabName = "Venn", icon = icon("chart-line")))), hidden(tags$div(id = "menuitemhm", class= "menuitempca",menuItem("Heatmap", tabName = "Heatmap", icon = icon("chart-line")))), menuItemOutput("dymMenu"), collapsed = TRUE ), div(class="footer", includeHTML("myFooter1.html")), div(class="footer", includeHTML(ifelse(file.exists("myFooter2.html"), "myFooter2.html", "blank.html"))) ) ) ###############################, ######## dashboardbody # ############################### ############################### ######## Upload Page # ############################### body <- dashboardBody( #tags$head(includeScript("google-analytics.js")), tags$style(type="text/css", inactivity), useShinyjs(), extendShinyjs(text = jsCode, functions=c("hideSidebar")), extendShinyjs(text = jsCode, functions=c("showSidebar")), # extendShinyjs(text = 'shinyjs.hideSidebar = function(params) { $("body").addClass("sidebar-collapse"); # $(window).trigger("resize"); }'), # extendShinyjs(text='shinyjs.showSidebar = function(params) { $("body").removeClass("sidebar-collapse"); # $(window).trigger("resize"); }'), tags$style(HTML(" .tabbable > .nav > li > a[data-value='hmpan'] {background-color: red; color:white} .tabbable > .nav > li > a[data-value='cutpan'] {background-color: blue; color:white} ")), includeCSS("./css/style.css"), div( id = "loading-content", br(),br(), br(), h2("Please wait while MATRiX is loading...")), div( id = "matrixapp", tabItems( tabItem(tabName = "Home", fluidRow( column(width=9, div(style="width:100% ;max-width: 1500px; height: 1500px max-height: 2200px;",id = "homepage", tabBox(title="Welcome to MATRiX", width=NULL,id = "homepage", tabPanel("About", style = "background-color: #ffffff;", tags$h3("MATRiX is a shiny application for Mining and functional Analysis of TRanscriptomics data."), p("This project initiated by Yannick Lippi aims to facilitate access to biologist in order to publish graphs such as heatmap, PCA or Venn diagram related to specifics data produced by TRiX's facility.", tags$br()," MATRiX is an application dedicated to transcriptomic analysis (DNA chip, RNA-seq, ChIP-Seq), this application incorporates quality control with Principal components analysis to summarizes Transcriptomic data and differential analysis with various methods such as Venn diagram, Heatmap clustering and GO Enrichment analysis by querying the DWS (DAVID WEB SERVICES).",tags$br()," MATRiX app is working with data produced by the limma, DESeq2 and edgeR packages, resulting p-values are adjusted according to the Benjamini and Hochberg procedure [Benjamini and Hochberg 1995]. PCA is computed with the FactoMineR package and the plot is produced with the factoextra package, for the Heatmap and Venn diagram the graphs are obtained respectively with the gplots and VennDiagram package, those packages are available on CRAN. This application works with specific data produced by transcriptomic facilities, you can refer to the download example file (sampleData.zip) and the MATRiX's menu (upload data)."), p("Below is represented the global workflow passing by the statistical analysis to the visualization:"),tags$br(), div(id="workflow", tags$p(tags$img(src = "whatmaen.png",style="width: 100%; height: 100%"))) ), tabPanel("Authors", h3("The main providers to MATRiX:"), p(a("Yannick Lippi",href="mailto:yannick.lippi@inrae.fr"), "(Initiator, beta-testing, feature suggestions)"), p(a("Franck Soubès", href="mailto:franck.soubes@inra.fr"), "(Coding, Unit testing, documentation, packaging, feature suggestions)",tags$a(href = "https://github.com/fsoubes",target="_blank", "See github")), h3("Acknowledgements"), p("Thanks to the Toxalim's team BioToMyc & TIM and especially to the following people for their helps reporting errors, proposing new features and beta testing of MATRiX:"), p("Laura Costes,", "Anne Fougerat,","Claire Naylies,", "Philippe Pinton,","Arnaud Polizzi," ,"Marion Regnier," , "Sandrine Ellero-Simatos,","Sarra Smati."), p("Special Thanks to Didier Laborie for installing the virtual machine with Ubuntu and for answering my questions") ), tabPanel("Packages", tags$h3("If you are using MATRiX in your work, you can cite some of the packages by clicking on the link down below."), actionLink("session", "Print version information about R, the OS and attached or loaded packages."), br(), br(), br(), renderoutputTable("sessinfo") ), tabPanel("Support", tags$head( tags$style( "#entry {width: 100%;position: relative;left: 4%;} #users ul li {font-family: 'Inconsolata', cursive;font-weight: 500;line-height: 1.5;color: white;position: static;font-size: 18px;} #users a{color: red;} #users p{color:white;}")), includeCSS("www/shinychat.css"), # And custom JavaScript -- just to send a message when a user hits "enter" # and automatically scroll the chat window for us. Totally optional. includeScript("www/sendOnEnter.js"), fluidRow( column(width=9, div( style = "width:100% ; max-width: 1200px; height: 500px", div( class = "row-fluid", # Create a spot for a dynamic UI containing the chat contents. uiOutput("chat"), # Create the bottom bar to allow users to chat. fluidRow( div(class="span8", textInput("entry", "") ), div(class="span2 center", actionButton("send", "Send") ) ) ))) )), tabPanel("Video", div( id="video", fluidRow( column(8, align="center", offset = 2, tags$iframe(src = "https://www.youtube.com/embed/lfI0zRYzeJs?vq=hd1080", width="960", height="540", align= "middle", frameborder="0",allowfullscreen ="1" ) )))) ))), column(width=3, div(id="pass",style = "word-wrap: break-word;", box(id="boxpass",title = strong("Session information", style="font-size:25px;"), width = NULL, background = "light-blue", # The right sidebar # Let the user define his/her own ID textInput("user", "Your User ID:", value=""), tags$hr(), h5("Connected Users"), # Create a spot for a dynamic UI containing the list of users. div(id ="users", uiOutput("userList"), tags$hr(), p("Built using R and" ,tags$a(href = "http://rstudio.com/shiny/",target="_blank", "Shiny")), p("Chat source code is available ", tags$a(href = "https://github.com/trestletech/ShinyChat",target="_blank", "here")) ) ) ), box( title = "What's new in MATRiX", width = NULL, status = "primary", div(style = 'overflow-y: scroll; height: 500px', addNews("May 07th 2019", "Fix", "In volcano plot the FC cutoff is now correctly applied. Previously the value were filtered according to log2FC."), addNews("Mar 12th 2019", "Front-end", "Add data summary page, hides menu pages and redirect users after data loading."), addNews("Feb 14th 2019", "Functional results", "It is now possible to sort the categorie terms based on both pvalue and Fold enrichment."), addNews("Feb 14th 2019", "Jvenn results", "Duplicated genes are now highlited as orange in the output table"), addNews("Feb 14th 2019", "Upload", "Users can now import csv data with semicolon or comma separatos by precising the decimal"), addNews("Jan 25th 2019", "Bug", "Correct david$getSpecieNames (Specieshm and Speciesvenn)"), addNews("Jan 25th 2019", "Data", "Users can now register as a team and load their data directly from the server (only for 2019 projects and logs are provided in report)"), addNews("Jan 25th 2019", "MATRiX", "MATRiX is now running with Shinyproxy (Spring + Docker)"), addNews("Jan 21th 2019", "Increased exploration", "Add features to filter the top n based on the FDR/RAW and logFC, Generate strip chart for specific genes and barplot for Volcano plot"), addNews("Jan 11th 2019", "Data", "MATRiX is now compatible with Microarray, ChIP-seq and RNA-seq data"), addNews("Nov 30th 2018", "MATRiX", "Add tootlip for distance, its now possible to export acyclic graphs in pdf and eps, correct bugs for classification enrichment with 0 nodes by inactivating donwload button"), addNews("Nov 29th 2018", "Venn Diagram/HTML", "Correct bugs now venn diagram table is based on genes and not probes."), addNews("Nov 5th 2018", "Venn Diagram", "Remove non annotated genes."), addNews("Oct 19th 2018", "Volcano plot", "Search group of genes based on regular expression."), addNews("Oct 15th 2018", "Venn Diagram", "Change the library to Jvenn."), addNews("Aug 15th 2018", "Presentation/Video", "Added a video to present MATRiX and add modules to import files."), addNews("Aug 10th 2018", "Upload/Volcano", "You can explore your different comparisons with a volcano plot."), addNews("Aug 6th 2018", "Venn Diagram/Enrichment", "Add acyclic graph if download."), addNews("Aug 4th 2018", "Heatmap/Bubble graph", "You can display or not the labels within the bubbles."), addNews("Aug 3th 2018", "Heatmap/Go(Analysis)", "You can now plot a bubble graph (Highcharts) that summarizes the top categories from the resulting datatable."), addNews("Jul 28th 2018", "Home/Support", "You can asks your questions directly in the Support."), addNews("Jul 25th 2018", "Tutorial/Video", "Soon will be added a video to summarise the application."), addNews("Jul 20th 2018", "New page", "Add a Home page regrouping informatios about the app."), addNews("Jul 16th 2018", "Venn" ,"You can now choose your color for the venn diagram."), addNews("Jul 16th 2018","Bug fixes","Venn diagram display erros when filtering."), addNews("Jul 5th 2018","Venn/DAVID","Add Gene functionnal classification for selected intersection(s)."), addNews("Jun 26th 2018","Add features","It's now possible to interact with the rendering table to filter the table in the aim of plotting the top n genes. For the GO enrichment it is now possible to select the rows in order to display the gene symbol according to the entrez ids."), addNews("Jun 22th 2018","Bug fixes","For two contrasts the venn.draw function was not ordering the contrast names in the right order."), addNews("Jun 20th 2018","MATRiX","First public release of MATRiX. Enhancement of the gui with the use of dashboard package."), addNews("Jun 18th 2018","GO enrichment","It is now possible to query the DWS for the Heatmap and save the result in xlsx format for the different clusters"), addNews("Jun 15th 2018","DNS ","Adding DNS for the MATRiX application (matrix.toulouse.inra.fr)"), addNews("Jun 10th 2018","Venn diagram","The venn diagram FC and display of the top n genes have been added to compare the results of 2 or more contrasts."), addNews("Jun 5th 2018","PCA/Heatmap","Display color groups side by side in the gui."), addNews("May 29th 2018","beta-test","The service will be made available once the beta test phase is officially completed.") ) ) ) ) ), tabItem(tabName = "Upload", style = "background-color: #ffffff;", bsAlert("alert"), tags$style(type='text/css', ".well { max-width: 2em; }"), fluidRow( tags$head( tags$style(type="text/css", ".myslidermain .irs-grid-text {bottom: 5px;color: #333;} .myslidermain .irs-min{color: #333;font-size: 10px;line-height: 1.333;text-shadow: none;top: 0;padding: 1px 3px; background: rgba(0,0,0,0.1);border-radius: 3px;-moz-border-radius: 3px} .myslidermain .irs-max{color: #333;font-size: 10px;line-height: 1.333;text-shadow: none;top: 0;padding: 1px 3px; background: rgba(0,0,0,0.1);border-radius: 3px;-moz-border-radius: 3px}")), column(width = 9, div( style = "width:100% ; max-width: 1500px; height: 1500px max-height: 2200px;" ,id = "upload", tags$h1("How to import ?"), tags$ul( tags$li("First click on the browse button to load the data"), tags$li("After the pop up has appeared, you will have to select the data files."), tags$li("It is also possible to directly drag and drop your data files in the browse button"), tags$li("You need three distinct csv files, these files are respectively named xxx_pData, xxx_WorkingSet and xxx_ResTable."), tags$li("pData : The experimental design in a 2 column table that associates samples to their respective biological conditions"), tags$li("WorkingSet : The table of the normalised expression values (log2, cpm, ...) with genes in rows and samples in columns. The first column must contain the unique gene identifier (or transcript, probe, ...)."), tags$li("ResTable : The table containing the results of differential analysis (fold change, p-value and FDR) next to a first column with unique gene identifier and a second column with the gene symbol."), tags$li("The final step consist to select all the data at once and then confirm the selection by clicking on the open button."), tags$li("A green message will then appear to confirm the data loading with a summary table.") ), tags$p( tags$img(src = "pData.png"), tags$img(src = "restable.png"), tags$img(src = "workingset.png") ), tags$h1("Tips"), tags$ul( tags$li("Unique IDs and GeneName columns must appear in the statistical data and unique IDs columns for Workingset in order to import the data (RNA-seq, DNA-chips, ChIP-Seq)."), tags$li("You can select a region by handling the left click button if the files are stacked together, if it's not the case you can select the different files by maintening the Ctrl button and clicked on the files.") ), tags$h1("Warning"), tags$ul( tags$li("It is highly recommanded to not modify these files (removed columns, change column names ...) in the aim of not disturbing the well functionning of the application.") ) )), div(id="pass",style = "word-wrap: break-word;", column(width = 3, box(id="boxpass",title = strong("Upload data", style="font-size:25px;"), width = NULL, background = "light-blue", inlineCSS(list(.pwdGREEN = "background-color: #DDF0B3",.pwdRED = "background-color: #F0B2AD")), #~ downloadLink("downloadData", label = "Download example data files", style="color:orange; float:right;"), fluidRow(column(12, p(a("Download example data files", href="sampleData.zip",target="_blank", style="color:orange;"), style="font-size: 14px; float:right;"))), br(), fluidRow(column(12,p("Files configurations:",style="color:white; font-weight: 1000; font-size: 16px;"))), fluidRow(column(6,csvIdentifier("datafile", "Feature Identifier")), column(6, csvDecimal("datafile"))), br(), fluidRow(column(12,p("Upload project .csv files from:",style="color:white; font-weight: 1000; font-size: 16px;"))), csvFileInput("datafile", "1. your local machine"), fluidRow(column(12, p("2. your team's project on the server location",style="color:white; font-weight: 700; font-size: 14px;"))), dirModuleUI("datafile"), br() ))))), tabItem(tabName = "Datasummary", style = "background-color: #ffffff;", tags$div(id ="statussum",class ="gif"), fluidRow( column(width = 9, div( style = "width:100% ; max-width: 1500px; height: 1500px max-height: 2200px;" , id = "sumardata", tabBox( title = "Data summary", width = NULL, id = "sumardata", tabPanel( "Summary tables", style = "background-color: #ffffff;", textOutput("myFileName"), column( 12, h3( "Summary table of significant genes regarding FC and p-value treshold" ), helpText("Adjust p-value treshold to update the summary table"), div( class = "myslidermain", sliderInput( "pval1", "", min = 0.01, max = 0.05, value = 0.05, step = 0.01, width = "500" ), renderoutputTable("rendersummary")# render a renderTable or renderDataTable within an application page ) ), column( 12, h3("Sample-Groups table"), renderoutputTable("renderpdata") ), column( 12, h3("Statistical results table"), renderoutputTable("renderestab") ) ), tabPanel( "Volcano plot", style = "background-color: #ffffff;", div(style = "display:inline-block;", fluidRow( column(5, style = "width:30%", downloadFiles("savevolc", "Save Volcano plot")), column(3, style = "width:20%;", selFormat("savevolc")) )), plotOutput(outputId = "volcanoplot", height = 900) , div(style = "display:inline-block;", fluidRow( column( 3, style = "width:34.0%;", downloadFiles("savebarvolc", "Save Barplot") ), column(3, style = "width:20%;", selFormat("savebarvolc")) )), plotOutput(outputId = "barplotvolc", height = 500) ), tabPanel( "Stripchart genes", value = "stripgenes", column(width = 12, div( id = "stripbox", box( title = "Filter the table", width = 10, status = "primary", solidHeader = TRUE, collapsible = TRUE, collapsed = TRUE, icon = icon("arrow-down"), column( width = 4, radioButtons( "decidemethodstrip", label = "Choose your statistical method", choices = c("adj.p.val (FDR)" = "FDR", "p.value (raw)" = "None"), inline = TRUE ) ), div(class = "myslidermain", cutoffElements("degstrip", 3, 3)), column(width = 12, textOutput("selected_stripgene")) ) )), column( 12, h3("This table shows the normalized values"), renderoutputTable("orderedwk") ), div(style = "display:inline-block;", fluidRow( column(3, style = "width:27.0%;", downloadFiles("savestrip", "Save Stripchart")), column(3, selFormat("savestrip")) )), plotOutput( outputId = "renderstripgenes", height = "500px", width = "100%" ) ) ) ) ), div(id = "pass", style = "word-wrap: break-word;", column( width = 3, box( id = "boxpass", title = strong("Data summary", style = "font-size:25px;"), width = NULL, background = "light-blue", inlineCSS( list(.pwdGREEN = "background-color: #DDF0B3", .pwdRED = "background-color: #F0B2AD") ), br(), selectInput( "method", "Statistical method", choices = c("adj.p.val (FDR)" = "FDR", "p.value (raw)" = "None") ) ), box( id = "boxpass2", title = strong("VOLCANO plot", style = "font-size:25px;"), width = NULL, background = "light-blue", fluidRow(column(6, uiOutput("compvolc")), column( 6, selectInput( "regulationvolc", # Create a select list that can be used to choose a single or multiple items from a list of values. "Choose regulation", choices = c("both", "up", "down") ) )), fluidRow(column( 6, sliderInput( 'volcfc', "Fold-Change cutoff", min = 1, max = 10, step = 1, value = 1 ) ), column( 6, sliderInput( 'volcpval', "P-value cutoff", min = 0.01, max = 0.05, step = 0.01, value = 0.05 ) )), ##---------- shiny::actionButton( "toggleAdvancedVolc", "Advanced Graphical Options", href = "#", style = "color: #fff; background-color: #337ab7; border-color: #2e6da4" ), br(), shinyjs::hidden(div( id = "advancedvolc", fluidRow(column( 4, sliderInput( 'volclab', "Label size", min = 1, max = 6, step = 0.5, value = 3.0 ) ), column( 4, sliderInput( 'volcpt', "Point size", min = 0.5, max = 3, step = 0.1, value = 1 ) ), column( 4, sliderInput( 'volcalpha', "Pt transparency", min = 0.1, max = 1, step = 0.1, value = 1 ) )) )) ,br(), ###----------- div( id = "mytextvolc", p( " Highlight gene(s): fill comma-separated GeneNames" ) ), fluidRow(column(12, textInput( inputId = "fillvolc", label = NULL, value = NULL, placeholder = "FOXP2,OT,AVPR1a", width = "100%") )), fluidRow(column( 6, textInput( inputId = "findfamily", label = "Highlight a gene family", value = NULL, placeholder = "Cyp", width = "100%" ) ), column( 6, numericInput( 'topvolc', 'Highlight top X genes', 0, min = 0, max = 5000 ) )), uiOutput("addcompvolc") ) )) )), ############################### ######## PCA page # ############################### tabItem(tabName = "PCA", tags$style(type='text/css', ".well { max-width: 20em; }"), tags$style(type='text/css', ".well { max-height: 50em; }"), # singleton( # tags$head(tags$script(src = "gif.js")) # ), fluidRow(column(width = 9, div(style = "width:100% ; max-width: 1500px; height: 1500px max-height: 2200px;", tabsetPanel( tabPanel( strong("Scree plot"), div(style="display:inline-block;", fluidRow(column(1, style="width:9.666%;", downloadFiles("downloadplots", "Save Scree plot")), column(2), column( 3, selFormat("downloadplots")))), br(), tags$div(id ="statuspca", class ="gif"), plotOutput(outputId = "eigpca", height = 700) ), tabPanel( strong("PCA plot"), tags$style(type = "text/css",".shiny-output-error:before { visibility: hidden; }"), div(style="display:inline-block;", fluidRow(column(1,downloadFiles("savepca", "Save PCA plot")), column(2), column( 3, selFormat("savepca")))), plotOutput(outputId = "PCA", height = 700) #,plotOutput(outputId = "PCAvarender", height = 700) ) ) ) ), div(id="pass",style = "word-wrap: break-word;", column(width=3, box(id="boxpasspca",title = strong("PCA settings",style="font-size:25px;"), width = NULL, background = "light-blue", inlineCSS(list(.pwdGREEN = "background-color: #DDF0B3",.pwdRED = "background-color: #F0B2AD")), checkboxElements("selgrouppca"), fluidRow(column(6, selectInput("dim1", label = h6(gettext("x axis")), choices = list( "Dim 1" = 1, "Dim 2" = 2, "Dim 3" = 3, "Dim 4" = 4, "Dim 5" = 5 ), selected = firstdim ) ), column(6, selectInput("dim2", label = h6(gettext("y axis")), choices = list( "Dim 1" = 1, "Dim 2" = 2, "Dim 3" = 3, "Dim 4" = 4, "Dim 5" = 5 ), selected = secdim ) )), fluidRow( column(4, checkboxInput("label", "Add labbels names", TRUE)), column(4, checkboxInput("meanpoint", "Add mean points", TRUE)), column(4, checkboxInput("ellipse", "Add ellipses", FALSE))#, ), fluidRow(column(3), column(8,checkboxInput("jitter", "Avoid overlap between points", FALSE))), verbatimTextOutput("valued"), sliderInput( "labelsiize","Label size",min = 2,max = 6,value = 4,step = 1 ), sliderInput("pointsiize","Point size",min = 2,max = 6,value = 2,step = 1 ), renderncolour("myPanelcolpca"), br() ))))), ############################### ######## Venn Page # ############################### tabItem(tabName = "Venn", div(id ="statusvenn",class ="gif"), tags$style(type='text/css', ".well { max-width: 25em; }"), tags$style(type='text/css', ".well { max-height: 70em; }"), fluidRow(column( width = 9, div( style = "width:100% ; max-width: 1500px; height: 1850px; max-height: 2800px;", tabsetPanel( id = "Vennd", tabPanel( value= "vennset", strong("Venn Diagram"), column(6,offset = 0, style='padding:0px;', div(style="display:inline-block", fluidRow( column(3, style="width:43%", downloadFilestab("savevennlist", "Download the data")), column(3, downloadFilestab("saveallset", "Download venn set")) ))), column(width=6, offset = 0, style='padding:0px;', div(id = "vennbox", box(title="Filter the datatable",width = 12, status = "primary", solidHeader = TRUE,collapsible = TRUE,collapsed = TRUE,icon = icon("arrow-down"), column(3, numericInput("filtertopjvenn", "Top n genes", value = 50, min=5 , max = 150)), column(5, selectInput("filtermethjvenn", "Based on", choices = c("adj.p.val (FDR)"= "FDR", "p.value (raw)" = "None"))), column(5, uiOutput("filtercompjvenn")) ))), tags$script(src="libraries/prettify.js") , tags$script(src="libraries/jvenn.min.js") , tags$script(src="libraries/canvas2svg.js") , tags$script(src="tooltip.js"), fluidRow( column(6, tags$script(src="jvenn.js"), tags$div(id="jvenn-container", style = "background-color: white; width: 100%; height:100%") ), column(6, div(class= "dfvenn" , style="font-size:24px; margin-top: 17px;", htmlOutput("dfvenn")), conditionalPanel(condition = "typeof input.jvennlist !== 'undefined' && input.jvennlist.length > 0 && input.dispvenn == 'probes'", helpText( "You can directly filter the table by fold change and save the output table" )), conditionalPanel(condition = "typeof input.jvennlist !== 'undefined' && input.jvennlist.length > 0 && input.dispvenn == 'genes'", helpText("You can directly filter the table by fold change and save the output table, genes in orange are duplicates " )), renderoutputTable("renderjvenntab"), br(),br(),br(), conditionalPanel(condition = "input.selcontjv", div(class= "dfvennbef" , style="font-size:24px; margin-top: -28px; ")) )), div(style="display:inline-block;",id ="dontwanttoshow", fluidRow( tags$head( tags$style(type="text/css", ".topgeness label{ display: table-cell; text-align: left; vertical-align: middle; } .inline .form-group{display: table-row;} ") ), column(3,br(),style= "width:25%;", actionButton( inputId = "topdegenes", label = "Plot top DE genes",style ="color: #fff; background-color: #337ab7; border-color: #2e6da4" )), column(3,style= "width:26.0%;",br(),downloadFiles("savebarvenn", "Save Barplot")), column( 3,br(),style= "width:11%; padding: 0%;", selFormat("savebarvenn")))), plotOutput(outputId ="barplotvenn", height = "500px", width ="100%"), br(), h1("Here's a tracker for your different selections:"), tags$head( tags$link(rel = "stylesheet", type = "text/css", href = "style.css") # add style.css in order to add better police ), tags$head(tags$style("#container * { display: inline; }")), tags$head(tags$style("#mytext p{font-weight: 500;font-size: 17px;line-height: 1.5;color: white; position: static;} #mytext a{color: orange;}" )), div( id = "container", p("You have chosen the following comparisons"), htmlOutput("contvenn"), p("for a total of"), htmlOutput("totalgenes"), p("genes with a P-value and FC treshold respectively set to "), tracketCutoff("degvenn") ), div( id = "container", p("There are"), htmlOutput("venngenes"), p("significant genes"), p("for this intersection"), htmlOutput("continter"), p("if you click on the top DE genes button you will plot the top"), htmlOutput("topgenesdf"), p("rows the of the previous table") ) ) # Deactivate venn Enrich Result Tab panel #~ , #~ tabPanel(strong("Venn Enrichment Results"), #~ value = "venngopanel", #~ useShinyjs(), #~ fluidRow(column(3,style= "width:14.3%;",downloadFiles("saveclustvenn", "Export to acyclic graph")), #~ column( 1, selFormat("saveclustvenn"))), #~ plotOutput("clusterPlot", width = "100%", height = "700px"), #~ br(),br(),br(), #~ renderoutputTable("clustdavid") #~ ) )) ), div(id="pass",style = "word-wrap: break-word;", column(width=3, box(id="boxpassvenn",title = strong("Venn settings", style ="font-size:25px;"), width = NULL, background = "light-blue",height = "100%", inlineCSS(list(.pwdGREEN = "background-color: #DDF0B3",.pwdRED = "background-color: #F0B2AD")), checkboxElements("selcompvenn"), fluidRow(column(6, selectInput("methodforvenn","Statistical method", choices = c("adj.p.val (FDR)"= "FDR", "p.value (raw)" = "None") )), column(6, selectInput("regulation", # Create a select list that can be used to choose a single or multiple items from a list of values. "Choose your regulation", choices = c("both","up", "down")))), div(id = "mytext", p("A comma-separated list of ", tags$a(href = "https://stat.columbia.edu/~tzheng/files/Rcolor.pdf",target="_blank", "x11"), "or", tags$a(href = "https://en.wikipedia.org/wiki/Web_colors#Hex_triplet",target="_blank", "hex colors."))), textInput(inputId = "fill",label = NULL,value = c( "green,blue,red,purple,orange,brown"), placeholder = "grey70, white, steelblue4",width = "100%" ), fluidRow( cutoffElements("degvenn",c1=6,c2=6)), br(), fluidRow( column(12, uiOutput("dispidvenn")), column(6, checkboxInput("Notanno","Remove the genes that are not annotated",FALSE)), column(6, checkboxInput("Allcont","Show the logFC for all comparisons",FALSE))), br(), shiny::actionButton( "toggleAdvancedJvenn", "Advanced Jvenn Options", href = "#", style = "color: #fff; background-color: #337ab7; border-color: #2e6da4" ), br(), shinyjs::hidden(div( id = "advancedjvenn", br(), fluidRow( column(6, p("Select your Type of Venn",style="color:white; font-weight: 700; font-size: 14px;"), includeHTML("HTML/jvenntype.html")), column(6, p("Display the stat",style="color:white; font-weight: 700; font-size: 14px;"), includeHTML("HTML/displaystat.html"))), br(), p("Police's size", style="color:white; font-weight: 700; font-size: 14px;"), includeHTML("HTML/fontsize.html"), br(), fluidRow( column(6, p("Find an element in list(s)",style="color:white; font-weight: 700; font-size: 14px;"), includeHTML("HTML/seekgene.html")), column(6, p("Display switch",style="color:white; font-weight: 700; font-size: 14px;"), includeHTML("HTML/dispswitch.html"))) )), br(), br(), conditionalPanel( "input.selcontjv" , strong("Functional Annotation Clustering",style = "font-family: 'times'; font-size:20px; font-style: strong; "), br(),br(), fluidRow(column(6, sliderInput("clusterNumber",label = "Cluster", value = 1, min = 1,max = 5 )), column(6, selSpecies("vennanalysis"))) # deactivate vennanalysis button #~ , #~ fluidRow( #~ column(6, #~ selectInput("catvenn", "Choose your category", selected ="BP", c("BP","MF","CC"))), #~ column(6,br(), #~ runAnalysis("vennanalysis"))) ) ))))), ############################### ######## Heatmap Page # ############################### tabItem(tabName = "Heatmap", tags$div(id ="statushm",class ="gif"), tags$style(type='text/css', ".well { max-width: 25em; }"), fluidRow(column( width = 8, div( tabsetPanel( id = "heatmapmainp", tabPanel( strong("Heatmap"),value = "hmmainpan", div(style="display:inline-block;", fluidRow(column(1,style="width:9%;",downloadFiles("savehm", "Save Heatmap")), column(2), column( 3, selFormat("savehm")))), includeCSS("./css/style.css"), conditionalPanel(condition = '!output.heatmbool', verbatimTextOutput("warningsheat") ), conditionalPanel( condition = "input.col1 =='blue' && input.col3 =='red' && input.submit == 0 ", wellPanel(style = "position: absolute; width: 30%; left: 35%; top: 40%; box-shadow: 10px 10px 15px grey;", selectInput("text", "Choose your intermediate color:", choices = c("yellow", "white")), actionButton("submit", "Submit")) ), conditionalPanel(condition = 'output.heatmbool', plotOutput("distPlot", width = "100%" , height = 1300) ), h1("Here's a tracker of your different parameters:"), tags$head( tags$link(rel = "stylesheet", type = "text/css", href = "style.css") # add style.css in order to add better police ), tags$head(tags$style(" #container * {display: inline;}")), div( id = "container",p('Selection of'),htmlOutput("myNUM"), p('significant features'), p('for the following comparison(s):'), htmlOutput("testtt") ), div( id = "container", p('Based on the '), textOutput("myMET"), p('method, with a P-value and FC treshold respectively set to '), tracketCutoff("deghm") ), conditionalPanel(condition = "input.maxgen != null", div( id = "container", p('Limitation to a maximum of '), textOutput("maxGen"), p(' top regulated features per comparison according P-value.'))), div( id = "container", p('Clustering distance method :'), textOutput("myMAT"), p( '. Number of Clusters selected:', textOutput("myCLUST") ) ), div( id = "container", p('Graphical color settings of the groups :'), textOutput("indivcol"), p('are respectively :'), htmlOutput("myPAL") ) ), tabPanel( strong("Clusters"), value = "dfhmclu", downloadFilestab("downloadcut", "Download the data"), column( 12, h3("Table of Features from the heatmap"), helpText( "Cluster numbers are indicated and are in decreasing order to be matching the same order of the heatmap image. Note that on the heatmap, the clusters numbers are ordered from the bottom to the top of the image." ), renderoutputTable("clusteringtable"), h3("Table summarizing the number of features per cluster"), helpText( "Note that duplicated features are removed to calcuate the number of genes by cluster" ), renderoutputTable("totalgenbyc") )), # Deactivate Enrichment result Tab panel #~ tabPanel( #~ strong("Enrichment Analysis Results"),value="maingo", #~ downloadFilestab("savegohmdavxlsx", "Save enrichment resluts as .xlsx"), #~ conditionalPanel(condition = "input.GOana", #~ div(class= "highvenn" , style="font-size:24px; text-align: center;", #~ htmlOutput("titlegomain")), #~ renderoutputTable("davidgo"), #~ verbatimTextOutput("printmessage"), #~ verbatimTextOutput("printselected"), #~ div(class= "highvenn" , style="font-size:24px; text-align: center;", #~ htmlOutput("titlegotop")), #~ tags$script(src="libraries/highcharts.js"), #~ tags$script(src="libraries/highcharts-more.js"), #~ tags$script(src="https://code.highcharts.com/modules/exporting.js"), #~ tags$script(src="https://code.highcharts.com/modules/export-data.js"), #~ fluidRow(column(6, selectInput( #~ "enrichbased", #~ "Choose your sorting criteria", #~ choices = c("Fold Enrichment"= "FoldE", "p.value" = "Pvalue") #~ )), column(6,br(), checkboxInput("addlabelhigh", "add label", FALSE))), #~ tags$div(id="highChart") , #~ tags$script(src="bubble.js"), #~ ns = NS("hmanalysis") #~ )), tabPanel( strong("Cut heatmap"), bsAlert("alert"),value = "cuthmmainpan", plotlyOutput(outputId = "cutheatmap", height = 600), br(),br(),br(),br(),br(),br(),br(),br(),br(), br(),br(),br(),br(),br(),br(),br(),br(),br(), br(),br() ) ) ) ), column(width=4, div(id="mypanheat", style="color: white;", tabBox( title = "", id = "heatmapanel", width = NULL, # ~ style="background-color: #ffffff;", tabPanel("Heatmap",id= "heatmpan", ##ADD8E6 style="background-color: white;border-color: white", # #3c8dbc value="widgetheat", # ~ strong("Heatmap settings", style="font-size:25px;") , # ~ br(), box( id = "boxpass", title = strong("Heatmap Settings", style = "font-size:25px;"), width = NULL, background = "light-blue", inlineCSS( list(.pwdGREEN = "background-color: #DDF0B3", .pwdRED = "background-color: #F0B2AD") ), actionLink("resetAll", label = ("reset all"), style="color:orange;float:right;font-size: 18px;"), br(), div(id = "form", checkboxElements("selgrouphm"), checkboxElements("selcomphm"), br(),br(), fluidRow( column(6, numericInput(# Create an input control for entry of numeric values 'maxgen', 'Maximal number of genes by comparison(s)', NULL, min = 100,max = 2500 )), column(6,br(), selectInput( "decidemethod", "Statistical method", choices = c("adj.p.val (FDR)"= "FDR", "p.value (raw)" = "None") ))), br(), fluidRow( cutoffElements("deghm",c1=6,c2=6) ), br(), div(id = 'center', strong("Advanced settings",style = "font-family: 'times'; font-size:20px; font-style: strong; ")), br(), shiny::actionButton( "toggleAdvanced", "Advanced Computational Options", href = "#", style = "color: #fff; background-color: #337ab7; border-color: #2e6da4" ), br(), shinyjs::hidden(div( id = "advanced", fluidRow( column(6, numericInput('clusters', 'Number of Clusters', 3, min = 1, max = 15)), column(6, selectInput( "dist","Distance method computed",choices = c("correlation", "euclidian","manhattan", "cosine")), div(id = "tooltipelem", bsTooltip(id = "dist", title = "correlation:\n dist = 1-corr", placement = "left", trigger="hover")) )), fluidRow( column(6, checkboxInput("meangrp", "Apply group mean", FALSE)), column(6, selectInput( "algomet","Agglomeration method",choices = c("ward.D2", "single","complete","average"))) ))) ,br(), shiny::actionButton("toggleAdvancedcolors","Advanced graphical Settings", href = "#",style = "color: #fff; background-color: #337ab7; border-color: #2e6da4" ), br(), div( id = "advancedcol", fluidRow( column(6, colourpicker::colourInput( "col1","Select colour for downregulated genes",firstcol,palette = "limited" ) ), column( 6, colourpicker::colourInput("col3", "Select colour for upregulated genes", lastcol, palette = "limited") ) ), fluidRow(column(4, numericInput( 'rowsize','Row size',0.9, min = 0.2,max = 1.5,step = 0.1 ) ), column(4, numericInput( 'colsize','Col size',0.9, min = 0.2,max = 1.5,step = 0.1 ) ), column(4, numericInput( 'legsize','Legend size',0.8, min = 0.2,max = 1.5,step = 0.1 ) ) ), fluidRow(column(6, radioButtons("rowname", "show/hide rowname", c("hide", "show")) ), column(6, radioButtons("colname", "show/hide colnames", c("show", "hide")) )), renderncolour("myPanelcolhm"), br() ) ), #end of the div "form" br(), shinyjs::hidden(div( # Hide some widgets between the tags id = "advancedgo", wellPanel( ) )), br(), div(id = 'center', strong("Print Heatmap",style = "font-family: 'times'; font-size:20px; font-style: strong; ")), br(), fluidRow(column(6, uiOutput("button") ), column(6, checkboxInput("reactheat", "Add reactivity", FALSE)) ), helpText("Note: It is highly advised to check this box if you're working with a set of genes close to 1000.",style="color:White; font-size:15px;") ), #end box conditionalPanel(condition = 'output.heatmbool', box( id = "boxpass", title = strong("Functional Analysis", style = "font-size:25px;"), width = NULL, background = "light-blue", inlineCSS( list(.pwdGREEN = "background-color: #DDF0B3", .pwdRED = "background-color: #F0B2AD") ), fluidRow(column(12,h4("Send genes from a cluster to a web service"))), fluidRow( column( 4, uiOutput("cutgo")), column(4, strong("Submit to:"),br(), tags$button(id = "submit_enrich_hm", "",class = "btn action-button", tags$img(src = "enrichr_logo.png", height = "26px"),style = "color: #fff; background-color: #337ab7; border-color: #2e6da4")), # Deactivate DAVID button # column(4, strong("Submit to:"),br(), uiOutput("DAVID_submit")) ) #~ , #~ br(), #~ fluidRow(column(12,h4("Run Enrichment analysis inside MATRiX app"))), #~ fluidRow( #~ column(4, selSpecies("hmanalysis")), #~ column(4, catHm("hmanalysis")), #~ column(4, br(), runAnalysis("hmanalysis")) #~ ), #~ br(), #~ helpText("Run Gene enrichment analysis, results are obtained by querying DWS (DAVID Web Services)", style="font-size:15px; color:white;") ) # end box ) # end conditional panel: maybe move to another tabpanel??? ), tabPanel( "Heatmap Clusters", value="cutheatmainp", box( id = "boxpass", title = strong("Clusters plotting settings", style = "font-size:25px;"), width = NULL, background = "light-blue", inlineCSS( list(.pwdGREEN = "background-color: #DDF0B3", .pwdRED = "background-color: #F0B2AD") ), br(), uiOutput("cutcluster"), selectizeInput('cutinfo', 'Choose your types of plots', choices = cutheatmlist), # cutheatmlist is a variable defined in the global environment br(), selFormat("saveboxclust"), br(), verbatimTextOutput("event"), br(), downloadFiles("saveboxclust", "Save Plot") ) )# end tabpanel clusters ) ) ) )) ) ) ) ############################### ######## END dashboardbody # ############################### shinyUI( dashboardPage(skin="blue",title = "MATRiX app", dbHeader, sidebar, body ) )