Browse code

plotly and ggplot in statmodel distinction

deril2605 authored on 28/01/2024 04:54:27
Showing 1 changed files

... ...
@@ -448,6 +448,8 @@ statmodelServer <- function(input, output, session,parent_session, loadpage_inpu
448 448
                                    height = input$height,
449 449
                                    address="Ex_",
450 450
                                    isPlotly = TRUE)[[1]]
451
+      remove_modal_spinner()
452
+      return(plot1)
451 453
       }, error = function(e){
452 454
         remove_modal_spinner()
453 455
         message("An error occurred: ", conditionMessage(e))
... ...
@@ -455,7 +457,7 @@ statmodelServer <- function(input, output, session,parent_session, loadpage_inpu
455 457
       )
456 458
     }
457 459
 
458
-    remove_modal_spinner()
460
+    
459 461
 
460 462
     if(saveFile1) {
461 463
       return(id_address1)
... ...
@@ -710,10 +712,22 @@ statmodelServer <- function(input, output, session,parent_session, loadpage_inpu
710 712
 
711 713
   observeEvent(input$viewresults, {
712 714
     ns <- session$ns
715
+    # TMT and PTM plotly plots are still under development
716
+    if ((loadpage_input()$DDA_DIA == "TMT") || (loadpage_input()$BIO == "PTM")) {
717
+      output$comp_plots = renderPlot({
718
+        group_comparison(FALSE, FALSE)
719
+      })
720
+      op <- plotOutput(ns("comp_plots"))
721
+    } else {
722
+      output$comp_plots = renderPlotly({
723
+        group_comparison(FALSE, FALSE)
724
+      })
725
+      op <- plotlyOutput(ns("comp_plots"), height = input$height)
726
+    }
713 727
     insertUI(
714 728
       selector = paste0("#", ns("comparison_plots")),
715 729
       ui=tags$div(
716
-        plotlyOutput(ns("comp_plots"), height = input$height),
730
+        op,
717 731
         conditionalPanel(condition = "input['statmodel-typeplot'] == 'VolcanoPlot' && input['loadpage-DDA_DIA']!='TMT'",
718 732
                          h5("Click on plot for details"),
719 733
                          verbatimTextOutput(ns("info2"))),
... ...
@@ -723,12 +737,6 @@ statmodelServer <- function(input, output, session,parent_session, loadpage_inpu
723 737
     )
724 738
   }
725 739
   )
726
-  
727
-  observe({output$comp_plots = renderPlotly({
728
-    group_comparison(FALSE, FALSE)
729
-    }
730
-  )
731
-  })
732 740
 
733 741
   plotset = reactive({
734 742