Commit cb598727 authored by Thomas Schwarzl's avatar Thomas Schwarzl

added xlsx download function for selected data #4

parent 82c5198d
Pipeline #14653 passed with stage
in 17 minutes and 34 seconds
......@@ -2,7 +2,7 @@ FROM rocker/shiny:3.6.3
RUN apt-get install -y libssl-dev libxml2-dev
RUN R -e "install.packages(c('shiny', 'tidyverse', 'shinyjqui', 'shinyjs', 'shinyWidgets', 'shinythemes', 'pheatmap', 'UpSetR', 'ggExtra', 'DT', 'purrr'))"
RUN R -e "install.packages(c('shiny', 'tidyverse', 'shinyjqui', 'shinyjs', 'shinyWidgets', 'shinythemes', 'pheatmap', 'UpSetR', 'ggExtra', 'DT', 'purrr', 'openxlsx'))"
#RUN R -e "install.packages(c('dplyr'))"
#RUN R -e "remove.packages("tidyverse")"
#RUN R -e "install.packages(tidyverse)"
......
......@@ -14,6 +14,7 @@ require(shinyWidgets)
require(shinythemes)
require(tidyverse)
require(DT)
require(openxlsx)
#require(pheatmap)
#require(UpSetR)
require(ggExtra)
......@@ -179,9 +180,13 @@ rowFilterButton <- dropdownButton(
downloadButton <- dropdownButton(
column(5, class = "downloadbox",
tags$span("Download selected table:"), tags$br(),
downloadLink("downloadRBPTableCSV", "comma separate file (.csv)"),tags$br(),
downloadLink("downloadRBPTableTSV", "tab delimited (.tsv)"), tags$br(),
actionLink("link_to_download", "R objects (Rdata)")
downloadLink("downloadRBPTableXLSX", "excel with meta info (.xlsx)"), tags$br(),
tags$br(),
tags$span("Download all data:"), tags$br(),
actionLink("link_to_download", "Rdata objects or xlsx tables")
),
circle = TRUE,
status = "danger",
......@@ -716,6 +721,30 @@ server <- function(input, output, session) {
}
)
# downloader
output$downloadRBPTableXLSX <- downloadHandler(
filename = function() {
paste0("RBPbase_Download_", Sys.Date() , ".xlsx")
},
content = function(file) {
wb <- createWorkbook()
addWorksheet(wb, "RBPTable")
writeData(wb, "RBPTable", DownloadSelectedRBPTable())
addWorksheet(wb, "Studies")
writeData(wb, "Studies", RIC_STUDIES %>% filter(RBPBASEID %in% colnames(SelectedRBPTable())))
addWorksheet(wb, "Annotation")
writeData(wb, "Annotation", ANNO_STUDIES %>% filter(RBPBASEID %in% colnames(SelectedRBPTable())))
## Save workbook to working directory
saveWorkbook(wb, file = file, overwrite = TRUE)
}
)
# downloader
output$downloadFilterTSV <- downloadHandler(
......
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