Skip to content

Commit

Permalink
Merge pull request #226 from bigomics/fix-diffexpr-blinking
Browse files Browse the repository at this point in the history
fix: diffexpr plots blink and initialize to all genes selected
  • Loading branch information
ncullen93 authored Mar 14, 2023
2 parents b1e1ec1 + 724e40c commit 2831095
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
1 change: 1 addition & 0 deletions components/board.expression/R/expression_plot_barplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ expression_plot_barplot_server <- function(id,
showothers <- input$barplot_showothers
sel <- sel()
res <- res()
shiny::req(sel())

psel <- rownames(res)[sel]
gene <- pgx$genes[1, "gene_name"]
Expand Down
2 changes: 1 addition & 1 deletion components/board.expression/R/expression_plot_maplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ expression_plot_maplot_server <- function(id,
if (length(comp1) == 0) {
return(NULL)
}
shiny::req(pgx)
shiny::req(pgx, sel1())

fdr <- as.numeric(gx_fdr())
lfc <- as.numeric(gx_lfc())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ expression_plot_topfoldchange_server <- function(id,
comp <- comp() # input$gx_contrast
sel <- sel()
res <- res()
shiny::req(sel())

psel <- rownames(res)[sel]
gene <- pgx$genes[psel, "gene_name"]
Expand Down
11 changes: 6 additions & 5 deletions components/board.expression/R/expression_plot_volcano.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ expression_plot_volcano_server <- function(id,
plot_data <- shiny::reactive({
# calculate required inputs for plotting


comp1 <- comp1()
fdr <- as.numeric(fdr())
lfc <- as.numeric(lfc())
Expand All @@ -82,6 +81,8 @@ expression_plot_volcano_server <- function(id,
sel2 <- sel2()
df2 <- df2()

req(sel1())

fam.genes <- res$gene_name

if (is.null(res)) {
Expand Down Expand Up @@ -159,7 +160,7 @@ expression_plot_volcano_server <- function(id,
})


plotly.RENDER <- function() {
plotly.RENDER <- reactive({
pd <- plot_data()
shiny::req(pd)

Expand All @@ -181,9 +182,9 @@ expression_plot_volcano_server <- function(id,
showlegend = FALSE
) %>% plotly::layout(margin = list(b = 65))
plt
}
})

modal_plotly.RENDER <- function() {
modal_plotly.RENDER <- reactive({
fig <- plotly.RENDER() %>%
plotly::layout(
font = list(size = 18),
Expand All @@ -193,7 +194,7 @@ expression_plot_volcano_server <- function(id,
)
fig <- plotly::style(fig, marker.size = 20)
fig
}
})

PlotModuleServer(
"pltmod",
Expand Down
12 changes: 4 additions & 8 deletions components/board.expression/R/expression_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ ExpressionBoard <- function(id, pgx) {
genetable_rows_selected <- reactiveVal()

observe({
req(genetable$rows_selected())
genetable_rows_selected(genetable$rows_selected())
})


# reactives ########


Expand All @@ -96,9 +96,6 @@ ExpressionBoard <- function(id, pgx) {
})





# functions #########


Expand Down Expand Up @@ -194,19 +191,18 @@ ExpressionBoard <- function(id, pgx) {
}

fullDiffExprTable <- shiny::reactive({
print('REACTIVE1 RUNNING')
## return the full DE table
if (is.null(pgx)) {
return(NULL)
}
comp <- 1
tests <- "trend.limma"
fdr <- 1
lfc <- 0
comp <- input$gx_contrast
tests <- input$gx_statmethod
fdr <- as.numeric(input$gx_fdr)
lfc <- as.numeric(input$gx_lfc)

req(input$gx_contrast, input$gx_statmethod, input$gx_fdr, input$gx_lfc)

if (is.null(comp)) {
return(NULL)
}
Expand Down

0 comments on commit 2831095

Please sign in to comment.