forked from Ulas-lab/Shiny-Seq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gene_count_module.R
36 lines (28 loc) · 919 Bytes
/
gene_count_module.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
gene_count_module_UI<-function(id)
{
ns<-NS(id)
tagList(
uiOutput(ns("plot_option_gene_n")),
downloadButton(ns('download_gene_plot'), 'Download plot'),
plotOutput(ns("gene_plot"))
)
}
gene_count_module<-function(input,output,session,dataset,dds.fc,gene_name)
{
output$plot_option_gene_n<-renderUI({
radioButtons(session$ns("plotType_gene_n"), "use log scale?:", choices = c("Yes", "No"),selected = "Yes")
})
geneplot<-reactive({
req(input$plotType_gene_n)
gene_counts(dataset,dds.fc(),gene_name(),input$plotType_gene_n)
})
output$gene_plot<-renderPlot({
geneplot()
})
#download boxplot for batch corrected table
output$download_gene_plot <- downloadHandler(
filename = paste(" Gene counts of ",gene_name()," normalized.svg"),
content = function(file) {
ggsave(file, geneplot(), height = 10, width = 20, units = "cm")
})
}