ui: Move custom css to toplevel div

This commit is contained in:
Elias Projahn 2022-06-22 13:57:20 +02:00
parent 03516d9cc8
commit 51c4847949

272
R/ui.R
View file

@ -1,145 +1,151 @@
#' Function for creating the main user interface. #' Function for creating the main user interface.
#' @noRd #' @noRd
ui <- function() { ui <- function() {
navbarPage( div(
theme = bslib::bs_theme( custom_css(),
version = 5, navbarPage(
bootswatch = "united", theme = bslib::bs_theme(
primary = "#7d19bf" version = 5,
), bootswatch = "united",
title = "Ubigen", primary = "#7d19bf"
header = custom_css(), ),
tabPanel( title = "Ubigen",
"Explore", tabPanel(
sidebarLayout( "Explore",
sidebarPanel( sidebarLayout(
width = 3, sidebarPanel(
h3("My genes"), width = 3,
gene_selector_ui("custom_genes"), h3("My genes"),
h3("Scoring"), gene_selector_ui("custom_genes"),
selectInput( h3("Scoring"),
"cross_sample_metric", selectInput(
verticalLayout( "cross_sample_metric",
strong("Expression across samples"), verticalLayout(
paste0( strong("Expression across samples"),
"Proportion samples in which the gene is expressed above the ", paste0(
"selected threshold. Select a method and a weight for the ", "Proportion samples in which the gene is expressed above ",
"final score." "the selected threshold. Select a method and a weight for ",
) "the final score."
),
list(
"Above 95th percentile" = "above_95",
"Above median" = "above_median",
"Above zero" = "above_zero"
)
),
sliderInput(
"cross_sample_weight",
label = NULL,
min = -1.0,
max = 1.0,
step = 0.01,
value = 0.5
),
sliderInput(
"mean_expression",
verticalLayout(
strong("Mean Expression"),
"Mean expression of the gene across all samples."
),
min = -1.0,
max = 1.0,
step = 0.01,
value = 0.25
),
sliderInput(
"sd_expression",
verticalLayout(
strong("Standard deviation"),
"Standard deviation of the gene's expression across all samples."
),
min = -1.0,
max = 1.0,
step = 0.01,
value = -0.25
)
),
mainPanel(
width = 9,
plotly::plotlyOutput("overview_plot", height = "200px"),
tabsetPanel(
id = "results_panel",
selected = "top_genes",
header = div(class = "p-2"),
tabPanel(
"Your genes",
value = "custom_genes",
htmlOutput("custom_genes_synopsis"),
plotly::plotlyOutput("custom_genes_boxplot"),
div(class = "p-1"),
DT::dataTableOutput("custom_genes_details")
),
tabPanel(
"Top genes",
value = "top_genes",
div(paste0(
"Hover over the markers to see details on each gene. Click or ",
"drag within the figure to select genes of interest."
)),
plotly::plotlyOutput("scores_plot"),
div(paste0(
"Click on gene names to view them using the GTEx website. ",
"There, you can see the tissue specific expression behavior ",
"derived from the samples that this analysis is also based on."
)),
div(class = "p-1"),
DT::dataTableOutput("selected_genes")
),
tabPanel(
"GSEA",
value = "gsea",
div(
class = "flow-layout",
selectInput(
"gsea_set",
label = NULL,
list(
"Top genes" = "top",
"Selected genes" = "selected",
"Your genes" = "custom"
)
),
conditionalPanel(
"input.gsea_set == 'top'",
sliderInput(
"gsea_ranks",
label = NULL,
min = 10,
max = 1000,
value = 100,
step = 10,
ticks = FALSE
)
),
actionButton(
"gsea_run",
"Update analysis",
class = "btn-primary"
) )
), ),
plotly::plotlyOutput("gsea_plot"), list(
div(class = "p-2"), "Above 95th percentile" = "above_95",
DT::dataTableOutput("gsea_details") "Above median" = "above_median",
"Above zero" = "above_zero"
)
),
sliderInput(
"cross_sample_weight",
label = NULL,
min = -1.0,
max = 1.0,
step = 0.01,
value = 0.5
),
sliderInput(
"mean_expression",
verticalLayout(
strong("Mean Expression"),
"Mean expression of the gene across all samples."
),
min = -1.0,
max = 1.0,
step = 0.01,
value = 0.25
),
sliderInput(
"sd_expression",
verticalLayout(
strong("Standard deviation"),
paste0(
"Standard deviation of the gene's expression across all ",
"samples."
)
),
min = -1.0,
max = 1.0,
step = 0.01,
value = -0.25
)
),
mainPanel(
width = 9,
plotly::plotlyOutput("overview_plot", height = "200px"),
tabsetPanel(
id = "results_panel",
selected = "top_genes",
header = div(class = "p-2"),
tabPanel(
"Your genes",
value = "custom_genes",
htmlOutput("custom_genes_synopsis"),
plotly::plotlyOutput("custom_genes_boxplot"),
div(class = "p-1"),
DT::dataTableOutput("custom_genes_details")
),
tabPanel(
"Top genes",
value = "top_genes",
div(paste0(
"Hover over the markers to see details on each gene. Click ",
"or drag within the figure to select genes of interest."
)),
plotly::plotlyOutput("scores_plot"),
div(paste0(
"Click on gene names to view them using the GTEx website. ",
"There, you can see the tissue specific expression behavior ",
"derived from the samples that this analysis is also based ",
"on."
)),
div(class = "p-1"),
DT::dataTableOutput("selected_genes")
),
tabPanel(
"GSEA",
value = "gsea",
div(
class = "flow-layout",
selectInput(
"gsea_set",
label = NULL,
list(
"Top genes" = "top",
"Selected genes" = "selected",
"Your genes" = "custom"
)
),
conditionalPanel(
"input.gsea_set == 'top'",
sliderInput(
"gsea_ranks",
label = NULL,
min = 10,
max = 1000,
value = 100,
step = 10,
ticks = FALSE
)
),
actionButton(
"gsea_run",
"Update analysis",
class = "btn-primary"
)
),
plotly::plotlyOutput("gsea_plot"),
div(class = "p-2"),
DT::dataTableOutput("gsea_details")
)
) )
) )
) )
),
tabPanel(
title = "Help"
),
tabPanel(
title = "Publication"
) )
),
tabPanel(
title = "Help"
),
tabPanel(
title = "Publication"
) )
) )
} }