Skip to content

Commit

Permalink
Merge pull request #54 from ipb-halle/fix/project_export
Browse files Browse the repository at this point in the history
Fix/project export
  • Loading branch information
sneumann authored Feb 26, 2020
2 parents 6e0fc54 + 3e41e23 commit 91d5774
Show file tree
Hide file tree
Showing 7 changed files with 1,275 additions and 1,240 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.Rproj.user
.Rhistory
.RData
.Ruserdata
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Depends:
shiny,
shinyBS,
shinyjs,
shinybusy,
DT,
colourpicker,
Matrix,
Expand All @@ -29,7 +30,7 @@ Suggests:
testthat
VignetteBuilder: knitr
Maintainer: Hendrik Treutler<[email protected]>
Description: DiffLogo is an easy-to-use tool for the discovery of regulated metabolite families.
Description: We present a novel approach for the untargeted discovery of metabolite families offering a bird's eye view of metabolic regulation in comparative metabolomics. We implemented the presented methodology in the easy-to-use web application MetFamily to enable the analysis of comprehensive metabolomics studies for all researchers worldwide.
License: GPL (>= 2)
biocViews: Software, Visualization
Collate:
Expand Down
2 changes: 2 additions & 0 deletions MetFamily/R/R_packages.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ library("DT")
library("colourpicker")
#install.packages("shinyBS")
library("shinyBS")
#install.packages("shinybusy")
library("shinybusy")

##############################################################################################################
## mass spectrometry
Expand Down
25 changes: 18 additions & 7 deletions MetFamily/app_files/server_functionsDownloads.R
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,12 @@ writeTable <- function(precursorSet, file){
#gz1 <- gzfile(description = file, open = "w")
#write.table(x = dataFrame, file = gz1, sep = "\t", row.names = FALSE, col.names = FALSE, quote = FALSE)
#close(gz1)
show_modal_spinner(spin="scaling-squares", text="\nMerging project files to csv. This can take several minutes!")
lines <- createExportMatrix(precursorSet)
gz1 <- gzfile(description = file, open = "w")
writeLines(text = lines, con = gz1)
close(gz1)
remove_modal_spinner()
}
## individual downloads
output$downloadGlobalMS2filteredPrecursors <- downloadHandler(
Expand Down Expand Up @@ -286,13 +288,22 @@ output$downloadSelectedPrecursors <- downloadHandler(
},
contentType = 'text/csv'
)
output$downloadAllPrecursors <- downloadHandler(
filename = function() {
createExportMatrixName()
},
content = function(file) {
precursorSet <- 1:dataList$numberOfPrecursors
writeTable(precursorSet = precursorSet, file = file)
#Obvserve button for exporting the project
observeEvent(input$prepareAllPrecursors, {
ExportMatrixName <<- createExportMatrixName()
precursorSet <- 1:dataList$numberOfPrecursors
writeTable(precursorSet = precursorSet, file = file.path(tempdir(),ExportMatrixName))
showModal(modalDialog(title = "Download", footer = NULL, size="s", fluidRow(column(12, p("Your download is ready."))),
fluidRow(column(3,downloadButton(outputId = "downloadAllpreparedPrecursors", label = "Download project"))),
))
})
#Serving the modal with the download button to download the project
output$downloadAllpreparedPrecursors <- downloadHandler(
filename <- ExportMatrixName,
content = function(file){
file.copy(file.path(tempdir(),ExportMatrixName), file)
file.remove(file.path(tempdir(),ExportMatrixName))
removeModal()
},
contentType = 'text/csv'
)
Expand Down
5 changes: 5 additions & 0 deletions MetFamily/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ sourceTheCode()
## server-side logic of the Shiny app
shinyServer(
func = function(input, output, session) {
show_modal_spinner(spin = "self-building-square", text="Loading libraries")
#########################################################################################
#########################################################################################
## global variables per user
Expand All @@ -123,6 +124,9 @@ shinyServer(
artifactColor <- "red"
selectionNone <- "None"

## Download names
ExportMatrixName <- NULL

## GUI constants
runRightColumnWidthFull <- 12
legendColumnWidthFull <- 2
Expand Down Expand Up @@ -214,6 +218,7 @@ shinyServer(
#########################################################################################
#########################################################################################
## observer
remove_modal_spinner() #Remove preparing message

## controls
obsTabs <- observeEvent(input$runTabs, {
Expand Down
Loading

0 comments on commit 91d5774

Please sign in to comment.