| Clarion | R Documentation |
Use this to create a clarion object. This object is used by all top-level wilson modules.
Clarion$new(header = NULL, metadata, data, validate = TRUE)
| Variable | Return |
header | A named list. Defaults to NULL. |
metadata | Clarion metadata in form of a data.table. |
data | Data.table according to metadata. |
validate | Logical value to validate on initialization. Defaults to TRUE. |
headerList of global information regarding the whole experiment.
metadataData.table with additional information for each column.
dataData.table containing experiment result data.
Clarion$get_id()Returns name of unique identifier column. Assumes first feature to be unique if not specified.
Clarion$get_id()
Name of the id column.
Clarion$get_name()Returns name of name column. If not specified return unique Id.
Clarion$get_name()
Name of the name column.
Clarion$get_delimiter()Return delimiter used within multi-value fields (no delimiter = NULL).
Clarion$get_delimiter()
Clarion$is_delimited()Logical whether the given column name is delimited.
Clarion$is_delimited(x)
xName of the column.
boolean
Clarion$get_factors()Get factors to all columns.
Clarion$get_factors()
Named factors (e.g. factor1="name") will be cropped to their name.
Returns a data.table columns: key and factor(s) if any.
Clarion$get_level()Get level(s) to given column name(s).
Clarion$get_level(column)
columnOne or more column name(s).
Provide a vector of levels to the given columnnames in column. Returns NA for missing columns and character(0) if column = NULL.
Clarion$get_label()Get label(s) to given column name(s).
Clarion$get_label(column = NULL, sub_label = TRUE, sep = " ")
columnOne or more column name(s).
sub_labelWhether the sub_label should be included.
sepSeparator between label and sub_label.
If a column does not have a label the key is returned.
Provides a vector of labels (+ sub_label) to the given columnnames in column. Returns NA for missing columns and all labels if column = NULL.
Clarion$validate()Check the object for inconsistencies.
Clarion$validate(solve = TRUE)
solveFor solve = TRUE try to resolve some warnings.
Clarion$new()Initialize a new clarion object.
Clarion$new(header = NULL, metadata, data, validate = TRUE)
headerA named list. Defaults to NULL.
metadataClarion metadata in form of a data.table.
dataData.table according to metadata.
validateLogical value to validate on initialization. Defaults to TRUE.
Clarion object.
Clarion$write()Save the object as a clarion file.
Clarion$write(file)
fileFilename for the file to be written.
Clarion$clone()The objects of this class are cloneable with this method.
Clarion$clone(deep = FALSE)
deepWhether to make a deep clone.
# generate clarion contents
header <- list(format = "Clarion", version = "1.0", experiment_id = "123456")
metadata <- data.table::as.data.table(list(
key = c("id", "name", "sample_a", "sample_b"),
factor1 = c("", "", "sample_a", "sample_b"),
level = c("feature", "feature", "sample", "sample"),
type = c("unique_id", "name", "score", "score"),
label = c("Identifier", "Name", "Sample A", "Sample B")
))
data <- data.table::data.table(
id = c("id_1", "id_2", "id_3"),
name = c("AAA", "BBB", "CCC"),
sample_a = c(10000, 300, 20),
sample_b = c(50, 40000, 12002)
)
# initializing a new object
object <- Clarion$new(header = header, metadata = metadata, data = data, validate = TRUE)
# create a deep copy
object_copy <- object$clone(deep = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.