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", exact = TRUE)
)

Arguments

dataset

any object

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 FilteredDataset, invisibly.


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

The formatted character string.


Method print()

Prints this FilteredDataset object.

Usage

FilteredDataset$print(...)

Arguments

...

additional arguments passed to format.


Method clear_filter_states()

Removes all filter items applied to this dataset.

Usage

FilteredDataset$clear_filter_states(force = FALSE)

Arguments

force

(logical(1)) flag specifying whether to include anchored filter states.

Returns

NULL.


Method get_call()

Gets a filter expression.

This function 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, the method returns code containing conditions calls of FilterState objects with sid different to this sid argument.

Returns

Either a list of filter calls, or NULL.


Method get_filter_state()

Gets states of all contained 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_slices)

Returns

Virtual method, returns nothing and raises error.


Method get_filter_count()

Gets the number of 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

A character string.


Method get_dataset()

Gets the dataset object in this FilteredDataset.

Usage

FilteredDataset$get_dataset(filtered = FALSE)

Arguments

filtered

(logical(1))

Returns

The stored dataset. If data.frame or MultiAssayExperiment, either raw or as a reactive with current filters applied (depending on filtered).


Method get_filter_overview()

Get filter overview of a dataset.

Usage

FilteredDataset$get_filter_overview()

Returns

Virtual method, returns nothing and raises an error.


Method get_keys()

Gets the key columns for this dataset.

Usage

FilteredDataset$get_keys()

Returns

Character vector of variable names


Method get_dataset_label()

Gets the dataset label.

Usage

FilteredDataset$get_dataset_label()

Returns

Character string.


Method ui_active()

shiny module containing active filters for a dataset, along with a title and a remove button.

Usage

FilteredDataset$ui_active(id)

Arguments

id

(character(1)) shiny module instance id.

Returns

shiny.tag


Method srv_active()

Server module for a dataset active filters.

Usage

FilteredDataset$srv_active(id)

Arguments

id

(character(1)) shiny module instance id.

Returns

NULL.


Method ui_add()

UI module to add filter variable for this dataset.

Usage

FilteredDataset$ui_add(id)

Arguments

id

(character(1)) shiny module instance id.

Returns

Virtual method, returns nothing and raises error.


Method srv_add()

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)) shiny module instance id.

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.