Skip to content

Commit

Permalink
board.drugconnectivity: inputData + ngs -> pgx
Browse files Browse the repository at this point in the history
  • Loading branch information
ncullen93 committed Mar 14, 2023
1 parent 1b0850c commit ff18b5e
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion components/app/R/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ app_server <- function(input, output, session) {

if(ENABLED['drug']) {
info("[server.R] calling DrugConnectivityBoard module")
DrugConnectivityBoard("drug", inputData = inputData)
DrugConnectivityBoard("drug", pgx = PGX)
}

if(ENABLED['isect']) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ drugconnectivity_plot_actmap_server <- function(id,
}

plot_data <- shiny::reactive({
pgx <- pgx()
dsea_contrast <- dsea_contrast()
dsea_method <- dsea_method()
shiny::req(pgx, dsea_contrast, dsea_method)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ drugconnectivity_plot_cmap_dsea_server <- function(id,

plot_data <- shiny::reactive({
res <- list(
pgx = pgx(),
pgx = pgx,
dsea = getActiveDSEA(),
cmap_table = cmap_table,
moa.class = getMOA.class(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ drugconnectivity_plot_cmap_enplot_server <- function(id,
moduleServer(
id, function(input, output, session) {
plot_data <- shiny::reactive({
pgx <- pgx()
dsea <- getActiveDSEA()

res <- list(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ drugconnectivity_plot_enplots_server <- function(id,
moduleServer(
id, function(input, output, session) {
plot_data <- shiny::reactive({
pgx <- pgx()
dsea_contrast <- dsea_contrast()
dsea_method <- dsea_method()
shiny::req(pgx, dsea_contrast, dsea_method)
Expand Down
13 changes: 5 additions & 8 deletions components/board.drugconnectivity/R/drugconnectivity_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Copyright (c) 2018-2022 BigOmics Analytics Sagl. All rights reserved.
##

DrugConnectivityBoard <- function(id, inputData) {
DrugConnectivityBoard <- function(id, pgx) {
moduleServer(id, function(input, output, session) {
ns <- session$ns ## NAMESPACE

Expand All @@ -24,7 +24,6 @@ DrugConnectivityBoard <- function(id, inputData) {
allowfullscreen></iframe></center>")

shiny::observe({
pgx <- inputData()
shiny::req(pgx)
ct <- names(pgx$drugs)
shiny::updateSelectInput(session, "dsea_method", choices = ct)
Expand All @@ -43,7 +42,6 @@ DrugConnectivityBoard <- function(id, inputData) {
})

shiny::observe({
pgx <- inputData()
shiny::req(pgx)
ct <- colnames(pgx$model.parameters$contr.matrix)
shiny::updateSelectInput(session, "dsea_contrast", choices = sort(ct))
Expand All @@ -55,7 +53,6 @@ DrugConnectivityBoard <- function(id, inputData) {

# common getData-esque function for drug connectivity plots / tables
getActiveDSEA <- shiny::reactive({
pgx <- inputData()
shiny::req(pgx, input$dsea_contrast, input$dsea_method)

contr <- input$dsea_contrast
Expand Down Expand Up @@ -164,7 +161,7 @@ DrugConnectivityBoard <- function(id, inputData) {
## --------- DSEA enplot plotting module
drugconnectivity_plot_enplots_server(
"dsea_enplots",
inputData,
pgx,
reactive(input$dsea_contrast),
reactive(input$dsea_method),
dsea_table,
Expand All @@ -184,7 +181,7 @@ DrugConnectivityBoard <- function(id, inputData) {
## -------- Activation map plotting module
drugconnectivity_plot_actmap_server(
"dsea_actmap",
inputData,
pgx,
reactive(input$dsea_contrast),
reactive(input$dsea_method),
dsea_table,
Expand All @@ -204,15 +201,15 @@ DrugConnectivityBoard <- function(id, inputData) {

drugconnectivity_plot_cmap_enplot_server(
"cmap_enplot",
inputData,
pgx,
getActiveDSEA,
cmap_table,
watermark = WATERMARK
)

drugconnectivity_plot_cmap_dsea_server(
"cmap_dsea",
pgx = inputData,
pgx = pgx,
getActiveDSEA = getActiveDSEA,
cmap_table = cmap_table,
getMOA.class = getMOA.class,
Expand Down

0 comments on commit ff18b5e

Please sign in to comment.