Commit 83c268c8 authored by Midoux Cedric's avatar Midoux Cedric
Browse files

english

parent 14bb24f6
...@@ -27,7 +27,7 @@ shinyServer ...@@ -27,7 +27,7 @@ shinyServer
options = list( options = list(
dom = "lBtip", dom = "lBtip",
pageLength = 10, pageLength = 10,
lengthMenu = list(c(10, 25, 50, 100, -1), list('10', '25', '50', '100', 'All')), lengthMenu = list(c(10, 25, 50, 100,-1), list('10', '25', '50', '100', 'All')),
buttons = list( buttons = list(
'colvis', 'colvis',
list( list(
...@@ -45,9 +45,9 @@ shinyServer ...@@ -45,9 +45,9 @@ shinyServer
) )
} }
source( source({
"https://raw.githubusercontent.com/mahendra-mariadassou/phyloseq-extended/master/R/load-extra-functions.R" "https://raw.githubusercontent.com/mahendra-mariadassou/phyloseq-extended/master/R/load-extra-functions.R"
) })
data16S <- reactive({ data16S <- reactive({
if (input$demo != "input") if (input$demo != "input")
...@@ -122,6 +122,7 @@ shinyServer ...@@ -122,6 +122,7 @@ shinyServer
output$rarefactionMin <- renderText({ output$rarefactionMin <- renderText({
validate(need(input$fileBiom, ""), need(input$demo == "input", "")) validate(need(input$fileBiom, ""), need(input$demo == "input", ""))
paste("(min sample =", format(min(sample_sums(data16S( paste("(min sample =", format(min(sample_sums(data16S(
))), big.mark = " "), "reads)") ))), big.mark = " "), "reads)")
}) })
...@@ -129,7 +130,7 @@ shinyServer ...@@ -129,7 +130,7 @@ shinyServer
validate( validate(
need( need(
data16S(), data16S(),
"Merci de commencer par importer un fichier d'abondance au format BIOM. Celui-ci peut etre obtenu a l'issue du workflow FROGS avec l'operation 'FROGS BIOM to std BIOM'.\nVous pouvez egalement choisir un dataset de demo" "Firsly, you should select a demo dataset or upload an abundance BIOM file.\nFor example, with Galaxy, this one can be obtained at the end of FROGS workflows with 'FROGS BIOM to std BIOM' tools"
) )
) )
data16S() data16S()
...@@ -151,6 +152,7 @@ shinyServer ...@@ -151,6 +152,7 @@ shinyServer
data.frame(OTU = taxa_names(data16S()), tax_table(data16S())) data.frame(OTU = taxa_names(data16S()), tax_table(data16S()))
)), )),
tabPanel("sample_data", tabPanel("sample_data",
#as.data.frame(sapply(sample_data(data16S()), class)),
beautifulTable( beautifulTable(
data.frame(SAMPLE = sample_names(data16S()), sample_data(data16S())) data.frame(SAMPLE = sample_names(data16S()), sample_data(data16S()))
)) ))
...@@ -161,23 +163,24 @@ shinyServer ...@@ -161,23 +163,24 @@ shinyServer
output$histUI <- renderUI({ output$histUI <- renderUI({
validate(need(data16S(), "")) validate(need(data16S(), ""))
box( box(
title = "Paramètres", title = "Setting : ",
width = NULL, width = NULL,
status = "primary", status = "primary",
selectInput( radioButtons(
"barFill", "barFill",
label = "Niveau taxo :", label = "Taxonomic rank : ",
choices = rank_names(data16S()) choices = rank_names(data16S()),
inline = TRUE
), ),
selectInput( selectInput(
"barGrid", "barGrid",
label = "Regroupement :", label = "Subplot : ",
choices = c("..." = 0, sample_variables(data16S())) choices = c("..." = 0, sample_variables(data16S()))
) )
, ,
selectInput( selectInput(
"barX", "barX",
label = "X :", label = "X : ",
choices = c("..." = 0, sample_variables(data16S())) choices = c("..." = 0, sample_variables(data16S()))
) )
) )
...@@ -185,7 +188,7 @@ shinyServer ...@@ -185,7 +188,7 @@ shinyServer
output$histo <- renderPlot({ output$histo <- renderPlot({
validate(need(data16S(), validate(need(data16S(),
"Merci d'importer un fichier d'abondance")) "Need an abundance dataset"))
p <- plot_bar( p <- plot_bar(
physeq = data16S(), physeq = data16S(),
fill = input$barFill, fill = input$barFill,
...@@ -202,7 +205,7 @@ shinyServer ...@@ -202,7 +205,7 @@ shinyServer
validate(need(data16S(), "")) validate(need(data16S(), ""))
radioButtons( radioButtons(
"focusRank", "focusRank",
label = "Niveau taxo :", label = "Taxonomic rank : ",
choices = rank_names(data16S())[-length(rank_names(data16S()))], choices = rank_names(data16S())[-length(rank_names(data16S()))],
inline = TRUE inline = TRUE
) )
...@@ -212,7 +215,7 @@ shinyServer ...@@ -212,7 +215,7 @@ shinyServer
validate(need(data16S(), "")) validate(need(data16S(), ""))
selectInput( selectInput(
"focusTaxa", "focusTaxa",
label = "Taxa :", label = "Selected taxa : ",
choices = unique(as.vector(tax_table(data16S( choices = unique(as.vector(tax_table(data16S(
))[, input$focusRank])), ))[, input$focusRank])),
...@@ -224,11 +227,10 @@ shinyServer ...@@ -224,11 +227,10 @@ shinyServer
validate(need(data16S(), "")) validate(need(data16S(), ""))
sliderInput( sliderInput(
"focusNbTaxa", "focusNbTaxa",
label = "Nombre de sous-taxons :", label = "Number of sub-taxa : ",
min = 0, min = 0,
#max = sum(tax_table(tax_glom(data16S(), rank_names(data16S())[1+as.integer(input$focusRank)]))[, as.integer(input$focusRank)]==input$focusTaxa) #max = sum(tax_table(tax_glom(data16S(), rank_names(data16S())[1+as.integer(input$focusRank)]))[, as.integer(input$focusRank)]==input$focusTaxa)
max = 30 max = 30,
,
value = 10 value = 10
) )
}) })
...@@ -236,20 +238,20 @@ shinyServer ...@@ -236,20 +238,20 @@ shinyServer
output$histFocusUIfocusGrid <- renderUI({ output$histFocusUIfocusGrid <- renderUI({
validate(need(data16S(), "")) validate(need(data16S(), ""))
selectInput("focusGrid", selectInput("focusGrid",
label = "Regroupement :", label = "Subplot : ",
choices = c("..." = 0, sample_variables(data16S()))) choices = c("..." = 0, sample_variables(data16S())))
}) })
output$histFocusUIfocusX <- renderUI({ output$histFocusUIfocusX <- renderUI({
validate(need(data16S(), "")) validate(need(data16S(), ""))
selectInput("focusX", selectInput("focusX",
label = "X :", label = "X : ",
choices = c("..." = 0, sample_variables(data16S()))) choices = c("..." = 0, sample_variables(data16S())))
}) })
output$histoFocus <- renderPlot({ output$histoFocus <- renderPlot({
validate(need(data16S(), validate(need(data16S(),
"Merci d'importer un fichier d'abondance")) "Need an abundance dataset"))
p <- plot_composition( p <- plot_composition(
physeq = data16S(), physeq = data16S(),
taxaRank1 = input$focusRank, taxaRank1 = input$focusRank,
...@@ -269,12 +271,12 @@ shinyServer ...@@ -269,12 +271,12 @@ shinyServer
output$clustUI <- renderUI({ output$clustUI <- renderUI({
validate(need(data16S(), "")) validate(need(data16S(), ""))
box( box(
title = "Paramètres", title = "Setting : " ,
width = NULL, width = NULL,
status = "primary", status = "primary",
selectInput( selectInput(
"clustDist", "clustDist",
label = "Distance :", label = "Distance : ",
choices = list( choices = list(
"bray", "bray",
"jaccard", "jaccard",
...@@ -287,7 +289,7 @@ shinyServer ...@@ -287,7 +289,7 @@ shinyServer
), ),
selectInput( selectInput(
"clustMethod", "clustMethod",
label = "Methode :", label = "Method : ",
choices = list( choices = list(
"ward.D2", "ward.D2",
"ward.D", "ward.D",
...@@ -301,7 +303,7 @@ shinyServer ...@@ -301,7 +303,7 @@ shinyServer
), ),
selectInput( selectInput(
"clustCol", "clustCol",
label = "Couleur :", label = "Color : ",
choices = c("..." = 0, sample_variables(data16S())) choices = c("..." = 0, sample_variables(data16S()))
) )
) )
...@@ -309,7 +311,7 @@ shinyServer ...@@ -309,7 +311,7 @@ shinyServer
output$clust <- renderPlot({ output$clust <- renderPlot({
validate(need(data16S(), validate(need(data16S(),
"Merci d'importer un fichier d'abondance")) "Need an abundance dataset"))
plot_clust( plot_clust(
physeq = data16S(), physeq = data16S(),
dist = input$clustDist, dist = input$clustDist,
...@@ -321,12 +323,12 @@ shinyServer ...@@ -321,12 +323,12 @@ shinyServer
output$richnessAUI <- renderUI({ output$richnessAUI <- renderUI({
validate(need(data16S(), "")) validate(need(data16S(), ""))
box( box(
title = "Paramètres", title = "Setting : " ,
width = NULL, width = NULL,
status = "primary", status = "primary",
checkboxGroupInput( checkboxGroupInput(
"richnessMeasures", "richnessMeasures",
label = "Mesures :", label = "Measures : ",
choices = c( choices = c(
"Observed", "Observed",
"Chao1", "Chao1",
...@@ -349,26 +351,26 @@ shinyServer ...@@ -349,26 +351,26 @@ shinyServer
), ),
selectInput( selectInput(
"richnessX", "richnessX",
label = "X :", label = "X : ",
choices = c("..." = 0, sample_variables(data16S())) choices = c("..." = 0, sample_variables(data16S()))
), ),
selectInput( selectInput(
"richnessColor", "richnessColor",
label = "Couleur :", label = "Color : ",
choices = c("..." = 0, sample_variables(data16S())) choices = c("..." = 0, sample_variables(data16S()))
), ),
selectInput( selectInput(
"richnessShape", "richnessShape",
label = "Forme :", label = "Shape : ",
choices = c("..." = 0, sample_variables(data16S())) choices = c("..." = 0, sample_variables(data16S()))
), ),
radioButtons( radioButtons(
"richnessBoxplot", "richnessBoxplot",
label = "Representation :", label = "Representation : ",
choices = list( choices = list(
"Points seuls" = 1, "Dots only" = 1,
"Boxplot et points" = 2, "Dots and boxplot" = 2,
"Boxplot seul" = 3 "Boxplot only" = 3
), ),
selected = 2, selected = 2,
inline = TRUE inline = TRUE
...@@ -378,7 +380,7 @@ shinyServer ...@@ -378,7 +380,7 @@ shinyServer
output$richnessA <- renderPlot({ output$richnessA <- renderPlot({
validate(need(data16S(), validate(need(data16S(),
"Merci d'importer un fichier d'abondance")) "Need an abundance dataset"))
p <- plot_richness( p <- plot_richness(
physeq = data16S(), physeq = data16S(),
x = ifelse(is.null(checkNull( x = ifelse(is.null(checkNull(
...@@ -399,7 +401,7 @@ shinyServer ...@@ -399,7 +401,7 @@ shinyServer
output$richnessATable <- renderUI({ output$richnessATable <- renderUI({
validate(need(data16S(), validate(need(data16S(),
"Merci d'importer un fichier d'abondance")) "Need an abundance dataset"))
p(beautifulTable(data.frame( p(beautifulTable(data.frame(
SAMPLE = sample_names(data16S()), round(estimate_richness(data16S()), digits = 2) SAMPLE = sample_names(data16S()), round(estimate_richness(data16S()), digits = 2)
))) )))
...@@ -407,12 +409,12 @@ shinyServer ...@@ -407,12 +409,12 @@ shinyServer
output$richnessBUI <- renderUI({ output$richnessBUI <- renderUI({
box( box(
title = "Paramètres", title = "Setting : " ,
width = NULL, width = NULL,
status = "primary", status = "primary",
selectInput( selectInput(
"richnessOrder", "richnessOrder",
label = "Ordre de tri des echantillons :", label = "Sorting sample : ",
choices = c("..." = 0, sample_variables(data16S())) choices = c("..." = 0, sample_variables(data16S()))
) )
) )
...@@ -420,7 +422,7 @@ shinyServer ...@@ -420,7 +422,7 @@ shinyServer
output$richnessB <- renderPlot({ output$richnessB <- renderPlot({
validate(need(data16S(), validate(need(data16S(),
"Merci d'importer un fichier d'abondance")) "Need an abundance dataset"))
beta <- beta <-
melt(as(distance(data16S(), method = input$richnessBDist), "matrix")) melt(as(distance(data16S(), method = input$richnessBDist), "matrix"))
colnames(beta) <- c("x", "y", "distance") colnames(beta) <- c("x", "y", "distance")
...@@ -454,32 +456,32 @@ shinyServer ...@@ -454,32 +456,32 @@ shinyServer
output$networkBUI <- renderUI({ output$networkBUI <- renderUI({
validate(need(data16S(), "")) validate(need(data16S(), ""))
box( box(
title = "Paramètres", title = "Setting : " ,
width = NULL, width = NULL,
status = "primary", status = "primary",
sliderInput( sliderInput(
"netwMax", "netwMax",
label = "Cutoff :", label = "Threshold : ",
min = 0, min = 0,
max = 1, max = 1,
value = 0.7 value = 0.7
), ),
checkboxInput("netwOrphan", checkboxInput("netwOrphan",
label = "Garder les points orphelins", label = "Keep orphans",
value = TRUE), value = TRUE),
selectInput( selectInput(
"netwCol", "netwCol",
label = "Couleur :", label = "Color : ",
choices = c("..." = 0, sample_variables(data16S())) choices = c("..." = 0, sample_variables(data16S()))
), ),
selectInput( selectInput(
"netwShape", "netwShape",
label = "Forme :", label = "Shape : ",
choices = c("..." = 0, sample_variables(data16S())) choices = c("..." = 0, sample_variables(data16S()))
), ),
selectInput( selectInput(
"netwLabel", "netwLabel",
label = "Label :", label = "Label : ",
choices = c( choices = c(
"..." = 0, "..." = 0,
"Sample name" = "value", "Sample name" = "value",
...@@ -491,7 +493,7 @@ shinyServer ...@@ -491,7 +493,7 @@ shinyServer
output$networkB <- renderPlot({ output$networkB <- renderPlot({
validate(need(data16S(), validate(need(data16S(),
"Merci d'importer un fichier d'abondance")) "Need an abundance dataset"))
g <- make_network( g <- make_network(
data16S(), data16S(),
distance = input$richnessBDist, distance = input$richnessBDist,
...@@ -512,7 +514,7 @@ shinyServer ...@@ -512,7 +514,7 @@ shinyServer
output$richnessBTable <- renderUI({ output$richnessBTable <- renderUI({
validate(need(data16S(), validate(need(data16S(),
"Merci d'importer un fichier d'abondance")) "Need an abundance dataset"))
p(beautifulTable(data.frame( p(beautifulTable(data.frame(
SAMPLE = sample_names(data16S()), round(as.matrix( SAMPLE = sample_names(data16S()), round(as.matrix(
distance(data16S(), method = input$richnessBDist) distance(data16S(), method = input$richnessBDist)
...@@ -522,7 +524,7 @@ shinyServer ...@@ -522,7 +524,7 @@ shinyServer
output$rarefactionCurve <- renderPlot({ output$rarefactionCurve <- renderPlot({
validate(need(data16S(), validate(need(data16S(),
"Merci d'importer un fichier d'abondance")) "Need an abundance dataset"))
p <- ggrare( p <- ggrare(
physeq = data16S(), physeq = data16S(),
step = 100, step = 100,
...@@ -546,25 +548,25 @@ shinyServer ...@@ -546,25 +548,25 @@ shinyServer
output$rarefactionCurveUI <- renderUI({ output$rarefactionCurveUI <- renderUI({
validate(need(data16S(), "")) validate(need(data16S(), ""))
box( box(
title = "Paramètres", title = "Setting : " ,
width = NULL, width = NULL,
status = "primary", status = "primary",
# sliderInput( # sliderInput(
# "rarefactionStep", # "rarefactionStep",
# label = "Etapes de calcul :", # label = "Etapes de calcul : ",
# min = 1, # min = 1,
# max = 1000, # max = 1000,
# value = 100 # value = 100
# ), # ),
checkboxInput("rarefactionMin", label = "Afficher le seuil de l'echantillon minimal", value = FALSE), checkboxInput("rarefactionMin", label = "Show min sample threshold", value = FALSE),
selectInput( selectInput(
"rarefactionColor", "rarefactionColor",
label = "Couleur :", label = "Color : ",
choices = c("..." = 0, sample_variables(data16S())) choices = c("..." = 0, sample_variables(data16S()))
), ),
selectInput( selectInput(
"rarefactionGrid", "rarefactionGrid",
label = "Regroupement :", label = "Subplot : ",
choices = c("..." = 0, sample_variables(data16S())) choices = c("..." = 0, sample_variables(data16S()))
) )
) )
...@@ -573,29 +575,29 @@ shinyServer ...@@ -573,29 +575,29 @@ shinyServer
output$HeatmapUI <- renderUI({ output$HeatmapUI <- renderUI({
validate(need(data16S(), "")) validate(need(data16S(), ""))
box( box(
title = "Paramètres", title = "Setting : " ,
width = NULL, width = NULL,
status = "primary", status = "primary",
selectInput( selectInput(
"heatmapGrid", "heatmapGrid",
label = "Regroupement :", label = "Subplot : ",
choices = c("..." = 0, sample_variables(data16S())) choices = c("..." = 0, sample_variables(data16S()))
), ),
selectInput( selectInput(
"heatmapX", "heatmapX",
label = "X :", label = "X : ",
choices = c("..." = 0, sample_variables(data16S())) choices = c("..." = 0, sample_variables(data16S()))
), ),
sliderInput( sliderInput(
"heatmapTopOtu", "heatmapTopOtu",
label = "Selection des n OTU les plus abondant :", label = "Show the n most abundant OTU : ",
min = 1, min = 1,
max = ntaxa(data16S()), max = ntaxa(data16S()),
value = 250 value = 250
), ),
selectInput( selectInput(
"heatmapDist", "heatmapDist",
label = "Distance :", label = "Distance : ",
selected = "bray", selected = "bray",
choices = list( choices = list(
"bray", "bray",
...@@ -609,7 +611,7 @@ shinyServer ...@@ -609,7 +611,7 @@ shinyServer
), ),
selectInput( selectInput(
"heatmapMethod", "heatmapMethod",
label = "Methode :", label = "Method : ",
selected = "NMDS", selected = "NMDS",
choices = list( choices = list(
"NMDS", "NMDS",
...@@ -628,7 +630,7 @@ shinyServer ...@@ -628,7 +630,7 @@ shinyServer