Skip to content

Commit

Permalink
layout fixes: fullscreen & table scrollResize fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ivokwee committed Apr 17, 2023
1 parent c1a5f25 commit 492048b
Show file tree
Hide file tree
Showing 46 changed files with 928 additions and 855 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
v3.0-RC.230417
v3.0-RC.230418

- Add Reactome pathway analysis (5 apr 2023)
- V3.0 release candidate 1 (16 mar 2023)
Expand Down
4 changes: 4 additions & 0 deletions components/00SourceAll.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ if(!file.exists('00SourceAll.R')) {
source('board.featuremap/R/featuremap_plot_table_geneset_map.R',encoding='UTF-8')
source('board.featuremap/R/featuremap_server.R',encoding='UTF-8')
source('board.featuremap/R/featuremap_ui.R',encoding='UTF-8')
source('board.functional/R/fun_wikipathview.R',encoding='UTF-8')
source('board.functional/R/functional_plot_wikipathway_actmap.R',encoding='UTF-8')
source('board.functional/R/functional_plot_wikipathway_graph.R',encoding='UTF-8')
source('board.functional/R/functional_table_wikipathway.R',encoding='UTF-8')
source('board.intersection/R/intersection_plot_contrast_correlation.R',encoding='UTF-8')
source('board.intersection/R/intersection_plot_foldchange_heatmap.R',encoding='UTF-8')
source('board.intersection/R/intersection_plot_scatterplot_pairs.R',encoding='UTF-8')
Expand Down
4 changes: 2 additions & 2 deletions components/board.biomarker/R/biomarker_plot_importance.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ biomarker_plot_importance_server <- function(id,
R <- pmax(R, 0.05)

par(mfrow = c(1, 1), oma = c(1, 1, 1, 1) * 0.2)
par(mar = c(5, 4, 0, 4))
par(mar = c(5, 3, 0, 1))
R.top <- head(R, 40)
barplot(t(R.top),
las = 3, horiz = FALSE,
cex.names = 0.75, ylab = "cumulative importance"
cex.names = 0.85, ylab = "cumulative importance"
)
klr <- grey.colors(ncol(R))
legend("topright",
Expand Down
92 changes: 41 additions & 51 deletions components/board.biomarker/R/biomarker_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,61 +54,51 @@ BiomarkerInputs <- function(id) {

BiomarkerUI <- function(id) {
ns <- shiny::NS(id)
imgH1 <- c("30vh", "70vh") ## heights for small and fullscreen image
imgH2 <- c("50vh", "70vh")

imgH1 <- c("280px", "70vh") ## heights for small and fullscreen image
imgH2 <- c("400px", "70vh")
imgH1 <- c("calc(40vh - 120px)", "70vh") ## heights for small and fullscreen image
imgH2 <- c("calc(60vh - 120px)", "70vh")

div(
boardHeader(title = "Biomarker Selection", info_link = ns("pdx_info")),
tagList(
div(
class = "row row-cols-1 row-cols-md-2 row-cols-xxxl-4",
div(
class = "col",
biomarker_plot_importance_ui(
ns("pdx_importance"),
title = "Variable importance",
info.text = "An importance score for each variable is calculated using multiple machine learning algorithms, including LASSO, elastic nets, random forests, and extreme gradient boosting. By combining several methods, the platform aims to select the best possible biomarkers. The top features are plotted according to cumulative ranking by the algorithms.",
caption = "Barchart indicating the cumulative weight of a proposed biomarker based on six machine learning algorithms.",
height = imgH1,
width = c("auto", "100%"),
label = "a")
),
div(
class = "col",
biomarker_plot_boxplots_ui(
ns("pdx_boxplots"),
title = "Biomarker expression",
info.text = "These boxplots shows the expression of genes/samples of the identified features.",
caption = "Expression boxplots of the most likely biomarkers across selected phenotypic groups.",
height = imgH1,
width = c("auto", "100%"),
label = "b")
),
div(
class = "col",
biomarker_plot_heatmap_ui(
ns("pdx_heatmap"),
title = "Heatmap",
info.text = "Expression heatmap of top gene features according to their variable importance.",
caption = "Heatmap indicating the expression pattern across selected phenotypic groups for the most likely biomarkers.",
height = imgH2,
width = c("auto", "100%"),
label = "c")
),
div(
class = "col",
biomarker_plot_decisiontree_ui(
ns("pdx_decisiontree"),
title = "Decision tree",
info.text = "The decision tree shows a tree solution for classification based on the top most important features. The plot provides a proportion of the samples that are defined by each biomarker in the boxes.",
caption = "Decision tree indicating expression-based biomarkers that distinguish the selected phenotypic groups.",
height = imgH2,
width = c("auto", "100%"),
label = "d")
)
bslib::layout_column_wrap(
width = 1/2,
height = "calc(100vh - 130px)",
heights_equal = "row",
biomarker_plot_importance_ui(
ns("pdx_importance"),
title = "Variable importance",
info.text = "An importance score for each variable is calculated using multiple machine learning algorithms, including LASSO, elastic nets, random forests, and extreme gradient boosting. By combining several methods, the platform aims to select the best possible biomarkers. The top features are plotted according to cumulative ranking by the algorithms.",
caption = "Barchart indicating the cumulative weight of a proposed biomarker based on six machine learning algorithms.",
height = imgH1,
width = c("auto", "100%"),
label = "a"
),
biomarker_plot_boxplots_ui(
ns("pdx_boxplots"),
title = "Biomarker expression",
info.text = "These boxplots shows the expression of genes/samples of the identified features.",
caption = "Expression boxplots of the most likely biomarkers across selected phenotypic groups.",
height = imgH1,
width = c("auto", "100%"),
label = "b"
),
biomarker_plot_heatmap_ui(
ns("pdx_heatmap"),
title = "Heatmap",
info.text = "Expression heatmap of top gene features according to their variable importance.",
caption = "Heatmap indicating the expression pattern across selected phenotypic groups for the most likely biomarkers.",
height = imgH2,
width = c("auto", "100%"),
label = "c"
),
biomarker_plot_decisiontree_ui(
ns("pdx_decisiontree"),
title = "Decision tree",
info.text = "The decision tree shows a tree solution for classification based on the top most important features. The plot provides a proportion of the samples that are defined by each biomarker in the boxes.",
caption = "Decision tree indicating expression-based biomarkers that distinguish the selected phenotypic groups.",
height = imgH2,
width = c("auto", "100%"),
label = "d"
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ clustering_plot_table_parcoord_server <- function(id,
df,
rownames = TRUE, ## escape = c(-1,-2),
extensions = c("Buttons", "Scroller"),
plugins = 'scrollResize',
selection = list(mode = "single", target = "row", selected = NULL),
class = "compact hover",
fillContainer = TRUE,
Expand All @@ -222,7 +223,9 @@ clustering_plot_table_parcoord_server <- function(id,
scrollX = TRUE, ## scrollY = TRUE,
## scrollY = 170,
scrollY = "23vh",
scroller = TRUE, deferRender = TRUE
scrollResize = TRUE,
scroller = TRUE,
deferRender = TRUE
) ## end of options.list
) %>%
DT::formatSignif(numeric.cols, 3) %>%
Expand Down
2 changes: 2 additions & 0 deletions components/board.clustering/R/clustering_table_clustannot.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ clustering_table_clustannot_server <- function(
df,
rownames = FALSE, escape = c(-1, -2),
extensions = c("Buttons", "Scroller"),
plugins = 'scrollResize',
selection = list(mode = "single", target = "row", selected = c(1)),
class = "compact hover",
fillContainer = TRUE,
Expand All @@ -75,6 +76,7 @@ clustering_table_clustannot_server <- function(
scrollX = TRUE,
scrollY = scrollY,
scroller = TRUE,
scrollResize = TRUE,
deferRender = TRUE
) ## end of options
) %>%
Expand Down
2 changes: 1 addition & 1 deletion components/board.compare/R/compare_plot_cum_fc1.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ compare_plot_cum_fc1_server <- function(id,
F1 <- F[, indexes == 1, drop = FALSE]
F2 <- F[, indexes == 2, drop = FALSE]

ii <- head(order(-rowMeans(F**2)), 50)
ii <- head(order(-rowMeans(F**2)), 40)
ii <- ii[order(rowMeans(F[ii, ]))]
F <- F[ii, , drop = FALSE]
F1 <- F1[ii, , drop = FALSE]
Expand Down
2 changes: 1 addition & 1 deletion components/board.compare/R/compare_plot_cum_fc2.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ compare_plot_cum_fc2_server <- function(id,
F1 <- F[, indexes == 1, drop = FALSE]
F2 <- F[, indexes == 2, drop = FALSE]

ii <- head(order(-rowMeans(F**2)), 50)
ii <- head(order(-rowMeans(F**2)), 40)
ii <- ii[order(rowMeans(F[ii, ]))]
F <- F[ii, , drop = FALSE]
F1 <- F1[ii, , drop = FALSE]
Expand Down
4 changes: 2 additions & 2 deletions components/board.compare/R/compare_plot_expression.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ compare_plot_expression_ui <- function(id, label = "", height = c(600, 800)) {
title = "Expression",
label = "a",
info.text = info_text,
height = c(440, 700),
width = c("auto", 1280),
height = height,
width = c("auto", "100%"),
download.fmt = c("png", "pdf")
)
}
Expand Down
4 changes: 2 additions & 2 deletions components/board.compare/R/compare_plot_gene_corr.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ compare_plot_gene_corr_ui <- function(id, label = "", height = c(600, 800)) {
label = "c",
info.text = info_text,
options = genecorr.opts,
height = c(740, 750),
width = c("auto", 900),
height = height,
width = c("auto", "100%"),
download.fmt = c("png", "pdf")
)
}
Expand Down
2 changes: 2 additions & 0 deletions components/board.compare/R/compare_table_corr_score.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ compare_table_corr_score_server <- function(id,
df,
rownames = TRUE, ## escape = c(-1,-2),
extensions = c("Buttons", "Scroller"),
plugins = "scrollResize",
selection = list(mode = "single", target = "row", selected = NULL),
class = "compact cell-border stripe hover",
fillContainer = TRUE,
options = list(
dom = "lfrtip",
scrollX = TRUE,
scrollY = "15vh",
scrollResize = TRUE,
scroller = TRUE,
deferRender = TRUE
) ## end of options.list
Expand Down
92 changes: 48 additions & 44 deletions components/board.compare/R/compare_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,77 +79,81 @@ CompareInputs <- function(id) {
CompareUI <- function(id) {
ns <- shiny::NS(id) ## namespace

fullH <- 770
tabH <- "70vh"

fullH <- "calc(100vh - 180px)"
tabH <- "70vh"
tabs <- shiny::tabsetPanel(
id = ns("tabs1"),
shiny::tabPanel(
"Compare expression",
div(
class = "row",
div(
class = "col-md-6",
compare_plot_compare1_ui(ns("dt1"),
width = c("auto", 900),
height = c(700, 750)
)
bslib::layout_column_wrap(
width = 1/2,
height = fullH,
compare_plot_compare1_ui(
id = ns("dt1"),
width = c("auto", "100%"),
height = c("100%", "70vh")
),
div(
class = "col-md-6",
compare_plot_compare2_ui(ns("dt2"),
width = c("auto", 900),
height = c(700, 750)
)
compare_plot_compare2_ui(
id = ns("dt2"),
width = c("auto", "100%"),
height = c("100%", "70vh")
)
)
),
shiny::tabPanel(
"Foldchange",
div(
class = "row",
div(
class = "col-md-6",
compare_plot_fc_correlation_ui(ns("fcfcplot"),
height = c(700, fullH),
width = c("auto", 900)
)
bslib::layout_column_wrap(
width = 1/2,
height = fullH,
compare_plot_fc_correlation_ui(
id = ns("fcfcplot"),
width = c("auto", "100%"),
height = c("100%", "70vh")
),
div(
class = "col-md-6",
compare_plot_cum_fc1_ui(ns("cumfcplot1"),
height = c(350, 375),
width = c("auto", 900),
bslib::layout_column_wrap(
width = 1,
compare_plot_cum_fc1_ui(
id = ns("cumfcplot1"),
width = c("auto", "100%"),
height = c("100%", "70vh"),
label = "b"
),
compare_plot_cum_fc2_ui(ns("cumfcplot2"),
height = c(350, 375),
width = c("auto", 900),
compare_plot_cum_fc2_ui(
id = ns("cumfcplot2"),
width = c("auto", "100%"),
height = c("100%", "70vh"),
label = "c"
)
)
)
),
shiny::tabPanel(
"Gene Correlation",
div(
class = "row",
div(
class = "col-md-6",
compare_plot_expression_ui(ns("multibarplot")),
bslib::layout_column_wrap(
width = 1/2,
height = fullH,
bslib::layout_column_wrap(
width = 1,
compare_plot_expression_ui(
id = ns("multibarplot"),
height = c("70%", TABLE_HEIGHT_MODAL)
),
compare_table_corr_score_ui(
ns("score_table"),
height = c(235, TABLE_HEIGHT_MODAL),
width = c("auto", "100%")
id = ns("score_table"),
height = c("30%", TABLE_HEIGHT_MODAL),
width = c("auto", "100%")
)
),
div(
class = "col-md-6",
compare_plot_gene_corr_ui(ns("genecorr"))
compare_plot_gene_corr_ui(
id = ns("genecorr"),
height = c("100%", TABLE_HEIGHT_MODAL),
)
)
)
)


div(
boardHeader(title = "Compare datasets", info_link = ns("info")),
tabs
Expand Down
Loading

0 comments on commit 492048b

Please sign in to comment.