Commit 49b2af41 authored by mahendra-mariadassou's avatar mahendra-mariadassou
Browse files

Merge branch 'master' of forgemia.inra.fr:migale/affiliationexplorer

parents f80803a2 5c182bbe
......@@ -12,12 +12,14 @@ app_server <- function(input, output, session) {
# List the first level callModules here
shinyjs::hide("clean")
shinyjs::hide("skip")
shinyjs::hide("download")
output$tmptxt <- renderUI("Please upload your data (Biom file and MultiHits TSV file).")
output$tmptxt <- renderUI(HTML("<p>Please upload your data (Biom file and MultiHits TSV file).</p>"))
observeEvent(input$tsv, {
shinyjs::show("clean")
shinyjs::show("skip")
shinyjs::show("download")
output$tmptxt <- renderUI("")
......@@ -52,7 +54,7 @@ app_server <- function(input, output, session) {
# Extract Affiliation for a given OTU
data$affi <- extract_affiliation(affi, input$asv) %>% dplyr::distinct()
amb <- find_level(data$affi)
output$txt <- renderUI({paste(input$asv, "- ", nrow(data$affi) ,"conflicting affiliation, ambiguity at rank ", amb)})
output$txt <- renderUI(HTML({paste("<p><b>", input$asv, "- ", nrow(data$affi) ,"conflicting affiliation, ambiguity at rank ", amb, "</b></p>")}))
output$table <- DT::renderDT({data$affi},
selection = list(mode = 'single', selected = NULL, target = 'row'),
editable = TRUE)
......@@ -60,12 +62,12 @@ app_server <- function(input, output, session) {
output$selection <- renderUI({
s = input$table_rows_selected
if (length(s)) {
paste(
"Current affiliation:",
paste(data$cleaned[input$asv, ], collapse = ';'),
"to be replaced with:",
paste(data$affi[s, ], collapse = ';'),
sep = "\n")
HTML(paste("<b>Current affiliation:</b><br/>&nbsp;&nbsp;&nbsp;"),
paste(data$cleaned[input$asv, ], collapse = ' / '),
"<br/><b>to be replaced with:</b><br/>&nbsp;&nbsp;&nbsp;",
paste(data$affi[s, ], collapse = ' / ')
)
}
})
})
......@@ -88,7 +90,21 @@ app_server <- function(input, output, session) {
selected = data$amb_otus[1]
)
}
})
}
)
## Skip ASV
observeEvent(input$skip, {
data$amb_otus <- setdiff(data$amb_otus, input$asv)
updateSelectInput(session, "asv",
label = "Select ASV",
choices = data$amb_otus,
selected = data$amb_otus[1]
)
}
)
output$download <- downloadHandler(
filename = function() {
......
......@@ -37,10 +37,11 @@ app_ui <- function() {
htmlOutput("txt"),
HTML("<br/>"),
DT::DTOutput("table"),
HTML("<br/>"),
#HTML("<br/>"),
htmlOutput("selection"),
HTML("<br/>"),
actionButton("clean", "Clean ASV"),
actionButton("skip", "Skip ASV"),
downloadButton("download", "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