R6 Class representing a MultiAssayExperiment
object with its attributes
dataset_class.Rd
Any MultiAssayExperiment
object can be stored inside this MAETealDataset
.
Some attributes like colnames, dimension or column names for a specific type will
be automatically derived.
Any data.frame
object can be stored inside this object.
Some attributes like colnames, dimension or column names for a specific type will
be automatically derived.
Methods
Inherited methods
teal.data::TealDataset$get_attrs()
teal.data::TealDataset$get_character_colnames()
teal.data::TealDataset$get_code()
teal.data::TealDataset$get_code_class()
teal.data::TealDataset$get_dataname()
teal.data::TealDataset$get_datanames()
teal.data::TealDataset$get_dataset()
teal.data::TealDataset$get_dataset_label()
teal.data::TealDataset$get_factor_colnames()
teal.data::TealDataset$get_hash()
teal.data::TealDataset$get_join_keys()
teal.data::TealDataset$get_keys()
teal.data::TealDataset$get_metadata()
teal.data::TealDataset$get_mutate_code_class()
teal.data::TealDataset$get_mutate_vars()
teal.data::TealDataset$get_numeric_colnames()
teal.data::TealDataset$get_raw_data()
teal.data::TealDataset$get_row_labels()
teal.data::TealDataset$get_var_r6()
teal.data::TealDataset$get_vars()
teal.data::TealDataset$is_mutate_delayed()
teal.data::TealDataset$is_pulled()
teal.data::TealDataset$merge_join_keys()
teal.data::TealDataset$mutate()
teal.data::TealDataset$mutate_join_keys()
teal.data::TealDataset$reassign_datasets_vars()
teal.data::TealDataset$recreate()
teal.data::TealDataset$set_code()
teal.data::TealDataset$set_dataset_label()
teal.data::TealDataset$set_join_keys()
teal.data::TealDataset$set_keys()
teal.data::TealDataset$set_vars()
Method new()
Create a new object of MAETealDataset
class
Usage
MAETealDataset$new(
dataname,
x,
keys = character(0),
code = character(0),
label = character(0),
vars = list(),
metadata = NULL
)
Arguments
dataname
(
character
)
A given name for the dataset it may not contain spacesx
(
MultiAssayExperiment
)keys
optional, (
character
)
vector with primary keyscode
(
character
orCodeClass
)
A character string defining the code needed to produce the data set inx
.initialize()
andrecreate()
accept code asCodeClass
also which is needed to preserve the code uniqueness and correct order.label
(
character
)
Label to describe the datasetvars
(named
list
))
In case when this object code depends on otherTealDataset
object(s) or other constant value, this/these object(s) should be included as named element(s) of the list. For example if this object code needsADSL
object we should specifyvars = list(ADSL = <adsl object>)
. It's recommended to includeTealDataset
orTealDatasetConnector
objects to thevars
list to preserve reproducibility. Please note thatvars
are included to this object as localvars
and they cannot be modified within another dataset.metadata
(named
list
orNULL
)
Field containing metadata about the dataset. Each element of the list should be atomic and length one.
Method check()
Check to determine if the raw data is reproducible from the get_code()
code.
Returns
TRUE
if the dataset generated from evaluating the
get_code()
code is identical to the raw data, else FALSE
.
Method check_keys()
Check if keys has been specified correctly for dataset. Set of keys
should distinguish unique rows or be character(0)
.
Method print()
Prints this MAETealDataset
.
Active bindings
raw_data
The data.frame behind this R6 class
data
The data.frame behind this R6 class
var_names
The column names of the data
Methods
Method new()
Create a new object of TealDataset
class
Usage
TealDataset$new(
dataname,
x,
keys = character(0),
code = character(0),
label = character(0),
vars = list(),
metadata = NULL
)
Arguments
dataname
(
character
)
A given name for the dataset it may not contain spacesx
(
data.frame
)keys
optional, (
character
)
Vector with primary keyscode
(
character
)
A character string defining the code needed to produce the data set inx
.initialize()
andrecreate()
accept code asCodeClass
also which is needed to preserve the code uniqueness and correct order.label
(
character
)
Label to describe the datasetvars
(named
list
))
In case when this object code depends on otherTealDataset
object(s) or other constant value, this/these object(s) should be included as named element(s) of the list. For example if this object code needsADSL
object we should specifyvars = list(ADSL = <adsl object>)
. It's recommended to includeTealDataset
orTealDatasetConnector
objects to thevars
list to preserve reproducibility. Please note thatvars
are included to this object as localvars
and they cannot be modified within another dataset.metadata
(named
list
orNULL
)
Field containing metadata about the dataset. Each element of the list should be atomic and length one.
Method recreate()
Recreate this TealDataset
with its current attributes.
Usage
TealDataset$recreate(
dataname = self$get_dataname(),
x = self$get_raw_data(),
keys = self$get_keys(),
code = private$code,
label = self$get_dataset_label(),
vars = list(),
metadata = self$get_metadata()
)
Arguments
dataname
(
character
)
A given name for the dataset it may not contain spacesx
(
data.frame
)keys
optional, (
character
)
Vector with primary keyscode
(
character
)
A character string defining the code needed to produce the data set inx
.initialize()
andrecreate()
accept code asCodeClass
also which is needed to preserve the code uniqueness and correct order.label
(
character
)
Label to describe the datasetvars
(named
list
))
In case when this object code depends on otherTealDataset
object(s) or other constant value, this/these object(s) should be included as named element(s) of the list. For example if this object code needsADSL
object we should specifyvars = list(ADSL = <adsl object>)
. It's recommended to includeTealDataset
orTealDatasetConnector
objects to thevars
list to preserve reproducibility. Please note thatvars
are included to this object as localvars
and they cannot be modified within another dataset.metadata
(named
list
orNULL
)
Field containing metadata about the dataset. Each element of the list should be atomic and length one.
Method print()
Prints this TealDataset
.
Method get_dataset()
Performs any delayed mutate calls before returning self.
Method get_attrs()
Get all dataset attributes
Method get_raw_data()
Derive the raw data frame inside this object
Method get_dataname()
Derive the name
which was formerly called dataname
Method get_dataset_label()
Derive the label
which was former called datalabel
Method get_keys()
Get primary keys of dataset
Method get_hash()
Returns the string representation of the raw data hashed with the MD5 hash algorithm.
Method get_var_r6()
Get the list of dependencies that are TealDataset
or TealDatasetConnector
objects
Method reassign_datasets_vars()
Overwrites TealDataset
or TealDatasetConnector
dependencies of this TealDataset
with
those found in datasets
. Reassignment
refers only to the provided datasets
, other vars
remains the same.
Arguments
datasets
(
named list
ofTealDataset(s)
orTealDatasetConnector(s)
)
objects with valid pointers.
Details
Reassign vars
in this object to keep references up to date after deep clone.
Update is done based on the objects passed in datasets
argument.
Overwrites dependencies with names matching the names of the objects passed
in datasets
.
Examples
test_dataset <- teal.data:::TealDataset$new(
dataname = "iris",
x = iris,
vars = list(dep = teal.data:::TealDataset$new("iris2", iris))
)
test_dataset$reassign_datasets_vars(
list(iris2 = teal.data:::TealDataset$new("iris2", head(iris)))
)
Method set_keys()
Set new keys
Method set_join_keys()
set join_keys for a given dataset and object
Method mutate_join_keys()
mutate the join_keys for a given dataset and object
Method set_code()
Sets reproducible code
Method get_code()
Get code to get data
Method get_code_class()
Get internal CodeClass
object
Method mutate()
Mutate dataset by code
Usage
TealDataset$mutate(code, vars = list(), force_delay = FALSE)
Method check()
Check to determine if the raw data is reproducible from the get_code()
code.
Returns
TRUE
if the dataset generated from evaluating the
get_code()
code is identical to the raw data, else FALSE
.
Method check_keys()
Check if keys has been specified correctly for dataset. Set of keys
should distinguish unique rows or be character(0)
.
Method is_pulled()
Check if dataset has already been pulled.
Examples
## ------------------------------------------------
## Method `TealDataset$reassign_datasets_vars`
## ------------------------------------------------
test_dataset <- teal.data:::TealDataset$new(
dataname = "iris",
x = iris,
vars = list(dep = teal.data:::TealDataset$new("iris2", iris))
)
test_dataset$reassign_datasets_vars(
list(iris2 = teal.data:::TealDataset$new("iris2", head(iris)))
)