DillonHammill / CytoExploreR

Interactive Cytometry Data Analysis
60 stars 13 forks source link

cyto_gate_draw render in Shiny #143

Closed GeorgeAlehandro closed 2 years ago

GeorgeAlehandro commented 2 years ago

Good afternoon everyone,

So I am trying to conceive a UI for a collection of cytometry packages including CytoExploreR and most notably for the cyto_draw_gate() function which is really intuitive and easy to use.

Just the issue that I am running to is that the plot is being done on a pop up window which is not an issue when working on my local pc, but when integrating the code into a R-studio session on ubuntu server the plot will just not show (and rightfully so) which blocks the program. So the solution will be to integrate the plot in a renderPlot space in the shiny UI.

Codes showing the renders:

##Rendering the whole gating scheme works
    output$gating_scheme <- renderPlot({
      cyto_plot_gating_scheme(values$gs)
    })

##Rendering the cyto_draw_gate() plot will not work
    output$gate_draw<- renderPlot({
           cyto_gate_draw(
        values$gs,
        parent = input$parent,
        alias = c(values$marker1, values$marker2, values$marker3),
        channels = c(input$x.axis, input$y.axis),
        type = input$type,
        negate = FALSE
      )
    })

With the following warning: (Warning: Error in strsplit: non-character argument)

I think perhaps somewhere in the package I should modify something to indicate that the plot should be done on Shiny? Or Shiny isn't able to plot these types of graphics (which seems not plausible)? I see that cyto_draw_gate calls for cyto_plot and many other functions, but I don't seem to find the part that takes care of that. Screenshots showing the two types of plots on local PC: cyto_gate_draw plot

Thanks a lot for your help.

DillonHammill commented 2 years ago

I would recommend waiting for the release of version 2.0.0 of CytoExploreR, it has significant changes including improvements to compatibility with shiny.