Commit ab6113a2 authored by mahendra-mariadassou's avatar mahendra-mariadassou
Browse files

started refactoring code, eliminate unnecessary if-else statements in data16S

No related merge requests found
Showing with 1086 additions and 1083 deletions
+1086 -1083
This diff is collapsed.
library(shinydashboard) library(shinydashboard)
library(shinycustomloader) library(shinycustomloader)
shinyUI(dashboardPage( shinyUI(dashboardPage(
dashboardHeader(title = "Easy16S"), dashboardHeader(title = "Easy16S"),
dashboardSidebar( dashboardSidebar(
tags$div( tags$div(
title = "Select dataset for demonstration", title = "Select a dataset for demonstration purpose",
selectInput( selectInput(
"dataset", "dataset",
label = "Select dataset : ", label = "Select dataset : ",
choices = list( choices = list(
"Input data" = "input", "Input data" = "input",
"Rdata" = "rdata", "Rdata" = "rdata",
"Demo : Chaillou et al., 2015" = "food" "Demo : Chaillou et al., 2015" = "food"
), ),
# "Mach et al., 2015" = "kinetic", "Morton et al., 2017" = "soil", "Ravel et al., 2011" = "ravel", "biorare" = "biorare", "GlobalPatterns" = "GlobalPatterns" # "Mach et al., 2015" = "kinetic", "Morton et al., 2017" = "soil", "Ravel et al., 2011" = "ravel", "biorare" = "biorare", "GlobalPatterns" = "GlobalPatterns"
selected = 1 selected = 1
) )
), ),
hr(), hr(),
tags$div( tags$div(
title = "RData where 'data' is a phyloseq object.", title = "RData where 'data' is a phyloseq object.",
fileInput("fileRData", fileInput("fileRData",
label = "RData : ", label = "RData : ",
placeholder = "data.RData") placeholder = "data.RData")
), ),
hr(), hr(),
tags$div( tags$div(
title = "Abundance BIOM file come from FROGS with 'FROGS BIOM to std BIOM', Qiime or another metagenomic tool.", title = "Abundance BIOM file come from FROGS with 'FROGS BIOM to std BIOM', Qiime or another metagenomic tool.",
fileInput("fileBiom", fileInput("fileBiom",
label = "Abundance BIOM file : ", label = "Abundance BIOM file : ",
placeholder = "data.biom"), placeholder = "data.biom"),
radioButtons( radioButtons(
"biomFormat", "biomFormat",
label = NULL, label = NULL,
inline = TRUE, inline = TRUE,
choices = list(`STD BIOM` = "std", choices = list(`STD BIOM` = "std",
`FROGS BIOM` = "frogs"), `FROGS BIOM` = "frogs"),
selected = "std" selected = "std"
) )
), ),
tags$div( tags$div(
style = "text-align:center", style = "text-align:center",
title = "Resample dataset such that all samples have the same library size. \nIt's using an random sampling without replacement.", title = "Resample dataset such that all samples have the same library size. \nIt's using an random sampling without replacement.",
checkboxInput("rareData", label = "Rarefy dataset", value = TRUE), checkboxInput("rareData", label = "Rarefy dataset", value = TRUE),
textOutput("rarefactionMin") textOutput("rarefactionMin")
), ),
tags$div( tags$div(
title = "Metadata table with variables (in columns) and samples (in rows). \nMake sure you follow the exact spelling of the sample names (1st column). \nThe import of an excel table is possible but not recommended.", title = "Metadata table with variables (in columns) and samples (in rows). \nMake sure you follow the exact spelling of the sample names (1st column). \nThe import of an excel table is possible but not recommended.",
fileInput("fileMeta", fileInput("fileMeta",
label = "Metadata table : ", label = "Metadata table : ",
placeholder = "data.csv") placeholder = "data.csv")
), ),
radioButtons( radioButtons(
"CSVsep", "CSVsep",
label = "CSV separator : ", label = "CSV separator : ",
inline = TRUE, inline = TRUE,
choices = list( choices = list(
`<tab>` = "\t", `<tab>` = "\t",
`,` = ",", `,` = ",",
`;` = ";", `;` = ";",
excel = "excel" excel = "excel"
) )
), ),
tags$div( tags$div(
title = "Phylogenetic tree", title = "Phylogenetic tree",
fileInput("fileTree", fileInput("fileTree",
label = "Phylogenetic tree : ", label = "Phylogenetic tree : ",
placeholder = "data.nwk") placeholder = "data.nwk")
), ),
# tags$div( # tags$div(
# title = "Representative FASTA sequences of OTU", # title = "Representative FASTA sequences of OTU",
# fileInput( # fileInput(
# "fileSeq", # "fileSeq",
# label = "FASTA sequences : "), # label = "FASTA sequences : "),
# placeholder = "data.fasta" # placeholder = "data.fasta"
# ) # )
# ), # ),
uiOutput("downloadUI") uiOutput("downloadUI")
), ),
dashboardBody( dashboardBody(
tabsetPanel( tabsetPanel(
tabPanel( tabPanel(
"Summary", "Summary",
verbatimTextOutput("phyloseqPrint"), verbatimTextOutput("phyloseqPrint"),
withLoader(uiOutput("summaryTable")), withLoader(uiOutput("summaryTable")),
tags$footer( tags$footer(
"Questions, problems or comments regarding this application should be sent to ", "Questions, problems or comments regarding this application should be sent to ",
a(href = "mailto:cedric.midoux@irstea.fr?subject=[Easy16S]", "cedric.midoux@irstea.fr"), a(href = "mailto:cedric.midoux@irstea.fr?subject=[Easy16S]", "cedric.midoux@irstea.fr"),
align = "center", align = "center",
style = "position:absolute; style = "position:absolute;
bottom: 0; bottom: 0;
width: 100%; width: 100%;
color: grey; color: grey;
padding: 10px; padding: 10px;
# background-color: white; # background-color: white;
z-index: 1000; z-index: 1000;
" "
) )
), ),
tabPanel("Global barplot", tabPanel("Global barplot",
withLoader(plotOutput("histo", height = 700)), withLoader(plotOutput("histo", height = 700)),
uiOutput("histUI")), uiOutput("histUI")),
tabPanel( tabPanel(
"Filtered barplot", "Filtered barplot",
withLoader(plotOutput("histoFocus", height = 700)), withLoader(plotOutput("histoFocus", height = 700)),
box( box(
title = "Paramètres", title = "Paramètres",
width = NULL, width = NULL,
status = "primary", status = "primary",
uiOutput("histFocusUIfocusRank"), uiOutput("histFocusUIfocusRank"),
uiOutput("histFocusUIfocusTaxa"), uiOutput("histFocusUIfocusTaxa"),
uiOutput("histFocusUIfocusNbTaxa"), uiOutput("histFocusUIfocusNbTaxa"),
uiOutput("histFocusUIfocusGrid"), uiOutput("histFocusUIfocusGrid"),
uiOutput("histFocusUIfocusX") uiOutput("histFocusUIfocusX")
) )
), ),
tabPanel("Heatmap", tabPanel("Heatmap",
withLoader(plotOutput("Heatmap", height = 700)), withLoader(plotOutput("Heatmap", height = 700)),
uiOutput("HeatmapUI")), uiOutput("HeatmapUI")),
tabPanel( tabPanel(
"Rarefaction curves", "Rarefaction curves",
withLoader(plotOutput("rarefactionCurve", height = 700)), withLoader(plotOutput("rarefactionCurve", height = 700)),
uiOutput("rarefactionCurveUI") uiOutput("rarefactionCurveUI")
), ),
tabPanel(HTML("&alpha;-diversity"), tabPanel(HTML("&alpha;-diversity"),
box( box(
width = NULL, tabsetPanel( width = NULL, tabsetPanel(
tabPanel("Plots", tabPanel("Plots",
withLoader(plotOutput( withLoader(plotOutput(
"richnessA", height = 700 "richnessA", height = 700
)), )),
uiOutput("richnessAUI")), uiOutput("richnessAUI")),
tabPanel("Tables", withLoader(uiOutput("richnessATable"))) tabPanel("Tables", withLoader(uiOutput("richnessATable")))
) )
)), )),
tabPanel( tabPanel(
HTML("&beta;-diversity"), HTML("&beta;-diversity"),
selectInput( selectInput(
"richnessBDist", "richnessBDist",
label = "Distance : ", label = "Distance : ",
choices = list( choices = list(
"bray", "bray",
"jaccard", "jaccard",
"unifrac", "unifrac",
"wunifrac", "wunifrac",
"dpcoa", "dpcoa",
"jsd", "jsd",
"euclidean" "euclidean"
) )
), ),
box(width = NULL, tabsetPanel( box(width = NULL, tabsetPanel(
tabPanel("Heatmap", tabPanel("Heatmap",
withLoader(plotOutput( withLoader(plotOutput(
"richnessB", height = 700 "richnessB", height = 700
)), )),
uiOutput("richnessBUI")), uiOutput("richnessBUI")),
tabPanel("Networks", tabPanel("Networks",
withLoader(plotOutput("networkB", height = 700)), withLoader(plotOutput("networkB", height = 700)),
uiOutput("networkBUI")), uiOutput("networkBUI")),
tabPanel("Tables", withLoader(uiOutput("richnessBTable"))) tabPanel("Tables", withLoader(uiOutput("richnessBTable")))
)) ))
), ),
tabPanel( tabPanel(
"MultiDimensional Scaling", "MultiDimensional Scaling",
withLoader(plotOutput("acp", height = 700)), withLoader(plotOutput("acp", height = 700)),
uiOutput("acpUI") uiOutput("acpUI")
), ),
tabPanel( tabPanel(
"Phylogenetic tree", "Phylogenetic tree",
withLoader(plotOutput("tree", height = 700)), withLoader(plotOutput("tree", height = 700)),
uiOutput("treeUI") uiOutput("treeUI")
), ),
tabPanel("Clustering", tabPanel("Clustering",
withLoader(plotOutput("clust", height = 700)), withLoader(plotOutput("clust", height = 700)),
uiOutput("clustUI")), uiOutput("clustUI")),
tabPanel("Help", tabPanel("Help",
div( div(
HTML( HTML(
"<p> "<p>
Questions, problems or comments regarding this application should be sent to Questions, problems or comments regarding this application should be sent to
<a href = \"mailto:cedric.midoux@irstea.fr?subject=[Easy16S]\">cedric.midoux@irstea.fr</a> <a href = \"mailto:cedric.midoux@irstea.fr?subject=[Easy16S]\">cedric.midoux@irstea.fr</a>
</p> </p>
<p> <p>
For more information about this tool, you can refer to For more information about this tool, you can refer to
<a href = \"http://migale.jouy.inra.fr/sites/migale.jouy.inra.fr.drupal7.migale.jouy.inra.fr/files/JOBIM2018_poster.pdf\">this poster</a>. <a href = \"http://migale.jouy.inra.fr/sites/migale.jouy.inra.fr.drupal7.migale.jouy.inra.fr/files/JOBIM2018_poster.pdf\">this poster</a>.
</p> </p>
<p> <p>
<u>The demo dataset :</u> Chaillou, S., et al. \" <u>The demo dataset :</u> Chaillou, S., et al. \"
<a href = \"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4409155/\"> <a href = \"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4409155/\">
Origin and ecological selection of core and food-specific bacterial communities associated with meat and seafood spoilage.</a>\" Origin and ecological selection of core and food-specific bacterial communities associated with meat and seafood spoilage.</a>\"
<i>The ISME journal</i> 9.5 (2015): 1105. <i>The ISME journal</i> 9.5 (2015): 1105.
<br> <br>
16S survey of bacterial communities from 8 different food products, distributed as 4 meat products and 4 seafoods. Used to find core microbiota of food products. 16S survey of bacterial communities from 8 different food products, distributed as 4 meat products and 4 seafoods. Used to find core microbiota of food products.
</p> </p>
<br> <br>
<p align=\"center\" position=\"absolute\" bottom\"80px\"> <p align=\"center\" position=\"absolute\" bottom\"80px\">
<img src=\"migale.png\" width=\"100\"/> <img src=\"migale.png\" width=\"100\"/>
<img src=\"Irstea.png\" width=\"100\"/> <img src=\"Irstea.png\" width=\"100\"/>
</p> </p>
" "
) )
)) ))
) )
) )
)) ))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment