mirror of
https://github.com/johrpan/geposanui.git
synced 2025-10-26 11:17:24 +01:00
Add more context help
This commit is contained in:
parent
a2f3ea4448
commit
d23646e0a9
4 changed files with 84 additions and 15 deletions
|
|
@ -5,9 +5,21 @@
|
||||||
comparison_editor_ui <- function(id, options) {
|
comparison_editor_ui <- function(id, options) {
|
||||||
verticalLayout(
|
verticalLayout(
|
||||||
h5("Comparison"),
|
h5("Comparison"),
|
||||||
|
popover(
|
||||||
|
title = "Comparison genes",
|
||||||
|
help = paste0(
|
||||||
|
"Select your genes of interest to compare their scores with the ",
|
||||||
|
"reference genes. This will not influence the computation of scores, ",
|
||||||
|
"but it will update the visualizations and summary statistics. Select ",
|
||||||
|
"\"Your genes\" and use the other controls below for selecting or ",
|
||||||
|
"pasting the genes. You can also use predefined gene sets for ",
|
||||||
|
"comparison."
|
||||||
|
),
|
||||||
|
div(class = "label", "Comparison genes")
|
||||||
|
),
|
||||||
selectInput(
|
selectInput(
|
||||||
NS(id, "comparison_genes"),
|
NS(id, "comparison_genes"),
|
||||||
"Comparison genes",
|
label = NULL,
|
||||||
choices = c(
|
choices = c(
|
||||||
"Your genes",
|
"Your genes",
|
||||||
"Random genes",
|
"Random genes",
|
||||||
|
|
|
||||||
38
R/methods.R
38
R/methods.R
|
|
@ -2,17 +2,38 @@
|
||||||
methods_ui <- function(id, options) {
|
methods_ui <- function(id, options) {
|
||||||
verticalLayout(
|
verticalLayout(
|
||||||
h5("Methods"),
|
h5("Methods"),
|
||||||
|
popover(
|
||||||
|
title = "Optimization target",
|
||||||
|
help = paste0(
|
||||||
|
"These genes will be used as the target for optimization. This means ",
|
||||||
|
"that the method weights will be automatically adjusted to maximize ",
|
||||||
|
"the scores of this gene set. Select \"Reference genes\", if you want ",
|
||||||
|
"to compare your genes of interest with the reference gene set."
|
||||||
|
),
|
||||||
|
div(class = "label", "Genes to optimize for")
|
||||||
|
),
|
||||||
selectInput(
|
selectInput(
|
||||||
NS(id, "optimization_genes"),
|
NS(id, "optimization_genes"),
|
||||||
"Genes to optimize for",
|
label = NULL,
|
||||||
choices = list(
|
choices = list(
|
||||||
"Reference genes" = "reference",
|
"Reference genes" = "reference",
|
||||||
"Comparison genes" = "comparison"
|
"Comparison genes" = "comparison"
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
popover(
|
||||||
|
title = "Optimization target",
|
||||||
|
help = paste0(
|
||||||
|
"This determines how the genes, that were selected for optimization, ",
|
||||||
|
"are combined. For example, \"Mean rank\" optimizes the method ",
|
||||||
|
"weights based on the highest possible mean score across all selected ",
|
||||||
|
"genes and \"First rank\" would always focus on the best performing ",
|
||||||
|
"gene."
|
||||||
|
),
|
||||||
|
div(class = "label", "Optimization target")
|
||||||
|
),
|
||||||
selectInput(
|
selectInput(
|
||||||
NS(id, "optimization_target"),
|
NS(id, "optimization_target"),
|
||||||
"Optimization target",
|
label = NULL,
|
||||||
choices = list(
|
choices = list(
|
||||||
"Mean rank" = "mean",
|
"Mean rank" = "mean",
|
||||||
"Median rank" = "median",
|
"Median rank" = "median",
|
||||||
|
|
@ -23,8 +44,9 @@ methods_ui <- function(id, options) {
|
||||||
),
|
),
|
||||||
lapply(options$methods, function(method) {
|
lapply(options$methods, function(method) {
|
||||||
verticalLayout(
|
verticalLayout(
|
||||||
div(
|
popover(
|
||||||
style = "display: flex;",
|
title = method$name,
|
||||||
|
help = method$help,
|
||||||
checkboxInput(
|
checkboxInput(
|
||||||
NS(id, method$id),
|
NS(id, method$id),
|
||||||
span(
|
span(
|
||||||
|
|
@ -32,14 +54,6 @@ methods_ui <- function(id, options) {
|
||||||
class = "control-label"
|
class = "control-label"
|
||||||
),
|
),
|
||||||
value = TRUE
|
value = TRUE
|
||||||
),
|
|
||||||
div(
|
|
||||||
style = "margin-left: 5px;",
|
|
||||||
bslib::popover(
|
|
||||||
bsicons::bs_icon("question-circle"),
|
|
||||||
title = method$name,
|
|
||||||
method$help
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
sliderInput(
|
sliderInput(
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,20 @@ preset_editor_ui <- function(id, options) {
|
||||||
|
|
||||||
verticalLayout(
|
verticalLayout(
|
||||||
h5("Inputs"),
|
h5("Inputs"),
|
||||||
|
popover(
|
||||||
|
title = "Species to include",
|
||||||
|
help = paste0(
|
||||||
|
"This can be used to limit the input dataset to a predefined set of ",
|
||||||
|
"species. Normally, it is reasonable to use all species. So, do not ",
|
||||||
|
"change this unless you have specific reasons to do so. The ",
|
||||||
|
"algorithms will automatically optimize the input dataset by ",
|
||||||
|
"excluding species that do not share enough genes."
|
||||||
|
),
|
||||||
|
div(class = "label", "Species to include")
|
||||||
|
),
|
||||||
selectInput(
|
selectInput(
|
||||||
NS(id, "species"),
|
NS(id, "species"),
|
||||||
"Species to include",
|
label = NULL,
|
||||||
choices = species_choices
|
choices = species_choices
|
||||||
),
|
),
|
||||||
if (!options$locked) {
|
if (!options$locked) {
|
||||||
|
|
@ -36,9 +47,18 @@ preset_editor_ui <- function(id, options) {
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
popover(
|
||||||
|
title = "Reference genes",
|
||||||
|
help = paste0(
|
||||||
|
"The reference genes are the main input to the computation. They are ",
|
||||||
|
"used for computing some of the scores and for optimizing the weights ",
|
||||||
|
"of the different methods."
|
||||||
|
),
|
||||||
|
div(class = "label", "Reference genes")
|
||||||
|
),
|
||||||
selectInput(
|
selectInput(
|
||||||
NS(id, "reference_genes"),
|
NS(id, "reference_genes"),
|
||||||
"Reference genes",
|
label = NULL,
|
||||||
choices = gene_choices
|
choices = gene_choices
|
||||||
),
|
),
|
||||||
if (!options$locked) {
|
if (!options$locked) {
|
||||||
|
|
|
||||||
23
R/utils.R
23
R/utils.R
|
|
@ -3,3 +3,26 @@
|
||||||
#' @import data.table
|
#' @import data.table
|
||||||
#' @import shiny
|
#' @import shiny
|
||||||
NULL
|
NULL
|
||||||
|
|
||||||
|
#' Add a help popover to a control.
|
||||||
|
#'
|
||||||
|
#' @param title Title of the help popover.
|
||||||
|
#' @param help Content of the help popover.
|
||||||
|
#' @param child The control to add the popover to.
|
||||||
|
#'
|
||||||
|
#' @noRd
|
||||||
|
popover <- function(title, help, child) {
|
||||||
|
div(
|
||||||
|
style = "display: flex;",
|
||||||
|
child,
|
||||||
|
div(
|
||||||
|
style = "margin-left: 5px;",
|
||||||
|
bslib::popover(
|
||||||
|
bsicons::bs_icon("question-circle"),
|
||||||
|
title = title,
|
||||||
|
help,
|
||||||
|
options = list(offset = c(0, 10))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue