Commit de81072a authored by Midoux Cedric's avatar Midoux Cedric

filter samples

parent 34260c1d
...@@ -163,6 +163,35 @@ observeEvent(input$okData, { ...@@ -163,6 +163,35 @@ observeEvent(input$okData, {
} }
}) })
filterSample <- function() {
modalDialog(
title = "Select some sample",
size = "m",
checkboxGroupInput(inputId = "checkSamples",
label = "Sample to keep :",
choices = sample_names(physeq()),
#selected = sample_names(physeq()),
inline = TRUE),
footer = tagList(modalButton("Cancel"),
actionButton(inputId = "okData", label = "Refresh filter"),
actionButton(inputId = "selectData", label = "Select")
)
)
}
observeEvent(input$selectData, {
if(is.null(input$checkSamples)) {showModal(dataInput(failed = TRUE))}
try(
physeq(prune_samples(samples = input$checkSamples, physeq())),
silent = TRUE,
outFile = showModal(dataInput(failed = TRUE)))
if (class(physeq()) == "phyloseq") {
removeModal()
} else {
showModal(dataInput(failed = TRUE))
}
})
dataDownload <- function() { dataDownload <- function() {
modalDialog( modalDialog(
title = "Download data", title = "Download data",
......
...@@ -34,6 +34,10 @@ shinyServer ...@@ -34,6 +34,10 @@ shinyServer
showModal(dataInput()) showModal(dataInput())
}) })
observeEvent(input$filterButton, {
showModal(filterSample())
})
observeEvent(input$downloadButton, { observeEvent(input$downloadButton, {
showModal(dataDownload()) showModal(dataDownload())
}) })
......
...@@ -20,6 +20,10 @@ dashboardHeader(title = "Easy16S"), ...@@ -20,6 +20,10 @@ dashboardHeader(title = "Easy16S"),
"Select your data", "Select your data",
icon = icon("upload"), icon = icon("upload"),
style = "width: 80% ; color: black ; background-color: gray90"), style = "width: 80% ; color: black ; background-color: gray90"),
actionButton("filterButton",
"Select some samples",
icon = icon("filter"),
style = "width: 80% ; color: black ; background-color: gray90"),
actionButton("downloadButton", actionButton("downloadButton",
"Download data", "Download data",
icon = icon("download"), icon = icon("download"),
......
Markdown is supported
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