| Title: | RNA-Seq Analysis Modules to Add to a Teal Application |
|---|---|
| Description: | RNA-seq analysis teal modules based on the `hermes` package. |
| Authors: | Dony Unardi [cre], Daniel Sabanés Bové [aut], Nikolas Burkoff [aut], Dinakar Kulkarni [aut], Konrad Pagacz [aut], Namrata Bhatia [aut], Dawid Kaledkowski [aut], Pawel Rucki [aut], Jeff Luong [aut], Stefanie Bienert [aut], Haocheng Li [aut], Lyndsee Midori Zhang [aut], Sorin Voicu [ctb], Benoit Falquet [ctb], Mahmoud Hallal [ctb], Tim Treis [ctb], Vedha Viyash [ctb], F. Hoffmann-La Roche AG [cph, fnd] |
| Maintainer: | Dony Unardi <[email protected]> |
| License: | Apache License 2.0 | file LICENSE |
| Version: | 0.2.0 |
| Built: | 2026-05-21 03:20:42 UTC |
| Source: | https://github.com/insightsengineering/teal.modules.hermes |
teal.modules.hermes Packageteal.modules.hermes provides RNA-seq analysis modules to add to a
teal application.
Maintainer: Dony Unardi [email protected]
Authors:
Daniel Sabanés Bové
Nikolas Burkoff
Dinakar Kulkarni
Konrad Pagacz
Namrata Bhatia
Dawid Kaledkowski
Pawel Rucki
Jeff Luong
Stefanie Bienert
Haocheng Li
Lyndsee Midori Zhang
Other contributors:
Sorin Voicu [contributor]
Benoit Falquet [contributor]
Mahmoud Hallal [contributor]
Tim Treis [contributor]
Vedha Viyash [contributor]
F. Hoffmann-La Roche AG [copyright holder, funder]
Useful links:
ADTTE SpecificationThis defines the input for the ADTTE specification.
adtteSpecInput(inputId, label_paramcd = "Select Endpoint")adtteSpecInput(inputId, label_paramcd = "Select Endpoint")
inputId |
( |
label_paramcd |
( |
The UI part.
adtteSpecServer() for the module server and a complete example.
ADTTE SpecificationThis defines the server part for the ADTTE specification. The resulting data
set binned_adtte_subset contains the subset of ADTTE selected by the time-to-event
endpoint, joined together with the gene information extracted from specified assay
and experiment, as numeric and factor columns. The factor column is created by binning
the numeric column according to the quantile cutoffs specified in probs.
adtteSpecServer( id, data, mae_name, adtte_name, adtte_vars, experiment_data, experiment_name, assay, genes, probs )adtteSpecServer( id, data, mae_name, adtte_name, adtte_vars, experiment_data, experiment_name, assay, genes, probs )
id |
( |
data |
( |
mae_name |
( |
adtte_name |
( |
adtte_vars |
(named
|
experiment_data |
(reactive |
experiment_name |
(reactive |
assay |
(reactive |
genes |
(reactive |
probs |
(reactive |
List with the following elements:
binned_adtte_subset: reactive containing the joined ADTTE and gene data.
gene_col: reactive containing the string with the column name of the original
numeric gene variable.
gene_factor: string with the variable name for the binned gene data.
time_unit: reactive string with the time unit for the current subset.
adtteSpecInput() for the module UI.
library(dplyr) ui <- function(id) { ns <- NS(id) teal.widgets::standard_layout( encoding = uiOutput(ns("encoding_ui")), output = verbatimTextOutput(ns("summary")) ) } server <- function(id, data, filter_panel_api) { checkmate::assert_class(data, "reactive") checkmate::assert_class(shiny::isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { output$encoding_ui <- renderUI({ tags$div( experimentSpecInput(session$ns("experiment"), data, mae_name = "MAE"), assaySpecInput(session$ns("assay")), geneSpecInput(session$ns("genes"), funs = list(Mean = colMeans)), adtteSpecInput(session$ns("adtte")) ) }) experiment <- experimentSpecServer( "experiment", data = data, filter_panel_api = filter_panel_api, mae_name = "MAE" ) assay <- assaySpecServer( "assay", assays = experiment$assays ) genes <- geneSpecServer( "genes", funs = list(Mean = colMeans), gene_choices = experiment$genes ) adtte <- adtteSpecServer( "adtte", data = data, adtte_name = "ADTTE", mae_name = "MAE", adtte_vars = list( aval = "AVAL", avalu = "AVALU", is_event = "is_event", paramcd = "PARAMCD", usubjid = "USUBJID" ), experiment_data = experiment$data, experiment_name = experiment$name, assay = assay, genes = genes, probs = reactive({ 0.5 }) ) output$summary <- renderPrint({ binned_adtte_subset <- adtte$binned_adtte_subset() summary(binned_adtte_subset) }) }) } my_app <- function() { data <- teal_data() data <- within(data, { ADSL <- teal.data::rADSL ADTTE <- teal.data::rADTTE %>% dplyr::mutate(is_event = .data$CNSR == 0) MAE <- hermes::multi_assay_experiment }) join_keys(data) <- default_cdisc_join_keys[c("ADSL", "ADTTE", "MAE")] app <- init( data = data, modules = modules( module( label = "adtteSpec example", server = server, ui = ui, datanames = "all" ) ) ) shinyApp(app$ui, app$server) } if (interactive()) { my_app() }library(dplyr) ui <- function(id) { ns <- NS(id) teal.widgets::standard_layout( encoding = uiOutput(ns("encoding_ui")), output = verbatimTextOutput(ns("summary")) ) } server <- function(id, data, filter_panel_api) { checkmate::assert_class(data, "reactive") checkmate::assert_class(shiny::isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { output$encoding_ui <- renderUI({ tags$div( experimentSpecInput(session$ns("experiment"), data, mae_name = "MAE"), assaySpecInput(session$ns("assay")), geneSpecInput(session$ns("genes"), funs = list(Mean = colMeans)), adtteSpecInput(session$ns("adtte")) ) }) experiment <- experimentSpecServer( "experiment", data = data, filter_panel_api = filter_panel_api, mae_name = "MAE" ) assay <- assaySpecServer( "assay", assays = experiment$assays ) genes <- geneSpecServer( "genes", funs = list(Mean = colMeans), gene_choices = experiment$genes ) adtte <- adtteSpecServer( "adtte", data = data, adtte_name = "ADTTE", mae_name = "MAE", adtte_vars = list( aval = "AVAL", avalu = "AVALU", is_event = "is_event", paramcd = "PARAMCD", usubjid = "USUBJID" ), experiment_data = experiment$data, experiment_name = experiment$name, assay = assay, genes = genes, probs = reactive({ 0.5 }) ) output$summary <- renderPrint({ binned_adtte_subset <- adtte$binned_adtte_subset() summary(binned_adtte_subset) }) }) } my_app <- function() { data <- teal_data() data <- within(data, { ADSL <- teal.data::rADSL ADTTE <- teal.data::rADTTE %>% dplyr::mutate(is_event = .data$CNSR == 0) MAE <- hermes::multi_assay_experiment }) join_keys(data) <- default_cdisc_join_keys[c("ADSL", "ADTTE", "MAE")] app <- init( data = data, modules = modules( module( label = "adtteSpec example", server = server, ui = ui, datanames = "all" ) ) ) shinyApp(app$ui, app$server) } if (interactive()) { my_app() }
This defines the input for the assay specification.
assaySpecInput(inputId, label_assays = "Select Assay")assaySpecInput(inputId, label_assays = "Select Assay")
inputId |
( |
label_assays |
( |
The UI part.
assaySpecServer() for the module server and a complete example.
This defines the server part for the assay specification.
assaySpecServer(id, assays, exclude_assays = character())assaySpecServer(id, assays, exclude_assays = character())
id |
( |
assays |
(reactive |
exclude_assays |
( |
The chosen assay as a reactive string.
assaySpecInput() for the module UI.
ui <- function(id) { ns <- NS(id) teal.widgets::standard_layout( encoding = uiOutput(ns("encoding_ui")), output = textOutput(ns("result")) ) } server <- function(id, data, filter_panel_api) { moduleServer(id, module = function(input, output, session) { output$encoding_ui <- renderUI({ tags$div( experimentSpecInput(session$ns("experiment"), data, "MAE"), assaySpecInput( session$ns("assay"), label_assays = "Please choose assay" ) ) }) experiment <- experimentSpecServer( id = "experiment", data = data, filter_panel_api = filter_panel_api, mae_name = "MAE" ) assay <- assaySpecServer( "assay", experiment$assays, exclude_assays = c("counts", "cpm", "tpm", "bla") ) output$result <- renderPrint({ assay() }) }) } my_app <- function() { data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( module( label = "assaySpec example", server = server, ui = ui, datanames = "all" ) ) ) shinyApp(app$ui, app$server) } if (interactive()) { my_app() }ui <- function(id) { ns <- NS(id) teal.widgets::standard_layout( encoding = uiOutput(ns("encoding_ui")), output = textOutput(ns("result")) ) } server <- function(id, data, filter_panel_api) { moduleServer(id, module = function(input, output, session) { output$encoding_ui <- renderUI({ tags$div( experimentSpecInput(session$ns("experiment"), data, "MAE"), assaySpecInput( session$ns("assay"), label_assays = "Please choose assay" ) ) }) experiment <- experimentSpecServer( id = "experiment", data = data, filter_panel_api = filter_panel_api, mae_name = "MAE" ) assay <- assaySpecServer( "assay", experiment$assays, exclude_assays = c("counts", "cpm", "tpm", "bla") ) output$result <- renderPrint({ assay() }) }) } my_app <- function() { data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( module( label = "assaySpec example", server = server, ui = ui, datanames = "all" ) ) ) shinyApp(app$ui, app$server) } if (interactive()) { my_app() }
ADTTE VariablesCheck whether x is a list of ADTTE variables.
assert_adtte_vars(x)assert_adtte_vars(x)
x |
an object to check. |
assertions for more details.
assert_adtte_vars(list(aval = "AV", is_event = "EV", paramcd = "PC", usubjid = "ID", avalu = "u"))assert_adtte_vars(list(aval = "AV", is_event = "EV", paramcd = "PC", usubjid = "ID", avalu = "u"))
Check whether x is a list of summary functions.
assert_summary_funs(x, null.ok = FALSE)assert_summary_funs(x, null.ok = FALSE)
x |
an object to check. |
null.ok |
( |
assertions for more details.
assert_summary_funs(list(mean = colMeans, raw = NULL), null.ok = TRUE)assert_summary_funs(list(mean = colMeans, raw = NULL), null.ok = TRUE)
Check whether x is a reactive input.
check_reactive(x) assert_reactive(x, .var.name = checkmate::vname(x), add = NULL) test_reactive(x)check_reactive(x) assert_reactive(x, .var.name = checkmate::vname(x), add = NULL) test_reactive(x)
x |
an object to check. |
.var.name |
( |
add |
( |
assertions for more details.
check_reactive("bla") check_reactive(reactive("bla"))check_reactive("bla") check_reactive(reactive("bla"))
Check whether x is a shiny tag.
check_tag(x, null.ok = FALSE) assert_tag(x, null.ok = FALSE, .var.name = checkmate::vname(x), add = NULL) test_tag(x, null.ok = FALSE) expect_tag(x, null.ok = FALSE, info = NULL, label = vname(x))check_tag(x, null.ok = FALSE) assert_tag(x, null.ok = FALSE, .var.name = checkmate::vname(x), add = NULL) test_tag(x, null.ok = FALSE) expect_tag(x, null.ok = FALSE, info = NULL, label = vname(x))
x |
an object to check. |
null.ok |
( |
.var.name |
( |
add |
( |
info |
( |
label |
( |
assertions for more details.
check_tag("bla") check_tag(NULL, null.ok = TRUE)check_tag("bla") check_tag(NULL, null.ok = TRUE)
This defines the input for the experiment specification.
experimentSpecInput( inputId, data, mae_name, label_experiments = "Select Experiment" )experimentSpecInput( inputId, data, mae_name, label_experiments = "Select Experiment" )
inputId |
( |
data |
( |
mae_name |
( |
label_experiments |
( |
The UI part.
experimentSpecServer() for the module server and a complete example.
This defines the server part for the experiment specification.
experimentSpecServer( id, data, filter_panel_api, mae_name, name_annotation = "symbol", sample_vars_as_factors = TRUE, with_mae_col_data = TRUE )experimentSpecServer( id, data, filter_panel_api, mae_name, name_annotation = "symbol", sample_vars_as_factors = TRUE, with_mae_col_data = TRUE )
id |
( |
data |
( |
filter_panel_api |
( |
mae_name |
( |
name_annotation |
( |
sample_vars_as_factors |
( |
with_mae_col_data |
( |
List with the following reactive objects:
data: the hermes::AnyHermesData experiment.
name: the name of the experiment as selected by the user.
genes: a data.frame with the genes in data, with columns id and name.
assays: the names of the assays in data.
experimentSpecInput() for the module UI.
ui <- function(id, mae_name) { ns <- NS(id) teal.widgets::standard_layout( encoding = uiOutput(ns("encoding_ui")), output = tags$div( verbatimTextOutput(ns("summary")), verbatimTextOutput(ns("head")) ) ) } server <- function(id, data, filter_panel_api, mae_name) { moduleServer(id, function(input, output, session) { output$encoding_ui <- renderUI({ tags$div( experimentSpecInput( session$ns("my_experiment"), data, mae_name, label_experiments = "Please choose experiment" ), selectInput( session$ns("property"), "Please choose property", c("data", "name", "genes", "assays") ) ) }) experiment <- experimentSpecServer( "my_experiment", data, filter_panel_api, mae_name ) result <- reactive({ req(input$property) switch(input$property, data = experiment$data(), name = experiment$name(), genes = experiment$genes(), assays = experiment$assays() ) }) output$summary <- renderPrint({ result <- result() hermes::summary(result) }) output$head <- renderPrint({ result <- result() utils::head(result) }) }) } my_app <- function() { data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( module( label = "experimentSpec example", server = server, server_args = list(mae_name = "MAE"), ui = ui, ui_args = list(mae_name = "MAE"), datanames = "all" ) ) ) shinyApp(app$ui, app$server) } if (interactive()) { my_app() }ui <- function(id, mae_name) { ns <- NS(id) teal.widgets::standard_layout( encoding = uiOutput(ns("encoding_ui")), output = tags$div( verbatimTextOutput(ns("summary")), verbatimTextOutput(ns("head")) ) ) } server <- function(id, data, filter_panel_api, mae_name) { moduleServer(id, function(input, output, session) { output$encoding_ui <- renderUI({ tags$div( experimentSpecInput( session$ns("my_experiment"), data, mae_name, label_experiments = "Please choose experiment" ), selectInput( session$ns("property"), "Please choose property", c("data", "name", "genes", "assays") ) ) }) experiment <- experimentSpecServer( "my_experiment", data, filter_panel_api, mae_name ) result <- reactive({ req(input$property) switch(input$property, data = experiment$data(), name = experiment$name(), genes = experiment$genes(), assays = experiment$assays() ) }) output$summary <- renderPrint({ result <- result() hermes::summary(result) }) output$head <- renderPrint({ result <- result() utils::head(result) }) }) } my_app <- function() { data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( module( label = "experimentSpec example", server = server, server_args = list(mae_name = "MAE"), ui = ui, ui_args = list(mae_name = "MAE"), datanames = "all" ) ) ) shinyApp(app$ui, app$server) } if (interactive()) { my_app() }
This defines the input for the gene signature specification.
geneSpecInput( inputId, funs, label_genes = "Select Gene(s)", label_funs = "Select Gene Summary", label_text_button = "Enter list of genes", label_lock_button = "Lock gene selection (so that it does not get updated when filtering)", label_select_all_button = paste0("Select All Genes (first ", max_options, ")"), label_select_none_button = "Select None", max_options = 200L, max_selected = max_options )geneSpecInput( inputId, funs, label_genes = "Select Gene(s)", label_funs = "Select Gene Summary", label_text_button = "Enter list of genes", label_lock_button = "Lock gene selection (so that it does not get updated when filtering)", label_select_all_button = paste0("Select All Genes (first ", max_options, ")"), label_select_none_button = "Select None", max_options = 200L, max_selected = max_options )
inputId |
( |
funs |
(named |
label_genes |
( |
label_funs |
( |
label_text_button |
( |
label_lock_button |
( |
label_select_all_button |
( |
label_select_none_button |
( |
max_options |
( |
max_selected |
( |
The UI part.
geneSpecServer() for the module server and a complete example.
geneSpecInput("my_genes", list(mean = colMeans), label_funs = "Please select function")geneSpecInput("my_genes", list(mean = colMeans), label_funs = "Please select function")
This defines the server part for the gene signature specification.
geneSpecServer( id, funs, gene_choices, label_modal_title = "Enter list of genes", label_modal_footer = c("Please enter a comma-separated list of gene IDs and/or names.", "(Note that genes not included in current choices will be removed)") )geneSpecServer( id, funs, gene_choices, label_modal_title = "Enter list of genes", label_modal_footer = c("Please enter a comma-separated list of gene IDs and/or names.", "(Note that genes not included in current choices will be removed)") )
id |
( |
funs |
(static named |
gene_choices |
(reactive |
label_modal_title |
( |
label_modal_footer |
( |
Reactive hermes::GeneSpec which can be used as input for the relevant
hermes functions.
geneSpecInput() for the module UI.
ui <- function(id, funs) { ns <- NS(id) teal.widgets::standard_layout( encoding = tags$div( geneSpecInput( ns("my_genes"), funs = funs, label_funs = "Please select function" ) ), output = textOutput(ns("result")) ) } server <- function(id, data, funs) { checkmate::assert_class(data, "reactive") checkmate::assert_class(shiny::isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { gene_choices <- reactive({ mae <- data()[["MAE"]] object <- mae[[1]] gene_ids <- rownames(object) gene_names <- SummarizedExperiment::rowData(object)$symbol gene_data <- data.frame( id = gene_ids, name = gene_names ) gene_data[order(gene_data$name), ] }) gene_spec <- geneSpecServer( "my_genes", funs = funs, gene_choices = gene_choices ) output$result <- renderText({ validate_gene_spec( gene_spec(), gene_choices()$id ) gene_spec <- gene_spec() gene_spec$get_label() }) }) } funs <- list(mean = colMeans) my_app <- function() { data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( module( label = "GeneSpec example", server = server, server_args = list(funs = funs), ui = ui, ui_args = list(funs = funs), datanames = "all" ) ) ) shinyApp(app$ui, app$server) } if (interactive()) { my_app() }ui <- function(id, funs) { ns <- NS(id) teal.widgets::standard_layout( encoding = tags$div( geneSpecInput( ns("my_genes"), funs = funs, label_funs = "Please select function" ) ), output = textOutput(ns("result")) ) } server <- function(id, data, funs) { checkmate::assert_class(data, "reactive") checkmate::assert_class(shiny::isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { gene_choices <- reactive({ mae <- data()[["MAE"]] object <- mae[[1]] gene_ids <- rownames(object) gene_names <- SummarizedExperiment::rowData(object)$symbol gene_data <- data.frame( id = gene_ids, name = gene_names ) gene_data[order(gene_data$name), ] }) gene_spec <- geneSpecServer( "my_genes", funs = funs, gene_choices = gene_choices ) output$result <- renderText({ validate_gene_spec( gene_spec(), gene_choices()$id ) gene_spec <- gene_spec() gene_spec$get_label() }) }) } funs <- list(mean = colMeans) my_app <- function() { data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( module( label = "GeneSpec example", server = server, server_args = list(funs = funs), ui = ui, ui_args = list(funs = funs), datanames = "all" ) ) ) shinyApp(app$ui, app$server) } if (interactive()) { my_app() }
This helper function takes an assignment list and converts it to a group list.
h_assign_to_group_list(x)h_assign_to_group_list(x)
x |
(named |
A combination list.
assign_list <- list( "ASIAN" = "1", "BLACK OR AFRICAN AMERICAN" = "1", "MULTIPLE" = "2", "UNKNOWN" = "2", "WHITE" = "4" ) objective_list <- list( "ASIAN/BLACK OR AFRICAN AMERICAN" = c("ASIAN", "BLACK OR AFRICAN AMERICAN"), "MULTIPLE/UNKNOWN" = c("MULTIPLE", "UNKNOWN"), "WHITE" = "WHITE" ) result_list <- h_assign_to_group_list(assign_list) stopifnot(identical(result_list, objective_list))assign_list <- list( "ASIAN" = "1", "BLACK OR AFRICAN AMERICAN" = "1", "MULTIPLE" = "2", "UNKNOWN" = "2", "WHITE" = "4" ) objective_list <- list( "ASIAN/BLACK OR AFRICAN AMERICAN" = c("ASIAN", "BLACK OR AFRICAN AMERICAN"), "MULTIPLE/UNKNOWN" = c("MULTIPLE", "UNKNOWN"), "WHITE" = "WHITE" ) result_list <- h_assign_to_group_list(assign_list) stopifnot(identical(result_list, objective_list))
Given a group list and a factor, this helper function collapses the levels in the factor accordingly and also ensures that the resulting levels are in the order given in the group list.
h_collapse_levels(x, group_list)h_collapse_levels(x, group_list)
x |
( |
group_list |
(named |
The transformed factor x with new levels.
set.seed(123) x <- factor(sample( c("ASIAN", "BLACK OR AFRICAN AMERICAN", "MULTIPLE", "UNKNOWN", "WHITE"), size = 30L, replace = TRUE )) group_list <- list( "ASIAN/BLACK OR AFRICAN AMERICAN" = c("ASIAN", "BLACK OR AFRICAN AMERICAN"), "MULTIPLE/UNKNOWN" = c("MULTIPLE", "UNKNOWN"), "WHITE" = "WHITE" ) x_collapsed <- h_collapse_levels(x, group_list) stopifnot(identical(levels(x_collapsed), names(group_list)))set.seed(123) x <- factor(sample( c("ASIAN", "BLACK OR AFRICAN AMERICAN", "MULTIPLE", "UNKNOWN", "WHITE"), size = 30L, replace = TRUE )) group_list <- list( "ASIAN/BLACK OR AFRICAN AMERICAN" = c("ASIAN", "BLACK OR AFRICAN AMERICAN"), "MULTIPLE/UNKNOWN" = c("MULTIPLE", "UNKNOWN"), "WHITE" = "WHITE" ) x_collapsed <- h_collapse_levels(x, group_list) stopifnot(identical(levels(x_collapsed), names(group_list)))
This helper function extracts words from a string. Here words are defined as containing lower or upper case letters, colons and dots. All other characters are considered separators.
h_extract_words(x)h_extract_words(x)
x |
( |
Character vector with the extracted words.
h_extract_words("a, b, , c, 234; 34562 - GeneID:bla") h_extract_words("GeneID:1820, sdf.393; 32596")h_extract_words("a, b, , c, 234; 34562 - GeneID:bla") h_extract_words("GeneID:1820, sdf.393; 32596")
Given a hermes::AnyHermesData data object, as well as the annotation
column name to use as gene name, this function formats the contained genes
as a data.frame ready for consumption in h_order_genes() e.g.
h_gene_data(object, name_annotation)h_gene_data(object, name_annotation)
object |
( |
name_annotation |
( |
Note that missing names or names that only contain whitespace are replaced by empty strings for consistency and better labeling in the UI downstream
A data.frame with id and name columns containing all genes from
object.
object <- hermes::hermes_data[1:10, ] h_gene_data(object, "symbol")object <- hermes::hermes_data[1:10, ] h_gene_data(object, "symbol")
ADTTE ModuleA function to help with merging of MAE to ADTTE.
h_km_mae_to_adtte( adtte, mae, genes, experiment_name = "hd1", assay_name = "counts", usubjid_var = "USUBJID" )h_km_mae_to_adtte( adtte, mae, genes, experiment_name = "hd1", assay_name = "counts", usubjid_var = "USUBJID" )
adtte |
( |
mae |
( |
genes |
( |
experiment_name |
( |
assay_name |
( |
usubjid_var |
( |
A data frame containing all columns/rows from adtte that match
by subject ID with the row names of the MAE and have the gene samples available
in the given experiment. The attribute gene_cols contains the column names
for the gene columns.
The final gene column names can start with a different string than the original gene IDs (or labels), in particular white space and colons are removed.
library(dplyr) mae <- hermes::multi_assay_experiment adtte <- teal.data::rADTTE %>% dplyr::mutate(CNSR = as.logical(CNSR)) new_adtte <- h_km_mae_to_adtte( adtte, mae, genes = hermes::gene_spec("GeneID:1820"), experiment_name = "hd2" ) new_adtte2 <- h_km_mae_to_adtte( adtte, mae, genes = hermes::gene_spec(c("GeneID:1820", "GeneID:94115"), fun = colMeans), experiment_name = "hd2" ) new_adtte3 <- h_km_mae_to_adtte( adtte, mae, genes = hermes::gene_spec(c(A = "GeneID:1820", B = "GeneID:94115")), experiment_name = "hd2" )library(dplyr) mae <- hermes::multi_assay_experiment adtte <- teal.data::rADTTE %>% dplyr::mutate(CNSR = as.logical(CNSR)) new_adtte <- h_km_mae_to_adtte( adtte, mae, genes = hermes::gene_spec("GeneID:1820"), experiment_name = "hd2" ) new_adtte2 <- h_km_mae_to_adtte( adtte, mae, genes = hermes::gene_spec(c("GeneID:1820", "GeneID:94115"), fun = colMeans), experiment_name = "hd2" ) new_adtte3 <- h_km_mae_to_adtte( adtte, mae, genes = hermes::gene_spec(c(A = "GeneID:1820", B = "GeneID:94115")), experiment_name = "hd2" )
The possible gene choices are ordered as follows. First come all genes which have a non-empty name, ordered by their name alphabetically. Last come all genes with an empty name, ordered by their ID alphabetically.
h_order_genes(genes)h_order_genes(genes)
genes |
( |
The ordered data.frame.
genes <- data.frame( id = c("7", "1", "2", "345346", "0"), name = c("e", "", "c", "", "a") ) h_order_genes(genes)genes <- data.frame( id = c("7", "1", "2", "345346", "0"), name = c("e", "", "c", "", "a") ) h_order_genes(genes)
This helper function takes a vector of words and tries to match them
with the id and name columns of possible gene choices.
h_parse_genes(words, choices)h_parse_genes(words, choices)
words |
( |
choices |
( |
The subset of choices which matches words in ID or name.
h_parse_genes( c("a", "2535"), data.frame(id = as.character(2533:2537), name = letters[1:5]) )h_parse_genes( c("a", "2535"), data.frame(id = as.character(2533:2537), name = letters[1:5]) )
This helper function takes the intersection of selected and
choices for genes and updates the inputId accordingly. It then
shows a notification if not all selected genes were available.
h_update_gene_selection(session, inputId, selected, choices)h_update_gene_selection(session, inputId, selected, choices)
session |
( |
inputId |
( |
selected |
( |
choices |
( |
This function plots the correlation heatmap.
heatmap_plot(object, assay_name)heatmap_plot(object, assay_name)
object |
( |
assay_name |
( |
Plot to be displayed in the teal app.
library(hermes) object <- HermesData(summarized_experiment) result <- heatmap_plot(object, assay_name = "counts")library(hermes) object <- HermesData(summarized_experiment) result <- heatmap_plot(object, assay_name = "counts")
This predicate function is helpful for functions where arguments could not yet be initialized from the teal module.
is_blank(x)is_blank(x)
x |
object to check. |
Flag whether x is identical to an empty string, i.e. "".
is_blank("") is_blank(" ")is_blank("") is_blank(" ")
When multiple sample variables are used in a given module, then this wrapper makes it much easier to specify in the server function.
multiSampleVarSpecServer(inputIds, original_data, ...)multiSampleVarSpecServer(inputIds, original_data, ...)
inputIds |
( |
original_data |
(reactive |
... |
additional arguments as documented in |
List with the final transformed experiment_data reactive and a
list vars which contains the selected sample variables as reactives
under their input ID.
## Not run: # In the server use: sample_var_specs <- multiSampleVarSpecServer( inputIds = c("facet_var", "color_var"), experiment_name = reactive({ input$experiment_name }), original_data = ori_data # nolint Please update the <ori_data> ) # Then can extract the transformed data and selected variables later: experiment_data <- sample_var_specs$experiment_data() facet_var <- sample_var_specs$vars$facet_var() color_var <- sample_var_specs$vars$color_var() ## End(Not run)## Not run: # In the server use: sample_var_specs <- multiSampleVarSpecServer( inputIds = c("facet_var", "color_var"), experiment_name = reactive({ input$experiment_name }), original_data = ori_data # nolint Please update the <ori_data> ) # Then can extract the transformed data and selected variables later: experiment_data <- sample_var_specs$experiment_data() facet_var <- sample_var_specs$vars$facet_var() color_var <- sample_var_specs$vars$color_var() ## End(Not run)
This defines the input for the sample variable specification.
sampleVarSpecInput( inputId, label_vars = "Select sample variable", label_levels_button = "Combine factor levels" )sampleVarSpecInput( inputId, label_vars = "Select sample variable", label_levels_button = "Combine factor levels" )
inputId |
( |
label_vars |
( |
label_levels_button |
( |
The UI part.
sampleVarSpecServer() for the module server and a complete example.
sampleVarSpecInput("my_vars", label_vars = "Select faceting variable")sampleVarSpecInput("my_vars", label_vars = "Select faceting variable")
This defines the server part for the sample variable specification.
sampleVarSpecServer( id, experiment_name, original_data, transformed_data = original_data, assign_lists = reactiveValues(), num_levels = NULL, categorical_only = !is.null(num_levels), explicit_na = FALSE, label_modal_title = "Please click to group the original factor levels" )sampleVarSpecServer( id, experiment_name, original_data, transformed_data = original_data, assign_lists = reactiveValues(), num_levels = NULL, categorical_only = !is.null(num_levels), explicit_na = FALSE, label_modal_title = "Please click to group the original factor levels" )
id |
( |
experiment_name |
(reactive |
original_data |
(reactive |
transformed_data |
(reactive |
assign_lists |
( |
num_levels |
( |
categorical_only |
( |
explicit_na |
( |
label_modal_title |
( |
Reactive SummarizedExperiment::SummarizedExperiment which can be used as
input for the relevant hermes functions.
Only atomic columns (e.g. not DataFrame columns) of the colData
which are not completely missing (NA) will be shown for selection.
If num_levels is specified then only factor columns will be available.
sampleVarSpecInput() for the module UI.
ui <- function(id) { checkmate::assert_class(data, "teal_data") ns <- NS(id) teal.widgets::standard_layout( encoding = uiOutput(ns("encoding_ui")), output = plotOutput(ns("plot")) ) } server <- function(id, data) { checkmate::assert_class(data, "reactive") checkmate::assert_class(shiny::isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { output$encoding_ui <- renderUI({ mae <- data()[["MAE"]] experiment_name_choices <- names(mae) tags$div( selectInput(session$ns("experiment_name"), "Select experiment", experiment_name_choices), sampleVarSpecInput(session$ns("facet_var"), "Select faceting variable") ) }) experiment_data <- reactive({ req(input$experiment_name) mae <- data()[["MAE"]] object <- mae[[input$experiment_name]] SummarizedExperiment::colData(object) <- hermes::df_cols_to_factor(SummarizedExperiment::colData(object)) object }) facet_var_spec <- sampleVarSpecServer( "facet_var", experiment_name = reactive({ input$experiment_name }), original_data = experiment_data ) output$plot <- renderPlot({ experiment_data_final <- facet_var_spec$experiment_data() facet_var <- facet_var_spec$sample_var() hermes::draw_boxplot( experiment_data_final, assay_name = "counts", genes = hermes::gene_spec(hermes::genes(experiment_data_final)[1]), facet_var = facet_var ) }) }) } my_app <- function() { data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( module( label = "sampleVarSpec example", server = server, ui = ui, datanames = "all" ) ) ) shinyApp(app$ui, app$server) } if (interactive()) { my_app() }ui <- function(id) { checkmate::assert_class(data, "teal_data") ns <- NS(id) teal.widgets::standard_layout( encoding = uiOutput(ns("encoding_ui")), output = plotOutput(ns("plot")) ) } server <- function(id, data) { checkmate::assert_class(data, "reactive") checkmate::assert_class(shiny::isolate(data()), "teal_data") moduleServer(id, function(input, output, session) { output$encoding_ui <- renderUI({ mae <- data()[["MAE"]] experiment_name_choices <- names(mae) tags$div( selectInput(session$ns("experiment_name"), "Select experiment", experiment_name_choices), sampleVarSpecInput(session$ns("facet_var"), "Select faceting variable") ) }) experiment_data <- reactive({ req(input$experiment_name) mae <- data()[["MAE"]] object <- mae[[input$experiment_name]] SummarizedExperiment::colData(object) <- hermes::df_cols_to_factor(SummarizedExperiment::colData(object)) object }) facet_var_spec <- sampleVarSpecServer( "facet_var", experiment_name = reactive({ input$experiment_name }), original_data = experiment_data ) output$plot <- renderPlot({ experiment_data_final <- facet_var_spec$experiment_data() facet_var <- facet_var_spec$sample_var() hermes::draw_boxplot( experiment_data_final, assay_name = "counts", genes = hermes::gene_spec(hermes::genes(experiment_data_final)[1]), facet_var = facet_var ) }) }) } my_app <- function() { data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( module( label = "sampleVarSpec example", server = server, ui = ui, datanames = "all" ) ) ) shinyApp(app$ui, app$server) } if (interactive()) { my_app() }
This module provides an interactive barplot for RNA-seq gene expression analysis.
tm_g_barplot( label, mae_name, exclude_assays = character(), summary_funs = list(Mean = colMeans, Median = matrixStats::colMedians, Max = matrixStats::colMaxs), pre_output = NULL, post_output = NULL, .test = FALSE, transformators = list() ) ui_g_barplot( id, mae_name, summary_funs, pre_output, post_output, .test = FALSE ) srv_g_barplot( id, data, filter_panel_api, reporter, mae_name, exclude_assays, summary_funs, .test = FALSE ) sample_tm_g_barplot(.test = FALSE)tm_g_barplot( label, mae_name, exclude_assays = character(), summary_funs = list(Mean = colMeans, Median = matrixStats::colMedians, Max = matrixStats::colMaxs), pre_output = NULL, post_output = NULL, .test = FALSE, transformators = list() ) ui_g_barplot( id, mae_name, summary_funs, pre_output, post_output, .test = FALSE ) srv_g_barplot( id, data, filter_panel_api, reporter, mae_name, exclude_assays, summary_funs, .test = FALSE ) sample_tm_g_barplot(.test = FALSE)
label |
( |
mae_name |
( |
exclude_assays |
( |
summary_funs |
(named |
pre_output |
( |
post_output |
( |
.test |
( |
transformators |
( |
id |
( |
data |
( |
filter_panel_api |
( |
reporter |
( |
Shiny module to be used in the teal app.
ui_g_barplot(): sets up the user interface.
srv_g_barplot(): sets up the server with reactive graph.
sample_tm_g_barplot(): sample module function.
data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( tm_g_barplot( label = "barplot", mae_name = "MAE" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) } # Alternatively you can run the sample module with this function call: if (interactive()) { sample_tm_g_barplot() }data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( tm_g_barplot( label = "barplot", mae_name = "MAE" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) } # Alternatively you can run the sample module with this function call: if (interactive()) { sample_tm_g_barplot() }
This module provides an interactive boxplot for RNA-seq gene expression analysis.
tm_g_boxplot( label, mae_name, exclude_assays = character(), summary_funs = list(None = NULL, Mean = colMeans, Median = matrixStats::colMedians, Max = matrixStats::colMaxs), pre_output = NULL, post_output = NULL, .test = FALSE, transformators = list() ) ui_g_boxplot( id, mae_name, summary_funs, pre_output, post_output, .test = FALSE ) srv_g_boxplot( id, data, filter_panel_api, reporter, mae_name, exclude_assays, summary_funs, .test = FALSE ) sample_tm_g_boxplot(.test = FALSE)tm_g_boxplot( label, mae_name, exclude_assays = character(), summary_funs = list(None = NULL, Mean = colMeans, Median = matrixStats::colMedians, Max = matrixStats::colMaxs), pre_output = NULL, post_output = NULL, .test = FALSE, transformators = list() ) ui_g_boxplot( id, mae_name, summary_funs, pre_output, post_output, .test = FALSE ) srv_g_boxplot( id, data, filter_panel_api, reporter, mae_name, exclude_assays, summary_funs, .test = FALSE ) sample_tm_g_boxplot(.test = FALSE)
label |
( |
mae_name |
( |
exclude_assays |
( |
summary_funs |
(named |
pre_output |
( |
post_output |
( |
.test |
( |
transformators |
( |
id |
( |
data |
( |
filter_panel_api |
( |
reporter |
( |
Shiny module to be used in the teal app.
ui_g_boxplot(): sets up the user interface.
srv_g_boxplot(): sets up the server with reactive graph.
sample_tm_g_boxplot(): sample module function.
data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( tm_g_boxplot( label = "boxplot", mae_name = "MAE" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) } # Alternatively you can run the sample module with this function call: if (interactive()) { sample_tm_g_boxplot() }data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( tm_g_boxplot( label = "boxplot", mae_name = "MAE" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) } # Alternatively you can run the sample module with this function call: if (interactive()) { sample_tm_g_boxplot() }
This module provides an interactive survival forest plot.
tm_g_forest_tte( label, adtte_name, mae_name, adtte_vars = list(aval = "AVAL", is_event = "is_event", paramcd = "PARAMCD", usubjid = "USUBJID", avalu = "AVALU"), exclude_assays = "counts", summary_funs = list(Mean = colMeans, Median = matrixStats::colMedians, Max = matrixStats::colMaxs), pre_output = NULL, post_output = NULL, plot_height = c(600L, 200L, 2000L), plot_width = c(1360L, 500L, 2000L), .test = FALSE, transformators = list() ) ui_g_forest_tte( id, adtte_name, mae_name, summary_funs, pre_output, post_output, .test = FALSE ) srv_g_forest_tte( id, data, filter_panel_api, reporter, adtte_name, mae_name, adtte_vars, exclude_assays, summary_funs, plot_height, plot_width, .test = FALSE ) sample_tm_g_forest_tte(.test = FALSE)tm_g_forest_tte( label, adtte_name, mae_name, adtte_vars = list(aval = "AVAL", is_event = "is_event", paramcd = "PARAMCD", usubjid = "USUBJID", avalu = "AVALU"), exclude_assays = "counts", summary_funs = list(Mean = colMeans, Median = matrixStats::colMedians, Max = matrixStats::colMaxs), pre_output = NULL, post_output = NULL, plot_height = c(600L, 200L, 2000L), plot_width = c(1360L, 500L, 2000L), .test = FALSE, transformators = list() ) ui_g_forest_tte( id, adtte_name, mae_name, summary_funs, pre_output, post_output, .test = FALSE ) srv_g_forest_tte( id, data, filter_panel_api, reporter, adtte_name, mae_name, adtte_vars, exclude_assays, summary_funs, plot_height, plot_width, .test = FALSE ) sample_tm_g_forest_tte(.test = FALSE)
label |
( |
adtte_name |
( |
mae_name |
( |
adtte_vars |
(named
|
exclude_assays |
( |
summary_funs |
(named |
pre_output |
( |
post_output |
( |
plot_height |
( |
plot_width |
( |
.test |
( |
transformators |
( |
id |
( |
data |
( |
filter_panel_api |
( |
reporter |
( |
Shiny module to be used in the teal app.
ui_g_forest_tte(): sets up the user interface.
srv_g_forest_tte(): sets up the server with reactive graph.
sample_tm_g_forest_tte(): sample module function.
library(dplyr) data <- teal_data() data <- within(data, { ADTTE <- teal.data::rADTTE %>% dplyr::mutate(is_event = .data$CNSR == 0) MAE <- hermes::multi_assay_experiment }) join_keys(data)["ADTTE", "ADTTE"] <- c("STUDYID", "USUBJID", "PARAMCD") app <- init( data = data, modules = modules( tm_g_forest_tte( label = "forestplot", adtte_name = "ADTTE", mae_name = "MAE" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) } # Alternatively you can run the sample module with this function call: if (interactive()) { sample_tm_g_forest_tte() }library(dplyr) data <- teal_data() data <- within(data, { ADTTE <- teal.data::rADTTE %>% dplyr::mutate(is_event = .data$CNSR == 0) MAE <- hermes::multi_assay_experiment }) join_keys(data)["ADTTE", "ADTTE"] <- c("STUDYID", "USUBJID", "PARAMCD") app <- init( data = data, modules = modules( tm_g_forest_tte( label = "forestplot", adtte_name = "ADTTE", mae_name = "MAE" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) } # Alternatively you can run the sample module with this function call: if (interactive()) { sample_tm_g_forest_tte() }
Kaplan-Meier PlotThis teal module produces a grid style Kaplan-Meier plot for data with
ADaM structure.
tm_g_km( label, adtte_name, mae_name, adtte_vars = list(aval = "AVAL", is_event = "is_event", paramcd = "PARAMCD", usubjid = "USUBJID", avalu = "AVALU"), exclude_assays = "counts", summary_funs = list(Mean = colMeans, Median = matrixStats::colMedians, Max = matrixStats::colMaxs), pre_output = NULL, post_output = NULL, .test = FALSE, transformators = list() ) ui_g_km( id, adtte_name, mae_name, summary_funs, pre_output, post_output, .test = FALSE ) srv_g_km( id, data, filter_panel_api, reporter, adtte_name, mae_name, adtte_vars, summary_funs, exclude_assays, .test = FALSE ) sample_tm_g_km(.test = FALSE)tm_g_km( label, adtte_name, mae_name, adtte_vars = list(aval = "AVAL", is_event = "is_event", paramcd = "PARAMCD", usubjid = "USUBJID", avalu = "AVALU"), exclude_assays = "counts", summary_funs = list(Mean = colMeans, Median = matrixStats::colMedians, Max = matrixStats::colMaxs), pre_output = NULL, post_output = NULL, .test = FALSE, transformators = list() ) ui_g_km( id, adtte_name, mae_name, summary_funs, pre_output, post_output, .test = FALSE ) srv_g_km( id, data, filter_panel_api, reporter, adtte_name, mae_name, adtte_vars, summary_funs, exclude_assays, .test = FALSE ) sample_tm_g_km(.test = FALSE)
label |
( |
adtte_name |
( |
mae_name |
( |
adtte_vars |
(named
|
exclude_assays |
( |
summary_funs |
(named |
pre_output |
( |
post_output |
( |
.test |
( |
transformators |
( |
id |
( |
data |
( |
filter_panel_api |
( |
reporter |
( |
Shiny module to be used in the teal app.
ui_g_km(): sets up the user interface.
srv_g_km(): sets up the user interface.
sample_tm_g_km(): sample module function.
library(dplyr) data <- teal_data() data <- within(data, { ADTTE <- teal.data::rADTTE %>% dplyr::mutate(is_event = .data$CNSR == 0) MAE <- hermes::multi_assay_experiment }) join_keys(data)["ADTTE", "ADTTE"] <- c("STUDYID", "USUBJID", "PARAMCD") modules <- modules( tm_g_km( label = "kaplan-meier", adtte_name = "ADTTE", mae_name = "MAE" ) ) app <- init( data = data, modules = modules ) if (interactive()) { shinyApp(ui = app$ui, server = app$server) } # Alternatively you can run the sample module with this function call: if (interactive()) { sample_tm_g_km() }library(dplyr) data <- teal_data() data <- within(data, { ADTTE <- teal.data::rADTTE %>% dplyr::mutate(is_event = .data$CNSR == 0) MAE <- hermes::multi_assay_experiment }) join_keys(data)["ADTTE", "ADTTE"] <- c("STUDYID", "USUBJID", "PARAMCD") modules <- modules( tm_g_km( label = "kaplan-meier", adtte_name = "ADTTE", mae_name = "MAE" ) ) app <- init( data = data, modules = modules ) if (interactive()) { shinyApp(ui = app$ui, server = app$server) } # Alternatively you can run the sample module with this function call: if (interactive()) { sample_tm_g_km() }
This module provides an interactive principal components plot and an interactive heatmap with correlation of principal components with sample variables.
tm_g_pca( label, mae_name, exclude_assays = character(), pre_output = NULL, post_output = NULL, .test = FALSE, transformators = list() ) ui_g_pca(id, mae_name, pre_output, post_output, .test = FALSE) srv_g_pca( id, data, filter_panel_api, reporter, mae_name, exclude_assays, .test = FALSE ) sample_tm_g_pca(.test = FALSE)tm_g_pca( label, mae_name, exclude_assays = character(), pre_output = NULL, post_output = NULL, .test = FALSE, transformators = list() ) ui_g_pca(id, mae_name, pre_output, post_output, .test = FALSE) srv_g_pca( id, data, filter_panel_api, reporter, mae_name, exclude_assays, .test = FALSE ) sample_tm_g_pca(.test = FALSE)
label |
( |
mae_name |
( |
exclude_assays |
( |
pre_output |
( |
post_output |
( |
.test |
( |
transformators |
( |
id |
( |
data |
( |
filter_panel_api |
( |
reporter |
( |
Shiny module to be used in the teal app.
ui_g_pca(): sets up the user interface.
srv_g_pca(): sets up the server with reactive graph.
sample_tm_g_pca(): sample module function.
data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( tm_g_pca( label = "PCA plot", mae_name = "MAE" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) } # Alternatively you can run the sample module with this function call: if (interactive()) { sample_tm_g_pca() }data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( tm_g_pca( label = "PCA plot", mae_name = "MAE" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) } # Alternatively you can run the sample module with this function call: if (interactive()) { sample_tm_g_pca() }
This module adds quality flags, filters by genes and/or samples,
normalizes AnyHermesData objects and provides interactive plots
for RNA-seq gene expression quality control.
tm_g_quality( label, mae_name, exclude_assays = character(), pre_output = NULL, post_output = NULL, .test = FALSE, transformators = list() ) ui_g_quality(id, mae_name, pre_output, post_output, .test = FALSE) srv_g_quality( id, data, filter_panel_api, reporter, mae_name, exclude_assays, .test = FALSE ) sample_tm_g_quality(.test = FALSE)tm_g_quality( label, mae_name, exclude_assays = character(), pre_output = NULL, post_output = NULL, .test = FALSE, transformators = list() ) ui_g_quality(id, mae_name, pre_output, post_output, .test = FALSE) srv_g_quality( id, data, filter_panel_api, reporter, mae_name, exclude_assays, .test = FALSE ) sample_tm_g_quality(.test = FALSE)
label |
( |
mae_name |
( |
exclude_assays |
( |
pre_output |
( |
post_output |
( |
.test |
( |
transformators |
( |
id |
( |
data |
( |
filter_panel_api |
( |
reporter |
( |
Shiny module to be used in the teal app.
ui_g_quality(): sets up the user interface.
srv_g_quality(): sets up the server with reactive graphs.
sample_tm_g_quality(): sample module function.
data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( tm_g_quality( label = "Quality Control", mae_name = "MAE" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) } # Alternatively you can run the sample module with this function call: if (interactive()) { sample_tm_g_quality() }data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( tm_g_quality( label = "Quality Control", mae_name = "MAE" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) } # Alternatively you can run the sample module with this function call: if (interactive()) { sample_tm_g_quality() }
This module provides an interactive scatterplot for RNA-seq gene expression analysis.
tm_g_scatterplot( label, mae_name, exclude_assays = "counts", summary_funs = list(Mean = colMeans, Median = matrixStats::colMedians, Max = matrixStats::colMaxs), pre_output = NULL, post_output = NULL, .test = FALSE, transformators = list() ) ui_g_scatterplot( id, mae_name, summary_funs, pre_output, post_output, .test = FALSE ) srv_g_scatterplot( id, data, filter_panel_api, reporter, mae_name, exclude_assays, summary_funs, .test = FALSE ) sample_tm_g_scatterplot(.test = FALSE)tm_g_scatterplot( label, mae_name, exclude_assays = "counts", summary_funs = list(Mean = colMeans, Median = matrixStats::colMedians, Max = matrixStats::colMaxs), pre_output = NULL, post_output = NULL, .test = FALSE, transformators = list() ) ui_g_scatterplot( id, mae_name, summary_funs, pre_output, post_output, .test = FALSE ) srv_g_scatterplot( id, data, filter_panel_api, reporter, mae_name, exclude_assays, summary_funs, .test = FALSE ) sample_tm_g_scatterplot(.test = FALSE)
label |
( |
mae_name |
( |
exclude_assays |
( |
summary_funs |
(named |
pre_output |
( |
post_output |
( |
.test |
( |
transformators |
( |
id |
( |
data |
( |
filter_panel_api |
( |
reporter |
( |
Shiny module to be used in the teal app.
ui_g_scatterplot(): sets up the user interface.
srv_g_scatterplot(): sets up the server with reactive graph.
sample_tm_g_scatterplot(): sample module function.
data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( tm_g_scatterplot( label = "scatterplot", mae_name = "MAE" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) } # Alternatively you can run the sample module with this function call: if (interactive()) { sample_tm_g_scatterplot() }data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( tm_g_scatterplot( label = "scatterplot", mae_name = "MAE" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) } # Alternatively you can run the sample module with this function call: if (interactive()) { sample_tm_g_scatterplot() }
This module provides an interactive volcano plot for RNA-seq gene expression analysis.
tm_g_volcanoplot( label, mae_name, exclude_assays = character(), pre_output = NULL, post_output = NULL, .test = FALSE, transformators = list() ) ui_g_volcanoplot(id, mae_name, pre_output, post_output, .test = FALSE) srv_g_volcanoplot( id, data, filter_panel_api, reporter, mae_name, exclude_assays, .test = FALSE ) sample_tm_g_volcanoplot(.test = FALSE)tm_g_volcanoplot( label, mae_name, exclude_assays = character(), pre_output = NULL, post_output = NULL, .test = FALSE, transformators = list() ) ui_g_volcanoplot(id, mae_name, pre_output, post_output, .test = FALSE) srv_g_volcanoplot( id, data, filter_panel_api, reporter, mae_name, exclude_assays, .test = FALSE ) sample_tm_g_volcanoplot(.test = FALSE)
label |
( |
mae_name |
( |
exclude_assays |
( |
pre_output |
( |
post_output |
( |
.test |
( |
transformators |
( |
id |
( |
data |
( |
filter_panel_api |
( |
reporter |
( |
Shiny module to be used in the teal app.
ui_g_volcanoplot(): sets up the user interface.
srv_g_volcanoplot(): sets up the server with reactive graph.
sample_tm_g_volcanoplot(): sample module function.
data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( tm_g_volcanoplot( label = "volcanoplot", mae_name = "MAE" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) } # Alternatively you can run the sample module with this function call: if (interactive()) { sample_tm_g_volcanoplot() }data <- teal_data(MAE = hermes::multi_assay_experiment) app <- init( data = data, modules = modules( tm_g_volcanoplot( label = "volcanoplot", mae_name = "MAE" ) ) ) if (interactive()) { shinyApp(app$ui, app$server) } # Alternatively you can run the sample module with this function call: if (interactive()) { sample_tm_g_volcanoplot() }
This function plots the most expressed genes.
top_gene_plot(object, assay_name)top_gene_plot(object, assay_name)
object |
( |
assay_name |
( |
Plot to be displayed in the teal app.
library(hermes) object <- HermesData(summarized_experiment) result <- top_gene_plot(object, assay_name = "counts")library(hermes) object <- HermesData(summarized_experiment) result <- top_gene_plot(object, assay_name = "counts")
This validation function checks that a given hermes::GeneSpec has at least
one gene selected and that all genes are included in possible choices.
validate_gene_spec(gene_spec, gene_choices)validate_gene_spec(gene_spec, gene_choices)
gene_spec |
( |
gene_choices |
( |
This validation function checks that a given vector x is a factor with
the specified number of levels.
validate_n_levels(x, name, n_levels)validate_n_levels(x, name, n_levels)
x |
( |
name |
( |
n_levels |
( |