From 011292ad6f5b050dc6812478f92ed10c6a80a6ba Mon Sep 17 00:00:00 2001 From: anikde07 Date: Mon, 7 Oct 2024 13:12:53 +0200 Subject: [PATCH 1/2] Added svg option to file type choice --- program/shinyApp/R/enrichment_analysis/ui.R | 2 +- program/shinyApp/R/heatmap/ui.R | 2 +- program/shinyApp/R/pca/ui.R | 8 ++++---- program/shinyApp/R/pre_processing/ui.R | 2 +- program/shinyApp/R/sample_correlation/ui.R | 2 +- program/shinyApp/R/significance_analysis/ui.R | 2 +- program/shinyApp/R/single_gene_visualisation/ui.R | 2 +- program/shinyApp/ui.R | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/program/shinyApp/R/enrichment_analysis/ui.R b/program/shinyApp/R/enrichment_analysis/ui.R index 47140185..c7d8207b 100644 --- a/program/shinyApp/R/enrichment_analysis/ui.R +++ b/program/shinyApp/R/enrichment_analysis/ui.R @@ -48,7 +48,7 @@ geneset_panel_UI <- function( radioGroupButtons( inputId = ns("file_ext"), label = "File Type:", - choices = c(".png", ".tiff", ".pdf"), + choices = c(".png", ".tiff", ".pdf", ".svg"), selected = ".pdf" ) ), diff --git a/program/shinyApp/R/heatmap/ui.R b/program/shinyApp/R/heatmap/ui.R index 7438901e..9ea99c1e 100644 --- a/program/shinyApp/R/heatmap/ui.R +++ b/program/shinyApp/R/heatmap/ui.R @@ -156,7 +156,7 @@ heatmap_main <- function(ns){ radioGroupButtons( inputId = ns("file_ext_Heatmap"), label = "File Type:", - choices = c(".png", ".tiff", ".pdf"), + choices = c(".png", ".tiff", ".pdf", ".svg"), selected = ".png" ) ), diff --git a/program/shinyApp/R/pca/ui.R b/program/shinyApp/R/pca/ui.R index 9ac3835b..4de84c43 100644 --- a/program/shinyApp/R/pca/ui.R +++ b/program/shinyApp/R/pca/ui.R @@ -104,7 +104,7 @@ pca_main_panel <- function(ns){ radioGroupButtons( inputId = ns("file_ext_plot1"), label = "File Type:", - choices = c(".png", ".tiff", ".pdf"), + choices = c(".png", ".tiff", ".pdf", ".svg"), selected = ".png" ) ), @@ -183,7 +183,7 @@ pca_main_panel <- function(ns){ radioGroupButtons( inputId = ns("file_ext_Loadings"), label = "File Type:", - choices = c(".png", ".tiff", ".pdf"), + choices = c(".png", ".tiff", ".pdf", ".svg"), selected = ".png" ) ) @@ -245,7 +245,7 @@ pca_main_panel <- function(ns){ radioGroupButtons( inputId = ns("file_ext_Loadings_matrix"), label = "File Type:", - choices = c(".png", ".tiff", ".pdf"), + choices = c(".png", ".tiff", ".pdf", ".svg"), selected = ".png" ) ) @@ -295,7 +295,7 @@ pca_main_panel <- function(ns){ radioGroupButtons( inputId = ns("file_ext_Scree"), label = "File Type:", - choices = c(".png", ".tiff", ".pdf"), + choices = c(".png", ".tiff", ".pdf", ".svg"), selected = ".png" ) ) diff --git a/program/shinyApp/R/pre_processing/ui.R b/program/shinyApp/R/pre_processing/ui.R index 91c4e88f..88e84c05 100644 --- a/program/shinyApp/R/pre_processing/ui.R +++ b/program/shinyApp/R/pre_processing/ui.R @@ -86,7 +86,7 @@ pre_processing_main_panel <- mainPanel( radioGroupButtons( inputId = "file_ext_Preprocess", label = "File Type:", - choices = c(".png", ".tiff", ".pdf"), + choices = c(".png", ".tiff", ".pdf", ".svg"), selected = ".png" ) ), diff --git a/program/shinyApp/R/sample_correlation/ui.R b/program/shinyApp/R/sample_correlation/ui.R index 58d13633..abe0b9fc 100644 --- a/program/shinyApp/R/sample_correlation/ui.R +++ b/program/shinyApp/R/sample_correlation/ui.R @@ -68,7 +68,7 @@ sampleCorrelation_main_panel <- function(ns){ radioGroupButtons( inputId = ns("file_ext_SampleCorrelation"), label = "File Type:", - choices = c(".png", ".tiff", ".pdf"), + choices = c(".png", ".tiff", ".pdf", ".svg"), selected = ".png" ) ), diff --git a/program/shinyApp/R/significance_analysis/ui.R b/program/shinyApp/R/significance_analysis/ui.R index 171c1b5e..6b8f0e87 100644 --- a/program/shinyApp/R/significance_analysis/ui.R +++ b/program/shinyApp/R/significance_analysis/ui.R @@ -106,7 +106,7 @@ significance_analysis_main_ui <- function(ns){ radioGroupButtons( inputId = ns("file_ext_Sig"), label = "File Type:", - choices = c(".png", ".tiff", ".pdf"), + choices = c(".png", ".tiff", ".pdf", ".svg"), selected = ".png" ) ), diff --git a/program/shinyApp/R/single_gene_visualisation/ui.R b/program/shinyApp/R/single_gene_visualisation/ui.R index 491d29e6..0b66dc61 100644 --- a/program/shinyApp/R/single_gene_visualisation/ui.R +++ b/program/shinyApp/R/single_gene_visualisation/ui.R @@ -68,7 +68,7 @@ single_gene_visualisation_main_ui <- function(ns){ radioGroupButtons( inputId = ns("file_ext_singleGene"), label = "File Type:", - choices = c(".png", ".tiff", ".pdf"), + choices = c(".png", ".tiff", ".pdf", ".svg"), selected = ".png" ) ), diff --git a/program/shinyApp/ui.R b/program/shinyApp/ui.R index 4a4d505a..aa2933fa 100644 --- a/program/shinyApp/ui.R +++ b/program/shinyApp/ui.R @@ -45,7 +45,7 @@ library(gridExtra) library(sva) library(pcaPP) # requires gfortran. Not sure how to install on server library(reshape2) -# library(svglite) +library(svglite) source("R/C.R") source("R/module_DownloadReport.R",local=T) From 9b83a2c3ebb788c6cc23cfed6009af8723e6e84b Mon Sep 17 00:00:00 2001 From: anikde07 Date: Mon, 4 Nov 2024 18:32:19 +0100 Subject: [PATCH 2/2] Fixed heatmap plot --- program/shinyApp/R/heatmap/server.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/program/shinyApp/R/heatmap/server.R b/program/shinyApp/R/heatmap/server.R index 7e355439..b22595d6 100644 --- a/program/shinyApp/R/heatmap/server.R +++ b/program/shinyApp/R/heatmap/server.R @@ -323,7 +323,7 @@ heatmap_server <- function(id, data, params, updates){ paste0(isolate(heatmap_reactives$customTitle), " ", Sys.time(), input$file_ext_Heatmap) }, content = function(file){ - save_pheatmap(heatmap_plot,filename=file,type=gsub("\\.","",input$file_ext_Heatmap)) + save_pheatmap(res_tmp[[session$token]][["Heatmap"]]$plot,filename=file,type=gsub("\\.","",input$file_ext_Heatmap)) on.exit({ tmp_filename <- paste0( getwd(), @@ -331,7 +331,7 @@ heatmap_server <- function(id, data, params, updates){ paste0(isolate(heatmap_reactives$customTitle), " ", Sys.time(), input$file_ext_Heatmap) ) save_pheatmap( - heatmap_plot, + res_tmp[[session$token]][["Heatmap"]]$plot, filename = tmp_filename, type = gsub("\\.","",input$file_ext_Heatmap) )