MAEFilteredDataset: 'MAEFilteredDataset' 'R6' class

MAEFilteredDatasetR Documentation

MAEFilteredDataset R6 class

Description

MAEFilteredDataset R6 class

MAEFilteredDataset R6 class

Super class

teal.slice::FilteredDataset -> MAEFilteredDataset

Methods

Public methods

Inherited methods

Method new()

Initialize MAEFilteredDataset object.

Usage
MAEFilteredDataset$new(
  dataset,
  dataname,
  keys = character(0),
  label = character(0)
)
Arguments
dataset

(MulitiAssayExperiment) single MulitiAssayExperiment for which filters are rendered.

dataname

(character(1)) syntactically valid name given to the dataset.

keys

(character) optional vector of primary key column names.

label

(character(1)) label to describe the dataset.

Returns

Object of class MAEFilteredDataset, invisibly.


Method set_filter_state()

Set filter state.

Usage
MAEFilteredDataset$set_filter_state(state)
Arguments
state

(teal_slices)

Returns

NULL, invisibly.


Method remove_filter_state()

Remove one or more FilterState of a MAEFilteredDataset.

Usage
MAEFilteredDataset$remove_filter_state(state)
Arguments
state

(teal_slices) specifying FilterState objects to remove; teal_slices may contain only dataname and varname, other elements are ignored.

Returns

NULL, invisibly.


Method ui_add()

UI module to add filter variable for this dataset.

Usage
MAEFilteredDataset$ui_add(id)
Arguments
id

(character(1)) shiny module instance id.

Returns

shiny.tag


Method get_filter_overview()

Creates row for filter overview in the form of
dataname -- observations (remaining/total) -- subjects (remaining/total) - MAE

Usage
MAEFilteredDataset$get_filter_overview()
Returns

A data.frame.


Method clone()

The objects of this class are cloneable with this method.

Usage
MAEFilteredDataset$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples


# use non-exported function from teal.slice
MAEFilteredDataset <- getFromNamespace("MAEFilteredDataset", "teal.slice")

data(miniACC, package = "MultiAssayExperiment")
dataset <- MAEFilteredDataset$new(miniACC, "MAE")
fs <- teal_slices(
  teal_slice(
    dataname = "MAE", varname = "years_to_birth", selected = c(30, 50), keep_na = TRUE
  ),
  teal_slice(
    dataname = "MAE", varname = "vital_status", selected = "1", keep_na = FALSE
  ),
  teal_slice(
    dataname = "MAE", varname = "gender", selected = "female", keep_na = TRUE
  ),
  teal_slice(
    dataname = "MAE", varname = "ARRAY_TYPE", selected = "", keep_na = TRUE
  )
)
dataset$set_filter_state(state = fs)

library(shiny)
isolate(dataset$get_filter_state())


teal.slice documentation built on May 29, 2024, 1:39 a.m.