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

Various fixes

parent 0469ca5b
#' @import shiny #' @import shiny
#' @importFrom DT renderDT editData #' @importFrom DT renderDT editData
#' @importFrom phyloseq tax_table #' @importFrom phyloseq tax_table taxa_names taxa_sums
#' @importFrom phyloseq.extended write_phyloseq #' @importFrom phyloseq.extended write_phyloseq
#' @importFrom shinyjs hide show #' @importFrom shinyjs hide show
#' @importFrom dplyr distinct #' @importFrom dplyr distinct
#' @importFrom tidyverse stringr
app_server <- function(input, output, session) { app_server <- function(input, output, session) {
# Load package data in the session (for testing purpose) # Load package data in the session (for testing purpose)
# data("physeq", package = "affiliationExplorer") # data("physeq", package = "affiliationExplorer")
...@@ -59,11 +58,13 @@ app_server <- function(input, output, session) { ...@@ -59,11 +58,13 @@ app_server <- function(input, output, session) {
select = "#table", select = "#table",
where = "afterEnd", where = "afterEnd",
ui = checkboxInput("seq", ui = checkboxInput("seq",
label = "Sequence display", label = "Show sequence",
value = FALSE value = FALSE
) )
) )
### Page 1 UI elements -----------------------------------------------
observeEvent(input$asv, { observeEvent(input$asv, {
# Extract Affiliation for a given OTU # Extract Affiliation for a given OTU
data$affi <- extract_affiliation(affi, input$asv) data$affi <- extract_affiliation(affi, input$asv)
...@@ -103,7 +104,7 @@ app_server <- function(input, output, session) { ...@@ -103,7 +104,7 @@ app_server <- function(input, output, session) {
## Allow manual corrections ## Allow manual corrections
observeEvent(input$table_cell_edit, { observeEvent(input$table_cell_edit, {
data$affi <<- DT::editData(data$affi, input$table_cell_edit, "table") data$affi[,] <<- DT::editData(data$affi, input$table_cell_edit, "table")
}) })
## Replace affiliation upon confirmation ## Replace affiliation upon confirmation
...@@ -118,6 +119,10 @@ app_server <- function(input, output, session) { ...@@ -118,6 +119,10 @@ app_server <- function(input, output, session) {
choices = data$amb_otus, choices = data$amb_otus,
selected = data$amb_otus[1] selected = data$amb_otus[1]
) )
} else {
output$selection <- renderUI({
HTML(paste("Choose an affiliation before clicking on the \"Update ASV\" button"))
})
} }
} }
) )
......
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