query_qMetacell: Build queries for filtering quantitative metadata

query_qMetacellR Documentation

Build queries for filtering quantitative metadata

Description

This function is a shiny module to create a list of queries (instances of the class FunctionFilter to filter the quantitative metadata of an instance of the class SummarizedExperiment)

Usage

mod_build_qMetacell_FunctionFilter_ui(id)

mod_build_qMetacell_FunctionFilter_server(
  id,
  obj,
  conds,
  list_tags = reactive({
     NULL
 }),
  keep_vs_remove = reactive({
     NULL
 }),
  val_vs_percent = reactive({
     NULL
 }),
  operator = reactive({
     NULL
 }),
  reset = reactive({
     NULL
 }),
  is.enabled = reactive({
     TRUE
 })
)

Arguments

id

xxx

obj

An instance of the class SummarizedExperiment

conds

A character() which contains the name of the conditions. The length of this vector must be equal to the number of samples in the assay (i.e. number of columns in àssay(obj))

list_tags

xxx

keep_vs_remove

xxx

val_vs_percent

xxx

operator

xxx

reset

A ìnteger(1) xxxx

is.enabled

A logical(1) that indicates whether the module is enabled or disabled. This is a remote command.

Value

As for all modules used with MagellanNTK, the return value is a list() of two items:

  • trigger : xxx

  • value: In this case, it contains a list() of three slots:

    • ll.fun: a list() of instances of the class FunctionFilter,

    • ll.query: a list of character() which describe the queries in natural language,

    • ll.widgets.value: a list of the values of widgets.

Examples

if (interactive()) {
    data(ft_na, package='DaparToolshed')
    ui <- mod_build_qMetacell_FunctionFilter_ui("query")

    server <- function(input, output, session) {
        rv <- reactiveValues(
            res = NULL
        )
        ll.tags <- c(
            "None" = "None",
            qMetacell.def(typeDataset(ft_na[[1]]))$node
        )
        rv.custom$res <- mod_build_qMetacell_FunctionFilter_server("query",
            obj = reactive({
                ft_na[[1]]
            }),
            conds = reactive({
                colData(ft_na)$Condition
            }),
            list_tags = reactive({
                ll.tags
            }),
            keep_vs_remove = reactive({
                setNames(nm = c("delete", "keep"))
            }),
            val_vs_percent = reactive({
                setNames(nm = c("Count", "Percentage"))
            }),
            operator = reactive({
                setNames(nm = SymFilteringOperators())
            })
        )


        observeEvent(rv.custom$res$dataOut()$trigger, ignoreNULL = TRUE, 
        ignoreInit = TRUE, {
            print(rv.custom$res$dataOut()$fun)
        })
    }

    shinyApp(ui = ui, server = server)
}

samWieczorek/Dapar2 documentation built on Oct. 12, 2023, 9:54 a.m.