Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions server.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ names(dataset_selector) <- c(dataset_names)
config <- json_file$config

IsSeurat2 <- function() {
return (packageVersion("Seurat") < 3)
return (packageVersion("Seurat") < "3")
}

SetAllIdent <- function(object, ids) {
Expand Down Expand Up @@ -226,14 +226,10 @@ server <- function(input, output, session) {
ignoreNULL = TRUE, ignoreInit = TRUE)

#Update expression plot on click
observeEvent({
observer_dotplot <- observeEvent(event_data("plotly_click", source = "plot_dot"), suspended = TRUE, {
s <- event_data("plotly_click", source = "plot_dot")
return(!is.null(s$y))
}, {
s <- event_data("plotly_click", source = "plot_dot")
updateTextInput(session, "hidden_selected_gene", value = s$y)
},
ignoreNULL = TRUE, ignoreInit = TRUE)
updateTextInput(session, "hidden_selected_gene", value = s$y)
})


#Update expression plot from selectize input
Expand Down Expand Up @@ -276,10 +272,7 @@ server <- function(input, output, session) {
})

#Monitor cluster plot for changes and update hidden_selected_cluster field
observeEvent({
s <- event_data("plotly_click", source = "plot_cluster")
return(!is.null(s))
}, {
observer_cluster <- observeEvent(event_data("plotly_click", source = "plot_cluster"), suspended = TRUE, {
s <- event_data("plotly_click", source = "plot_cluster")
if (!is.null(s)) {
updateTextInput(session, "hidden_selected_cluster", value = s$key)
Expand Down Expand Up @@ -315,15 +308,19 @@ server <- function(input, output, session) {

##GRAPHIC OUTPUTS
output$cluster_plot <- renderPlotly({
GetClusterPlot(data_list, current_dataset_index(), plot_window_width(), plot_window_height())
p <- GetClusterPlot(data_list, current_dataset_index(), plot_window_width(), plot_window_height())
observer_cluster$resume()
return(p)
}
)
output$expression_plot <- renderPlotly({
GetExpressionPlot(data_list, current_dataset_index(), input$hidden_selected_gene, plot_window_width(), plot_window_height())
}
)
output$dot_plot <- renderPlotly({
GetDotPlot(data_list, current_dataset_index(), current_gene_list(), plot_window_width(), plot_window_height())
p <- GetDotPlot(data_list, current_dataset_index(), current_gene_list(), plot_window_width(), plot_window_height())
observer_dotplot$resume()
return(p)
}
)

Expand Down
2 changes: 1 addition & 1 deletion utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ MaxMutate <- function(x) {
}

IsSeurat2 <- function() {
return (packageVersion("Seurat") < 3)
return (packageVersion("Seurat") < "3")
}

get_shared_genes <- function(inputGeneList1, inputGeneList2, topN) {
Expand Down