Commit e6af8667 authored by Sandra Derozier's avatar Sandra Derozier
Browse files

Update ASV List

parent 20b20eeb
......@@ -20,7 +20,12 @@ app_server <- function(input, output, session) {
dict <- all$otu_dictionary
affi <- all$affi
# Ambiguous ASVs and their affiliation
ambiguous_otu <- unique(affi$OTU) ## this probably needs to be reactive
ambiguous_otu <- unique(affi$OTU)
## Store cleaned otu as reactive values
otu <- reactiveValues(
cleaned = ambiguous_otu
)
# Add ASV Select Input
insertUI(
selector = "#tmp",
......@@ -52,22 +57,26 @@ app_server <- function(input, output, session) {
"Current affiliation:",
paste(old_affiliations[input$asv, ], collapse = ';'),
"to be replaced with:",
paste(data[s, ], collapse = ';'),
paste(data[s, ], collapse = ';'),
sep = "\n")
}
})
## Replace affiliation upon confirmation
observeEvent(input$clean, {
s = input$table_rows_selected
if (length(s)) {
## Update affiliations
affiliations$cleaned[input$asv, ] <- unlist(data[s, ])
## Update text (buggy, does not disappear when changing asv)
# output$selection <- renderUI({
# glue::glue("Updated affiliation of {input$asv} to\n",
# "{paste(affiliations$cleaned[input$asv, ], collapse = ';')}")
# })
# Update otu
otu$cleaned <- setdiff(otu$cleaned, input$asv)
updateSelectInput(session, "asv",
label = "Select ASV",
choices = otu$cleaned,
selected = tail(otu$cleaned, 1)
)
}
})
})
......
......@@ -11,4 +11,4 @@ golem::detach_all_attached()
golem::document_and_reload()
# Run the application
affiliationExplorer::run_app()
affiliationExplorer::run_app()
\ No newline at end of file
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