-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserver-rundeseq2.R
34 lines (31 loc) · 1 KB
/
server-rundeseq2.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
#eventReactive
output$SelectFactor<- renderUI({
sampleTable <- load_sampleData()
factors <- colnames(sampleTable)[-c(1)]
factors <- c(factors, 1)
selectInput("SelectFactor","Select factor", factors)
})
formula <- eventReactive(input$SelectFactor,{
(paste('~',input$SelectFactor))
})
output$summary <- renderText({
req(formula())
input$SelectFactor
})
Deseq2_object <- eventReactive(input$action1, {
withCallingHandlers({ #magic code to run deseq2 and print updates
shinyjs::html("text", "") #magic code to run deseq2 and print updates
dds<-DESeqDataSetFromMatrix(countData = load_countMatrix(),
colData = load_sampleData(),
design = as.formula(formula()))
dds<- DESeq(dds)
},
message = function(m) {
shinyjs::html(id = "text", html =paste0(m$message, '<br>'), add = TRUE) #magic code to run deseq2 and print updates
})
})
#Display dds
output$Deseq2_object <- renderTable({
x <- colData(Deseq2_object())
as_tibble(x)
})