Commit 4ce63864 authored by Midoux Cedric's avatar Midoux Cedric
Browse files

deseq bruhedPoints

parent 3cbc62de
......@@ -217,4 +217,41 @@ output$deseqTable <- renderDT({
height = "auto") %>%
formatSignif(columns = c("baseMean", "log2FoldChange", "lfcSE", "stat", "padj", "pvalue"), digits = 4) %>%
formatStyle(columns = "log2FoldChange", color = DT::styleInterval(0, c('red', 'green')))
})
\ No newline at end of file
})
output$deseqBrushed <- renderDT({
validate(
need(physeq(), "Requires an abundance dataset"),
need(class(get_variable(physeq(), input$deseqContrastVar)) == "numeric" ||
length(input$deseqContrastMod) == 2, "Requires a continuous design or a selection of two modalities for a discrete design."),
need(results(), "Invalid input."),
need(input$deseq_brush, "")
)
results() %>% mutate(evidence = -log10(padj),
evolution = case_when(
padj <= 0.05 & log2FoldChange < 0 ~ "Down",
padj <= 0.05 & log2FoldChange > 0 ~ "Up",
TRUE ~ "Not DA"
)) %>%
brushedPoints(brush = input$deseq_brush) %>%
#filter(padj <= 0.05) %>% ## Only significant OTUs
datatable(rownames = FALSE,
filter = "top",
extensions = c("Buttons", "ColReorder", "FixedColumns"),
options = list(dom = "Btlip",
pageLength = 10,
lengthMenu = list(c(10, 25, 50, 100, -1), list('10', '25', '50', '100', 'All')),
buttons = list('colvis',
list(extend = 'collection',
buttons = c('copy', 'csv', 'excel', 'pdf'),
text = 'Download')),
colReorder = TRUE,
scrollX = TRUE,
fixedColumns = list(leftColumns = 1, rightColumns = 0)
),
width = "auto",
height = "auto") %>%
formatSignif(columns = c("baseMean", "log2FoldChange", "lfcSE", "stat", "padj", "pvalue"), digits = 4) %>%
formatStyle(columns = "log2FoldChange", color = DT::styleInterval(c(-0.5, +0.5), c('red', 'black', 'green')))
})
deseq <- fluidPage(outputCodeButton(withLoader(plotOutput("deseq", height = 700))),
deseq <- fluidPage(outputCodeButton(withLoader(plotOutput("deseq", height = 700, brush = brushOpts(id = "deseq_brush")))),
box(
title = "Table of Brushed OTUs",
width = NULL,
status = "primary",
collapsible = TRUE,
collapsed = FALSE,
DT::DTOutput("deseqBrushed")),
box(
title = "Table of OTUs with significant effect",
width = NULL,
......
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