Skip to content

Commit

Permalink
Merge pull request #358 from bigomics/refactor-resources-tab
Browse files Browse the repository at this point in the history
convert resources tab tables to TableModule; remove tableModule file …
  • Loading branch information
ncullen93 committed May 8, 2023
2 parents b86b7ff + dbccd25 commit 6d6495b
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 267 deletions.
1 change: 0 additions & 1 deletion components/00SourceAll.R
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ if(!file.exists('00SourceAll.R')) {
source('ui/ui-modalUI.R',encoding='UTF-8')
source('ui/ui-plotmodule-old.R',encoding='UTF-8')
source('ui/ui-PlotModule.R',encoding='UTF-8')
source('ui/ui-TableModule.R',encoding='UTF-8')
source('ui/ui-TableModule2.R',encoding='UTF-8')
source('ui/ui-tooltip.R',encoding='UTF-8')
source('ui/ui-utils.R',encoding='UTF-8')
Expand Down
52 changes: 23 additions & 29 deletions components/board.dataview/R/dataview_table_resources.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,24 @@
##


dataview_table_rescources_ui <- function(id) {
dataview_table_resources_ui <- function(id) {
ns <- shiny::NS(id)
bslib::layout_column_wrap(
width = 1,
height = "100%",
heights_equal = "row",
heights_equal = "row",
style = htmltools::css(grid_template_columns = "4fr 4fr 4fr"),
tableWidget(ns("timings")),
tableWidget(ns("pgxobject")),
tableWidget(ns("objects"))
TableModuleUI(ns("timings"),
info.text = "The <b>timings</b> table reports more detailed
information about the object dimensions, object sizes and
execution times of the methods.",
title = "Timings"),
TableModuleUI(ns("pgxobject"),
info.text = "This table provides details about the pgx object.",
title = "PGX slot sizes"),
TableModuleUI(ns("objects"),
info.text = "This table provides size details about R objects.",
title = "R object sizes")
)
}

Expand Down Expand Up @@ -50,13 +58,9 @@ dataview_table_resources_server <- function(id, pgx) {
DT::formatStyle(0, target = "row", fontSize = "11px", lineHeight = "70%")
}

timings_text <- "The <b>timings</b> table reports more detailed information about the object dimensions, object sizes and execution times of the methods."

datatable_timings <- shiny::callModule(
tableModule, "timings",
func = datatable_timings.RENDER,
info.text = timings_text,
options = NULL, title = "Timings"
datatable_timings <- TableModuleServer(
"timings",
func = datatable_timings.RENDER
)

## ================================================================================
Expand Down Expand Up @@ -92,14 +96,9 @@ dataview_table_resources_server <- function(id, pgx) {
DT::formatStyle(0, target = "row", fontSize = "11px", lineHeight = "70%")
}

pgx_text <- "This table provides details about the pgx object."

datatable_pgxdims <- shiny::callModule(
tableModule, "pgxobject",
func = pgx.RENDER,
info.text = pgx_text,
options = NULL,
title = "PGX slot sizes"
datatable_pgxdims <- TableModuleServer(
"pgxobject",
func = pgx.RENDER
)

## ================================================================================
Expand Down Expand Up @@ -128,15 +127,10 @@ dataview_table_resources_server <- function(id, pgx) {
DT::formatStyle(0, target = "row", fontSize = "11px", lineHeight = "70%")
}

object_text <- "This table provides size details about R objects."

shiny::callModule(
tableModule, "objects",
func = object.RENDER,
info.text = object_text,
options = NULL,
title = "R object sizes"
datatable_pgxdims <- TableModuleServer(
"objects",
func = object.RENDER
)

}) ## end of moduleServer
} ## end of server
32 changes: 16 additions & 16 deletions components/board.dataview/R/dataview_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ DataViewUI <- function(id) {
imgH <- c(330, 600) ## heights for small and fullscreen image
imgH <- c("40vh", "70vh") ## heights for small and fullscreen image
fullH = "calc(100vh - 180px)"
fullH.css = "height: calc(100vh - 180px);"
fullH.css = "height: calc(100vh - 180px);"

tabs <- shiny::tabsetPanel(
id = ns("tabs"),
# Gene overview tab #####
Expand All @@ -79,7 +79,7 @@ DataViewUI <- function(id) {
bslib::layout_column_wrap(
width = 1,
height = "100%",
heights_equal = "row",
heights_equal = "row",
style = htmltools::css(grid_template_columns = "2fr 10fr"),
dataview_module_geneinfo_ui(
id = ns("geneinfo"),
Expand All @@ -89,7 +89,7 @@ DataViewUI <- function(id) {
height = c("100%", TABLE_HEIGHT_MODAL),
width = c("auto", "100%")
),
shinyjqui::jqui_sortable(
shinyjqui::jqui_sortable(
bslib::layout_column_wrap(
width = 1,
bslib::layout_column_wrap(
Expand Down Expand Up @@ -130,7 +130,7 @@ DataViewUI <- function(id) {
title = "Top correlated genes",
info.text = "Colors are from absolute expression levels of genes, where the low and high expressions range between the light and dark colors, respectively.",
caption = "Barplot of the top positively and negatively correlated genes with the selected gene. Darker color corresponds to higher expression of the gene.",
height = c("100%", TABLE_HEIGHT_MODAL),
height = c("100%", TABLE_HEIGHT_MODAL),
width = c("auto", "100%")
),
dataview_plot_tissue_ui(
Expand All @@ -147,16 +147,16 @@ DataViewUI <- function(id) {
)
)
),

# QC tab #####
shiny::tabPanel(
"Sample QC",
"Sample QC",
shinyjqui::jqui_sortable(
bslib::layout_column_wrap(
width = 1,
height = fullH,
heights_equal = "row",
bs_alert("The Sample QC tab provides an overview of several sample-centric quality control metrics. In this QC tab, the total number of counts (abundance) per sample and their distribution among the samples are displayed. This is most useful to check the technical quality of the dataset, such as total read counts or abundance of ribosomal genes."),
heights_equal = "row",
bs_alert("The Sample QC tab provides an overview of several sample-centric quality control metrics. In this QC tab, the total number of counts (abundance) per sample and their distribution among the samples are displayed. This is most useful to check the technical quality of the dataset, such as total read counts or abundance of ribosomal genes."),
bslib::layout_column_wrap(
width = 1/3,
dataview_plot_totalcounts_ui(
Expand Down Expand Up @@ -235,7 +235,7 @@ DataViewUI <- function(id) {
bslib::layout_column_wrap(
width = 1,
height = fullH,
heights_equal = "row",
heights_equal = "row",
bs_alert("In the Sample information panel, more complete information about samples can be found."),
bslib::layout_column_wrap(
width = 1/2,
Expand All @@ -245,13 +245,13 @@ DataViewUI <- function(id) {
title = "Phenotype clustering",
info.text = "Column ordering has been performed using hierarchical clustering on a one-hot encoded matrix.",
caption = "Clustered heatmap of sample information (i.e. phenotype data)",
height = c("50%", TABLE_HEIGHT_MODAL),
height = c("50%", TABLE_HEIGHT_MODAL),
width = c("auto", "100%"),
label = "a"
),
dataview_plot_phenoassociation_ui(
ns("phenoassociation"),
height = c("50%", TABLE_HEIGHT_MODAL),
height = c("50%", TABLE_HEIGHT_MODAL),
width = c("auto", "100%"),
label = "b",
title = "Phenotype association",
Expand All @@ -267,7 +267,7 @@ DataViewUI <- function(id) {
width = c("auto", "100%"),
title = "Sample information",
info.text = "Phenotype variables starting with a 'dot' (e.g. '.cell cycle' and '.gender' ) have been estimated from the data.",
caption = "Phenotype information about the samples."
caption = "Phenotype information about the samples."
)
)
)
Expand All @@ -280,11 +280,11 @@ DataViewUI <- function(id) {
bslib::layout_column_wrap(
width = 1,
height = fullH,
heights_equal = "row",
heights_equal = "row",
dataview_table_contrasts_ui(
ns("contrastTable"),
title = "Contrast table",
info.text = "Here, you can check which samples belong to which groups for the different comparisons. Non-zero entries '+1' and '-1' correspond to the group of interest and control group, respectively. Zero or empty entries denote samples not use for that comparison.",
info.text = "Here, you can check which samples belong to which groups for the different comparisons. Non-zero entries '+1' and '-1' correspond to the group of interest and control group, respectively. Zero or empty entries denote samples not use for that comparison.",
caption = "Table summarizing the contrasts of all comparisons.",
height = c("100%", TABLE_HEIGHT_MODAL),
width = c("auto", "100%")
Expand All @@ -297,7 +297,7 @@ DataViewUI <- function(id) {
bslib::layout_column_wrap(
width = 1,
height = fullH,
dataview_table_rescources_ui(ns("resources"))
dataview_table_resources_ui(ns("resources"))
)
)
)
Expand Down

0 comments on commit 6d6495b

Please sign in to comment.