www/cometpdf/ui.R

library(shiny)

shinyUI(fluidPage(
  
  titlePanel("coMET"),
  
  sidebarLayout(
    sidebarPanel(
      h5("Info file",style = "color:red"),
      p(span("You need to load a file", style = "color:red")),
      p("Example file:",a(href="http://comet.epigen.kcl.ac.uk:3838/cyp1b1_infofile_Grch38.txt", "cyp1b1_infofile.txt", target="_blank")),
   
      fileInput('datafile', 'Choose info file to upload (mandatory, max 100 omic features) :',
                accept=c('text/csv', 
                         'text/comma-separated-values,
		text/plain', 
                         '.csv')
      ),
      
      checkboxInput(inputId="defineParm",label="Define parameter for data file", FALSE),
      conditionalPanel(condition = "input.defineParm", 
                       p(span("You need to define your format", style = "color:red")),
                       selectInput("dataformat", "Format of data file:",
                                   c(" "="NULL",
                                     "site" = "site",
                                     "region" = "region",
                                     "Site with direction values" = "site_asso",
                                     "Region with directions values" = "region_asso")),
                       
                       conditionalPanel(condition = "input.dataformat == 'site_asso' | input.dataformat == 'region_asso' ",
                                        checkboxInput(inputId="dispAsso",label="Display the direction of association (positive/negative)", TRUE),
                                        conditionalPanel(condition = "input.dispAsso",
                                                         textInput("datacolor", "Give a color:", "red")
                                        ),
                                        checkboxInput(inputId="dispbetaAsso",label="Display the beta of association (value)", TRUE)
                       ),
                       conditionalPanel(condition = "input.dataformat == 'region' | input.dataformat == 'region_asso' ",
                                        checkboxInput(inputId="dispReg",label="Display the region ", TRUE)
                       ),
                       
                       textInput("datalabel", "Give a lable:", "Discovery"),
                       
                       selectInput("datasymb", "Define the symbol of data:" , 
                                   choices = c("circle-fill","square-fill","diamond-fill"))
      ),
      
      hr(),
      h5("Correlation matrix or Raw data",style = "color:red"),
      p(span("You need to load a file", style = "color:red")),
      p("Example file:",a(href="http://comet.epigen.kcl.ac.uk:3838/cyp1b1_res37_rawMatrix.txt", "cyp1b1_res37_rawMatrix.txt", target="_blank")),
      fileInput('corfile', 'Choose raw or correlation file to upload (mandatory):',
                accept=c('text/csv', 
                         'text/comma-separated-values,
		text/plain', 
                         '.csv')
      ),
      
      checkboxInput(inputId="definecorParm",label="Define parameter for raw or correlation file", FALSE),
      conditionalPanel(condition = "input.definecorParm",
                       p(span("You need to define your format", style = "color:red")),
                       selectInput("corformat", "Format of the correlation matrice:",
                                   c(" " = "NULL",
                                     "Correlation" = "cormatrix",
                                     "raw" = "raw",
                                     "inverse Raw" = "raw_rev")),
                       conditionalPanel(condition = "input.corformat == 'raw' | input.corformat == 'raw_rev'",
                                        selectInput("cormethod", "Method to compute the correlation:",
                                                    c(
                                                      "Spearman" = "spearman",
                                                      "Pearson" = "pearson",
                                                      "Kendall" = "kendall")),
                                        numericInput("coralphaCI", "alpha value of confidence level (for example 0.05):",0.05),
                                        numericInput("corpvalThres", " higher P-value threshold displayed (for example 0.05):", 0.05),
                                        selectInput("coradjmethod", "Method to adjust for multiple test:",
                                                    c(
                                                      "none" = "none",
                                                      "Holm" = "holm",
                                                      "Hochberg" = "hochberg",
                                                      "Hommel" = "hommel",
                                                      "Bonferroni" = "bonferroni",
                                                      "Benjamini-Hochberg" = "BH",
                                                      "Benjamini–Hochberg–Yekutieli" = "BY",
                                                      "FDR" = "fdr"
                                                      )
                                                    )
                       ),
			selectInput("corcolor", "Define the color scheme of correlation matrix:",
                                                    c(
                                                      "Blue to Red via white" = "bluewhitered",
                                                      "Heat" = "heat",
                                                      "cm" = "cm",
                                                      "topo" = "topo",
                                                      "Gray" = "gray",
                                                      "Blue to Red"= "bluetored"))

      ),
      
      hr(),
      h5("Configuration file"),
      p('If you do not want to define the parameters of coMET via the interface, you can download the example configuration file and modify according to your data. But you have to modify at least 3 parameters (', span("mydata.format (format of info file), CORMATRIX.FORMAT ( format of raw or correlation matrice), cormatrix.method (method to analyse the raw data if it is raw format)", style = "color:red"),')'),
      p("Example file:",a(href="http://comet.epigen.kcl.ac.uk:3838/config_cyp1b1_zoom_4webserver_Grch38.txt", target="_blank", 
                          "config_cyp1b1_zoom_4webserver.txt")),
      fileInput('configfile', 'Choose configuration file to upload:',
                accept=c('text/plain', '.txt')
      ),
      
      hr(),
      h5("Parameters for P-value plot"),
      selectInput("genome", "Define the genome:",
			            c(
			              "Hg19" = "hg19",
			              "GRCh37" = "grch37",
			              "GRCh38" = "grch38")),
      checkboxInput(inputId="defineplotParm",label="Define parameter for plot", FALSE),
      conditionalPanel(condition = "input.defineplotParm", 
                       uiOutput("startCpG"),
                       uiOutput("stopCpG"),
                       numericInput("pvalThres", "Significant P-value threshold (for example 1e-8):",0.0000001),
                       numericInput("pvalThres2", " Second significant P-value threshold (for example 1e-5):",0.00001),
                       numericInput("disppvalThres", " higher P-value threshold displayed (for example 0):", 0),
                       numericInput("factorbeta", "Factor to visualise the size of beta (for example 0.3):",0.3),
                       numericInput("fontfactorGviz", "Font size of the sample labels (for example 5):",5),
                       selectInput("scale", "Select your scale of y-values" , 
                                   choices = c("log10","ln")),
                       checkboxInput(inputId="refCpG",label="Select a CpG reference", FALSE),
                       
                       
                       # Display this only if the data file exist
                       conditionalPanel(condition = "input.refCpG == true",
                                        checkboxInput(inputId="refCpGcolor",label="Visualize the connective line of the reference CpG in purple", TRUE),
                                        uiOutput("listCpG")
                       ),
                       
                       hr(),
                       h5("Parameters of image"),
                       textInput("imagetitle", "Define the title of your plot:", "Comet plot")
      ),
      
      
      hr(),
      h5("Info file for the second set of data (e.g.= gene expression, validation data) (optional, no limitation)"),
      p("Example file:",a(href="http://comet.epigen.kcl.ac.uk:3838/cyp1b1_infofile_exprGene_region_Grch38.txt", target="_blank", 
                          "cyp1b1_infofile_exprGene_region.txt")),
      fileInput('datalargefile', 'Choose other data file to upload',
                accept=c('text/csv', 
                         'text/comma-separated-values,
		text/plain', 
                         '.csv')
      ),
      
      checkboxInput(inputId="defineextraParm",label="Define parameter for extra data file", FALSE),
      conditionalPanel(condition = "input.defineextraParm", 
                       selectInput("datalargeformat", "Format of data file:",
                                   c(" " = "NULL",
                                     "site" = "site",
                                     "region" = "region",
                                     "site with direction values" = "site_asso",
                                     "region with directions values" = "region_asso")),
                       
                       conditionalPanel(condition = "input.datalargeformat == 'site_asso' | input.datalargeformat == 'region_asso' ",
                                        checkboxInput(inputId="dispAssolarge",label="Display the direction of association", TRUE),
                                        conditionalPanel(condition = "input.dispAssolarge",
                                                         textInput("datalargecolor", "Give a color:", "green")
                                        ),
                                        checkboxInput(inputId="dispbetaAssolarge",label="Display the beta of association (value) for association", TRUE)
                                        
                       ),
                       conditionalPanel(condition = "input.datalargeformat == 'region' | input.datalargeformat == 'region_asso' ",
                                        checkboxInput(inputId="dispReglarge",label="Display the region ", TRUE)
                       ),
                       
                       textInput("datalargelabel", "Give a lable:", "Validation"),
                       selectInput("datalargesymb", "Define the symbol of data:" , 
                                   choices = c("circle-fill","square-fill","diamond-fill"))
      ),
      
      
      hr(),
      h5("Annotation track (optional)"),
      checkboxInput(inputId="defineTrack",label="Define annotation track (optional)", FALSE),
      conditionalPanel(condition = "input.defineTrack", 
                       selectInput("trackAnnot", "Select multiple annotation tracks (max 6):",
                                   c("Genes (ENSEMBL)" = "geneENSEMBL",
                                     "Transcript (ENSEMBL)" = "transcriptENSEMBL",
                                     "Genes (UCSC)" = "genesUCSC",
                                     "Ref Genes (UCSC)" = "refgenesUCSC",
                                     "CpG Island (UCSC)" = "CGI",
                                     "ChromHMM Broad (UCSC)" = "ChromHMM",
                                     "Blood Histone (Broad)" ="BroadHistone",
                                     "DNAse (UCSC)" = "DNAse",
                                     "Regulation (ENSEMBL)" = "RegENSEMBL",
                                     "Binding motif (ENSEMBL)" = "BindingMotifENSEMBL",
                                     "Other regulatories (ENSEMBL)" = "otherRegulatoryENSEMBL",
                                     "Regulatory evidence (ENSEMBL)" = "regulatoryEvidenceENSEMBL",
                                     "Regulatory features (ENSEMBL)" = "regulatoryFeaturesENSEMBL",
                                     "Regulatory segments (ENSEMBL)" = "regulatorySegmeENSEMBL",
                                     "miRNA target regions (ENSEMBL)" = "miRNAENSEMBL",
                                     "SNP (version dbSNP 142)" = "SNP",
                                     "ClinVar Main" = "ClinVar",
                                     "ClinVar CNV" = "ClinVarCNV",
                                     "GWAS catalog" = "GWAS",
                                     "GAD variants" = "GAD",
                                     "GeneReviews" = "GeneReviews",
                                     "Genome axis" = "genomeAxis",
                                     "structural SNP (ENSEMBL)" = "SNPstru",
                                     "stomatic SNP (ENSEMBL)" = "SNPstoma",
                                     "stomatic structural SNP" = "SNPstrustoma",
                                     "xeno genes (UCSC)" = "xenogenesUCSC",
                                     "Repeat Elements (UCSC)" = "RepeatElt",
                                     "Segmental duplication (UCSC)" = "SegDuplication",
                                     "GC content" = "GCcontent",
                                     "COSMIC" = "COSMIC",
                                     "Imprinted genes (GTEx)" = "ImprintedtissuesGenes"),
                                   multiple=TRUE),
                       checkboxInput(inputId="addTrack",label="Add user-customised annotation track", FALSE),
                       conditionalPanel(condition = "input.addTrack",
                                        fileInput('annotfile', 'Choose your annotation file to upload',
                                                  accept=c('text/csv', 
                                                           'text/comma-separated-values,
		text/plain', 
                                                           '.csv',
                                                           '.bed')
                                        ),
                                        
                                        selectInput("annotformat", "Format of your annotation track:",
                                                    c(" " = "NULL",
                                                      "Gene track" = "Generegion",
                                                      "Annotation track" = "Annotation",
                                                      "Data track" = "Data")),
                                        
                                        conditionalPanel(condition = "input.annotformat == 'Data' ",
                                                         selectInput("annotplot", "Format of your Data plot:",
                                                                     c(" "= "NULL",
                                                                       "dot plot" = "p",
                                                                       "line plot" = "l",
                                                                       "dot and lines plots" = "b",
                                                                       "lines plot of average values" = "a",
                                                                       "stair steps (horizontal first)" = "s",
                                                                       "stair steps (vertical first)" = "S",
                                                                       "add grid lines" = "g",
                                                                       "add linear regression line" = "r",
                                                                       "histogram lines" = "h",
                                                                       "add loess curve" = "smooth",
                                                                       "histogram" = "histogram",
                                                                       "mountain-type plot" = "mountain",
                                                                       "polygon-type plot" = "polygon",
                                                                       "box and whisker plot" = "boxplot",
                                                                       "false color image of the summarized values" = "gradient",
                                                                       "false color image of the individual values" = "heatmap",
                                                                       "Horizon plot" = "horizon"))
                                        )
                       )
      ),
      
      hr(),
			h5("Save your image",style = "color:red"),
			textInput('plotfilename', "Filename of your plot","coMET"),
			selectInput("imagesize", "Define the size of plot:" , 
			            choices = c("7","3.5")),
			selectInput("imageformat", "Define the format of plot:" ,
                                    choices = c("pdf","eps")),
      hr(),
      h5("Submit the data:",style = "color:red"),
#      p('You need to click on the "plot" button and go the coMET plot tab.'),

#p('If you want to create the plot directly in a file, you need to click on the "download" button.'),	
#       checkboxInput(inputId="RunDownload",label="Plot directly in a file", FALSE),
#                conditionalPanel(condition = "input.RunDownload",
        	downloadButton('downloadPlot', 'Download')
#       ),
#	 p('The creation of plot takes time relative to the time to connect UCSC and ENSEMBL'),
#      checkboxInput(inputId="RunPlot",label="Plot directly in the webpage, don't forget to go to the coMET plot tab ", FALSE),
 #               conditionalPanel(condition = "input.RunPlot",
#                         actionButton("goPlot", "Plot")
  #    )


    ),
    
    mainPanel(
      tabsetPanel(type = "tabs", 
                  tabPanel("coMET Home ", htmlOutput("home")),
                  #tabPanel("coMET Plot", htmlOutput("cometplotUI")),
                  tabPanel("Info data", tableOutput("table")),
                  tabPanel("Correlation Matrix", tableOutput("cortable")),
                  tabPanel("Second info data", tableOutput("odatatable")),
                  tabPanel("Annotation Data", tableOutput("annottable")),
                  tabPanel("Configuration File", htmlOutput("configtableUI")),
                  tabPanel("coMET Help ", htmlOutput("help"))
      )
    )
    
  )
  

))
TiphaineCMartin/coMET documentation built on April 27, 2022, 6:45 a.m.