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 get_formatted_filter_state()

Returns a string representation of the filter state in this FilteredDataset.

Usage

FilteredDataset$get_formatted_filter_state()

Returns

character(1) the formatted string representing the filter state


Method queues_empty()

Removes all active filter items applied to this dataset

Usage

FilteredDataset$queues_empty()

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()

Returns

filter call or list of filter calls Gets the reactive values from the active FilterState objects.

Get all active filters from this dataset in form of the nested list. The output list is a compatible input to self$set_filter_state.


Method get_filter_state()

Usage

FilteredDataset$get_filter_state()

Returns

list with named elements corresponding to FilterStates objects with active filters.


Method get_filter_states()

Gets the active FilterStates objects.

Usage

FilteredDataset$get_filter_states(id = character(0))

Arguments

id

(character(1), character(0))
the id of the private$filter_states list element where FilterStates is kept.

Returns

FilterStates or list of FilterStates objects.


Method get_dataname()

Get name of the dataset

Get 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()

Returns

data.frame or MultiAssayExperiment


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_info()

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_info(filtered_dataset = self$get_dataset())

Arguments

filtered_dataset

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

Returns

(matrix) matrix of observations and subjects


Method get_hash()

Returns the hash of the dataset

Usage

FilteredDataset$get_hash()

Returns

(character(1)) the hash


Method get_keys()

Gets the keys for the dataset of this FilteredDataset

Usage

FilteredDataset$get_keys()

Returns

(character) the keys of dataset


Method get_varlabels()

Gets labels of variables in the data

Variables are the column names of the data. Either, all labels must have been provided for all variables in set_data or NULL.

Usage

FilteredDataset$get_varlabels(variables = NULL)

Arguments

variables

(character vector) variables to get labels for; if NULL, for all variables in data

Returns

(character or NULL) variable labels, NULL if column_labels attribute does not exist for the data


Method get_dataset_label()

Gets the dataset label

Usage

FilteredDataset$get_dataset_label()

Returns

(character) the dataset label


Method get_varnames()

Gets variable names from dataset

Usage

FilteredDataset$get_varnames()

Returns

character the variable names


Method get_filtered_dataname()

Gets the suffixed dataname Used when filtering the data to get <dataname>_FILTERED, <dataname>_FILTERED_ALONE or any other name.

Usage

FilteredDataset$get_filtered_dataname(
  dataname = self$get_dataname(),
  suffix = "_FILTERED"
)

Arguments

dataname

(character(1)) dataname

suffix

(character(1)) string to be putted after dataname

Returns

character(1)


Method get_filterable_varnames()

Gets variable names for the filtering.

Usage

FilteredDataset$get_filterable_varnames()

Returns

(character vector) of variable names


Method ui()

UI module for dataset active filters

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

Usage

FilteredDataset$ui(id)

Arguments

id

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

Returns

function - shiny UI module


Method server()

Server module for a dataset active filters

Server module managing a active filters.

Usage

FilteredDataset$server(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_filter_state()

UI module to add filter variable for this dataset

UI module to add filter variable for this dataset

Usage

FilteredDataset$ui_add_filter_state(id)

Arguments

id

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

Returns

function - shiny UI module


Method srv_add_filter_state()

Server module to add filter variable for this dataset

Server module to add filter variable for this dataset

Usage

FilteredDataset$srv_add_filter_state(id, ...)

Arguments

id

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

...

ignored

Returns

moduleServer function.


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.