-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathidentify_reference.R
38 lines (29 loc) · 1.12 KB
/
identify_reference.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Function for module UI
identify_reference_UI <- function(id) {
ns <- NS(id)
fluidRow(
column(12, textInput(ns("ref_idf_str"),
"Input common text string to identify Reference/Common Sample among plates.",
placeholder = NULL)),
column(12, DT::DTOutput(ns("ref_sample_summary")))
)
}
# Function for module server logic
identify_reference <- function(input, output, session, values) {
#observeEvent(input$ref_idf_str,{
# req(input$ref_idf_str)
# values$ref_sample_identifier <- input$ref_idf_str
#})
output$ref_sample_summary <- DT::renderDT({
req(input$ref_idf_str)
lapply(strsplit(input$ref_idf_str, split = ",")%>%unlist(), function(x){
bdg_ls <- pull_bdg(values$upload_data, pattern = x)
data.frame(filename = names(bdg_ls),
identifier = x,
total_samples = sapply(bdg_ls, function(x) ncol(x)) %>% unlist(),
details = sapply(bdg_ls, function(x) paste(x$Assay, collapse = ",")) %>% unlist())
})%>%
do.call(what = "rbind")%>%
DT::datatable(rownames = NULL)
})
}