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
681 changes: 359 additions & 322 deletions components/00SourceAll.R

Large diffs are not rendered by default.

34 changes: 24 additions & 10 deletions components/app/R/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ app_server <- function(input, output, session) {
enable_beta = shiny::reactive(input$enable_beta),
enable_info = shiny::reactive(input$enable_info)
)


## observe and set global User options
setUserOption(session,'hello', 'world!')
observeEvent(input$llm_model,setUserOption(session,'llm_model', input$llm_model))

## Do not display "Welcome" tab on the menu
bigdash.hideMenuItem(session, "welcome-tab")
shinyjs::runjs("sidebarClose()")
Expand Down Expand Up @@ -235,7 +239,7 @@ app_server <- function(input, output, session) {
bigdash.hideMenuElement(session, "GeneSets")
bigdash.hideMenuElement(session, "Compare")
bigdash.hideMenuElement(session, "SystemsBio")
bigdash.hideMenuElement(session, "MultiOmics (beta)")
bigdash.hideMenuElement(session, "MultiOmics")
}
# ###################### I STILL HAVE TO REMOVE THE UI!!!!!!!!!!!!!!!!!!!!!!!!!!!!
MODULES_TO_REMOVE <- xor(MODULES_LOADED, MODULES_ACTIVE) & MODULES_LOADED
Expand Down Expand Up @@ -285,7 +289,7 @@ app_server <- function(input, output, session) {
lapply(names(MODULE.multiomics$module_menu()), function(x) {
bigdash.removeTab(session, paste0(x, "-tab"))
})
bigdash.hideMenuElement(session, "MultiOmics (beta)")
bigdash.hideMenuElement(session, "MultiOmics")
loaded$multiomics <- 0
}
})
Expand Down Expand Up @@ -396,7 +400,7 @@ app_server <- function(input, output, session) {
info("[SERVER] initializing MultiOmics module")
mod <- MODULE.multiomics
insertBigTabUI(mod$module_ui())
bigdash.showMenuElement(session, "MultiOmics (beta)")
bigdash.showMenuElement(session, "MultiOmics")
lapply(names(MODULE.multiomics$module_menu()), function(x) {
bigdash.showTab(session, paste0(x, "-tab"))
})
Expand Down Expand Up @@ -503,22 +507,26 @@ app_server <- function(input, output, session) {
loaded$compare <- 1
tab_control()
}
if (input$nav %in% c("drug-tab", "wgcna-tab", "tcga-tab", "cell-tab", "pcsf-tab") && loaded$systems == 0) {
if (input$nav %in% c("drug-tab", "wgcna-tab", "tcga-tab", "cell-tab",
"pcsf-tab", "consensus-tab", "preservation-tab") && loaded$systems == 0) {
info("[UI:SERVER] reacted: calling Systems module")
mod <- MODULE.systems
insertBigTabUI2(mod$module_ui2(), mod$module_menu())
mod$module_server(PGX)
loaded$systems <- 1
tab_control()
}
if (input$nav %in% c("mofa-tab", "mgsea-tab", "snf-tab", "lasagna-tab", "deepnet-tab") && loaded$multiomics == 0) {
if (input$nav %in% c("mofa-tab", "mgsea-tab", "snf-tab", "lasagna-tab",
"deepnet-tab", "mwgcna-tab") && loaded$multiomics == 0) {
info("[UI:SERVER] reacted: calling Multi-Omics module")
mod <- MODULE.multiomics
insertBigTabUI2(mod$module_ui2(), mod$module_menu())
mod$module_server(PGX)
loaded$multiomics <- 1
tab_control()
}


})


Expand Down Expand Up @@ -713,12 +721,17 @@ app_server <- function(input, output, session) {

has.libx <- dir.exists(file.path(OPG, "libx"))

## Beta features
## Hide beta main tabs
info("[SERVER] disabling beta features")
bigdash.toggleTab(session, "tcga-tab", show.beta && has.libx)
bigdash.toggleTab(session, "consensus-tab", show.beta)
bigdash.toggleTab(session, "preservation-tab", show.beta)
bigdash.toggleTab(session, "mwgcna-tab", show.beta)

## hide beta subtabs..
toggleTab("drug-tabs", "Connectivity map (beta)", show.beta) ## too slow
toggleTab("pathway-tabs", "Enrichment Map (beta)", show.beta) ## too slow

## Control tab to only be displayed if there is custom fc + baseline fc
toggleTab("diffexpr-tabs1", "FC-FC comparison", "custom" %in% colnames(PGX$gx.meta$meta[[1]]$fc) && length(colnames(PGX$gx.meta$meta[[1]]$fc)) > 1)

Expand All @@ -737,8 +750,8 @@ app_server <- function(input, output, session) {

## Hide PCSF and WGCNA for metabolomics.
# WGCNA will be available upon gmt refactoring
if (DATATYPEPGX == "metabolomics") {
info("[SERVER] disabling WGCNA and PCSF for metabolomics data")
if (PGX$datatype == "metabolomics") {
info("[SERVER] disabling modules for metabolomics data")
bigdash.hideTab(session, "cmap-tab")
}

Expand All @@ -749,6 +762,7 @@ app_server <- function(input, output, session) {
bigdash.hideTab(session, "wordcloud-tab")
bigdash.hideTab(session, "cmap-tab")
}

}

## -------------------------------------------------------------
Expand Down
33 changes: 29 additions & 4 deletions components/app/R/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,11 @@ app_ui <- function(x) {
cell = "Cell profiling",
pcsf = "PCSF",
wgcna = "WGCNA",
consensus = "Consensus WGCNA",
preservation = "Preservation WGCNA",
tcga = "TCGA survival (beta)"
),
"MultiOmics (beta)" = MODULE.multiomics$module_menu()
"MultiOmics" = MODULE.multiomics$module_menu()
)

## filter disabled modules
Expand Down Expand Up @@ -353,6 +355,19 @@ app_ui <- function(x) {
"Choose a label type to be displayed in the plots",
placement = "right", options = list(container = "body")
)
),
bigdash::navbarDropdownItem(
withTooltip(
shiny::selectInput(
inputId = "llm_model",
label = "LLM model:",
choices = c("granite4:micro", "llama3.2:1b", "gpt-5-nano"),
selected = "granite4:micro",
width = "100%"
),
"Choose a label type to be displayed in the plots",
placement = "right", options = list(container = "body")
)
)
)
),
Expand All @@ -373,9 +388,9 @@ app_ui <- function(x) {
"welcome-tab",
"BigOmics Playground",
"is your self-service bioinformatics platform for interactive analysis,
visualization and interpretation of transcriptomics and proteomics data.
Perform complex data analysis and visualization easily without coding,
and significantly reduce the time-to-discovery."
visualization and interpretation of transcriptomics and proteomics data.
Perform complex data analysis and visualization easily without coding,
and significantly reduce the time-to-discovery."
),
bigdash::sidebarTabHelp(
"load-tab",
Expand Down Expand Up @@ -517,6 +532,16 @@ app_ui <- function(x) {
tspan("Visualize the distribution of (inferred)
immune cell types, expressed genes and pathway activation.")
),
bigdash::sidebarTabHelp(
"consensus-tab",
"Consensus WGCNA",
tspan("Consensus analysis using the WGCNA framework")
),
bigdash::sidebarTabHelp(
"preservation-tab",
"Preservation WGCNA",
tspan("Preservation analysis using the WGCNA framework")
),
!!!MODULE.multiomics$module_help() ### HELP!!! DOES NOT WORK!!!
),
bigdash::bigTabs(
Expand Down
8 changes: 8 additions & 0 deletions components/app/R/utils/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
## ##
#########################################################################

setUserOption <- function(session, var, value) {
session$userData[[var]] <- value
}

getUserOption <- function(session, var, value) {
return(session$userData[[var]])
}

is.symlink <- function(paths) isTRUE(nzchar(Sys.readlink(paths), keepNA = TRUE))

getAppVersion <- function(add.auth = FALSE) {
Expand Down
2 changes: 1 addition & 1 deletion components/app/R/www/styles.min.css

Large diffs are not rendered by default.

50 changes: 28 additions & 22 deletions components/board.mofa/R/__init.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ MODULE.multiomics <- list(
c(
snf = "SNF",
lasagna = "LASAGNA",
mgsea = "multiGSEA",
mgsea = "Multiomics GSEA",
mofa = "MOFA",
deepnet = "DeepLearning"
deepnet = "DeepLearning",
mwgcna = "Multiomics WGCNA"
)
},
module_ui = function() {
Expand All @@ -17,7 +18,8 @@ MODULE.multiomics <- list(
bigdash::bigTabItem("mgsea-tab", MGseaInputs("mgsea"), create_loader("mgsea-loader")),
bigdash::bigTabItem("snf-tab", SNFInputs("snf"), create_loader("snf-loader")),
bigdash::bigTabItem("lasagna-tab", LasagnaInputs("lasagna"), create_loader("lasagna-loader")),
bigdash::bigTabItem("deepnet-tab", DeepNetInputs("deepnet"), create_loader("deepnet-loader"))
bigdash::bigTabItem("deepnet-tab", DeepNetInputs("deepnet"), create_loader("deepnet-loader")),
bigdash::bigTabItem("mwgcna-tab", MultiWGCNA_Inputs("mwgcna"), create_loader("mwgcna-loader"))
)
},
module_ui2 = function() {
Expand All @@ -26,7 +28,8 @@ MODULE.multiomics <- list(
list("mgsea-tab", MGseaUI("mgsea")),
list("snf-tab", SNFUI("snf")),
list("lasagna-tab", LasagnaUI("lasagna")),
list("deepnet-tab", DeepNetUI("deepnet"))
list("deepnet-tab", DeepNetUI("deepnet")),
list("mwgcna-tab", MultiWGCNA_UI("mwgcna"))
)
},
module_server = function(PGX) {
Expand All @@ -44,30 +47,33 @@ MODULE.multiomics <- list(

info("[SERVER] calling DeepNetBoard module")
DeepNetBoard("deepnet", pgx = PGX)

info("[SERVER] calling MultiWGCNABoard module")
MultiWGCNA_Board("mwgcna", pgx = PGX)

},
module_help = function() {
list(
bigdash::sidebarTabHelp(
"mofa-tab", "MOFA",
tspan("Multi-omics Factor Analysis (MOFA) is a multi-omics
integration method based on matrix factorization.")
),
bigdash::sidebarTabHelp(
"mgsea-tab", "multiGSEA",
tspan("multiGSEA performs multi-omics integration on gene set level.")
),
bigdash::sidebarTabHelp(
"snf-tab", "SNF",
tspan("SNF clustering")
),
bigdash::sidebarTabHelp(
"lasagna-tab", "Lasagna",
tspan("LASAGNA is a stacked layer model for multi-omics integration where each layer corresponds to a datatype.")
),
bigdash::sidebarTabHelp(
"deepnet-tab", "DeepLearning",
tspan("Integration using DeepLearning")
)
integration method based on matrix factorization.")),

bigdash::sidebarTabHelp("mgsea-tab", "multiGSEA",
tspan("multiGSEA performs multi-omics integration on gene set level.")),

bigdash::sidebarTabHelp("snf-tab", "SNF",
tspan("SNF clustering")),

bigdash::sidebarTabHelp("lasagna-tab", "Lasagna",
tspan("LASAGNA is a stacked layer model for multi-omics integration where each layer corresponds to a datatype.")),

bigdash::sidebarTabHelp("deepnet-tab", "DeepLearning",
tspan("Integration using DeepLearning")),

bigdash::sidebarTabHelp("mwgcna-tab", "MultiOmics WGCNA",
tspan("WGCNA for multi-omics"))

)
}
)
2 changes: 1 addition & 1 deletion components/board.mofa/R/board_lasagna_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ LasagnaBoard <- function(id, pgx) {
gsfilter <- list(gset = input$gsfilter)
}

edge.sign <- ifelse(input$pos_edges, "pos", "both")
edge.sign <- ifelse(input$consensus, "consensus", "both")

## prune graph for plotting
pruned <- playbase::lasagna.prune_graph(
Expand Down
8 changes: 4 additions & 4 deletions components/board.mofa/R/board_lasagna_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ LasagnaInputs <- function(id) {
"Network options",
icon = icon("cog", lib = "glyphicon"),
shiny::tagList(
## shiny::checkboxInput(ns("top50"),"top 50",TRUE),
shiny::checkboxInput(ns("pos_edges"), "positive edges", FALSE),
shiny::checkboxInput(ns("sp_weight"), "SP weighting", FALSE),
shiny::sliderInput(ns("minrho"), "Edge threshold:", 0, 0.95, 0.5, 0.05),
##shiny::checkboxInput(ns("top50"),"top 50",TRUE),
shiny::checkboxInput(ns("consensus"),"consensus",FALSE),
shiny::checkboxInput(ns("sp_weight"),"SP weighting",FALSE),
shiny::sliderInput(ns("minrho"),"Edge threshold:",0,0.95,0.5,0.05),
shiny::hr(),
shiny::radioButtons(ns("node_value"), "Node value:",
choices = c("logFC", "rho"), selected = "logFC", inline = TRUE
Expand Down
33 changes: 32 additions & 1 deletion components/board.wgcna/R/__init.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ MODULE.systems <- list(
wgcna = "Network analysis",
tcga = "TCGA analysis",
cell = "Single cell",
pcsf = "Protein networks"
pcsf = "Protein networks",
consensus = "Consensus WGCNA",
preservation = "Preservation WGCNA"
)
},
module_ui = function() {
Expand Down Expand Up @@ -39,6 +41,16 @@ MODULE.systems <- list(
"pcsf-tab",
PcsfInputs("pcsf"),
create_loader("pcsf-loader")
),
bigdash::bigTabItem(
"consensus-tab",
ConsensusWGCNA_Inputs("consensus"),
create_loader("consensus-loader")
),
bigdash::bigTabItem(
"preservation-tab",
PreservationWGCNA_Inputs("preservation"),
create_loader("preservation-loader")
)
)
},
Expand All @@ -63,6 +75,14 @@ MODULE.systems <- list(
list(
"pcsf-tab",
PcsfUI("pcsf")
),
list(
"consensus-tab",
ConsensusWGCNA_UI("consensus")
),
list(
"preservation-tab",
PreservationWGCNA_UI("preservation")
)
)
},
Expand All @@ -86,5 +106,16 @@ MODULE.systems <- list(
PcsfBoard("pcsf",
pgx = PGX
)

ConsensusWGCNA_Board(
id = "consensus",
pgx = PGX
)

PreservationWGCNA_Board(
id = "preservation",
pgx = PGX
)

}
)
Loading