Skip to contents

FilteredDataset is a class which renders/controls FilterStates(s) Each FilteredDataset contains filter_states field - a list which contains one (data.frame) or multiple (MultiAssayExperiment) FilterStates objects. Each FilterStates is responsible for one filter/subset expression applied for specific components of the dataset.

Methods


Method new()

Initializes this FilteredDataset object

Usage

FilteredDataset$new(
  dataset,
  dataname,
  keys = character(0),
  label = attr(dataset, "label"),
  metadata = NULL
)

Arguments

dataset

(data.frame or MultiAssayExperiment)
single dataset for which filters are rendered

dataname

(character(1))
A given name for the dataset it may not contain spaces

keys

optional, (character)
Vector with primary keys

label

(character(1))
Label to describe the dataset

metadata

(named list or NULL)
Field containing metadata about the dataset. Each element of the list should be atomic and length one.


Method format()

Returns a formatted string representing this FilteredDataset object.

Usage

FilteredDataset$format(show_all = FALSE, trim_lines = TRUE)

Arguments

show_all

logical(1) passed to format.teal_slice

trim_lines

logical(1) passed to format.teal_slice

Returns

character(1) the formatted string


Method print()

Prints this FilteredDataset object.

Usage

FilteredDataset$print(...)

Arguments

...

additional arguments


Method clear_filter_states()

Removes all active filter items applied to this dataset

Usage

FilteredDataset$clear_filter_states(force = FALSE)

Arguments

force

(logical(1))
include locked filter states

Returns

NULL


Method get_call()

Gets a filter expression

This functions returns filter calls equivalent to selected items within each of filter_states. Configuration of the calls is constant and depends on filter_states type and order which are set during initialization.

Usage

FilteredDataset$get_call(sid = "")

Arguments

sid

(character)
when specified then method returns code containing filter conditions of FilterState objects which "sid" attribute is different than this sid argument.

Returns

filter call or list of filter calls


Method get_filter_state()

Gets states of all active FilterState objects

Usage

FilteredDataset$get_filter_state()

Returns

A teal_slices object.


Method set_filter_state()

Set filter state

Usage

FilteredDataset$set_filter_state(state)

Arguments

state

(teal_slice) object

Returns

NULL invisibly


Method get_filter_count()

Gets the number of active FilterState objects in all FilterStates in this FilteredDataset.

Usage

FilteredDataset$get_filter_count()

Returns

integer(1)


Method get_dataname()

Gets the name of the dataset

Usage

FilteredDataset$get_dataname()

Returns

character(1) as a name of this dataset


Method get_dataset()

Gets the dataset object in this FilteredDataset

Usage

FilteredDataset$get_dataset(filtered = FALSE)

Arguments

filtered

(logical(1))

Returns

data.frame or MultiAssayExperiment, either raw or as a reactive with current filters applied


Method get_metadata()

Gets the metadata for the dataset in this FilteredDataset

Usage

FilteredDataset$get_metadata()

Returns

named list or NULL


Method get_filter_overview()

Get filter overview rows of a dataset The output shows the comparison between filtered_dataset function parameter and the dataset inside self

Usage

FilteredDataset$get_filter_overview()

Arguments

filtered_dataset

comparison object, of the same class as self$get_dataset(), if NULL then self$get_dataset() is used.

Returns

(data.frame) matrix of observations and subjects


Method get_keys()

Gets the keys for the dataset of this FilteredDataset

Usage

FilteredDataset$get_keys()

Returns

(character) the keys of dataset


Method get_dataset_label()

Gets the dataset label

Usage

FilteredDataset$get_dataset_label()

Returns

(character) the dataset label


Method ui_active()

UI module for dataset active filters

UI module containing dataset active filters along with title and remove button.

Usage

FilteredDataset$ui_active(id)

Arguments

id

(character(1))
identifier of the element - preferably containing dataset name

Returns

function - shiny UI module


Method srv_active()

Server module for a dataset active filters

Server module managing a active filters.

Usage

FilteredDataset$srv_active(id)

Arguments

id

(character(1))
an ID string that corresponds with the ID used to call the module's UI function.

Returns

moduleServer function which returns NULL


Method ui_add()

UI module to add filter variable for this dataset

UI module to add filter variable for this dataset

Usage

FilteredDataset$ui_add(id)

Arguments

id

(character(1))
identifier of the element - preferably containing dataset name

Returns

function - shiny UI module


Method srv_add()

Server module to add filter variable for this dataset

Server module to add filter variable for this dataset. For this class srv_add calls multiple modules of the same name from FilterStates as MAEFilteredDataset contains one FilterStates object for colData and one for each experiment.

Usage

FilteredDataset$srv_add(id)

Arguments

id

(character(1))
an ID string that corresponds with the ID used to call the module's UI function.

Returns

moduleServer function which returns NULL


Method clone()

The objects of this class are cloneable with this method.

Usage

FilteredDataset$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.