Improved assignment method support for bcbioRNASeq object.

This method support will also update the colData inside the bcbio and assays slots.

# S4 method for bcbioRNASeq,DataFrame
colData(x, ...) <- value

Arguments

x

Object.

...

Additional arguments (for the S4 generic definition).

value

Value to assign.

See also

help("colData", "SummarizedExperiment")

Examples

load(system.file( file.path("extdata", "bcb.rda"), package = "bcbioRNASeq")) # Assignment support colData <- colData(bcb) colData[["age"]] <- factor(c(14, 30, 14, 30)) colData(bcb) <- colData colData(bcb) %>% glimpse()
#> Formal class 'DataFrame' [package "S4Vectors"] with 6 slots #> ..@ rownames : chr [1:4] "group1_1" "group1_2" "group2_1" "group2_2" #> ..@ nrows : int 4 #> ..@ listData :List of 5 #> .. ..$ sampleID : Factor w/ 4 levels "group1_1","group1_2",..: 1 2 3 4 #> .. ..$ sampleName : Factor w/ 4 levels "group1_1","group1_2",..: 1 2 3 4 #> .. ..$ description: Factor w/ 4 levels "group1_1","group1_2",..: 1 2 3 4 #> .. ..$ group : Factor w/ 2 levels "ctrl","ko": 1 1 2 2 #> .. ..$ age : Factor w/ 2 levels "14","30": 1 2 1 2 #> ..@ elementType : chr "ANY" #> ..@ elementMetadata: NULL #> ..@ metadata : list()
# These internal objects will also get updated bcbio(bcb, "DESeqDataSet") %>% colData() %>% glimpse()
#> Formal class 'DataFrame' [package "S4Vectors"] with 6 slots #> ..@ rownames : chr [1:4] "group1_1" "group1_2" "group2_1" "group2_2" #> ..@ nrows : int 4 #> ..@ listData :List of 5 #> .. ..$ sampleID : Factor w/ 4 levels "group1_1","group1_2",..: 1 2 3 4 #> .. ..$ sampleName : Factor w/ 4 levels "group1_1","group1_2",..: 1 2 3 4 #> .. ..$ description: Factor w/ 4 levels "group1_1","group1_2",..: 1 2 3 4 #> .. ..$ group : Factor w/ 2 levels "ctrl","ko": 1 1 2 2 #> .. ..$ age : Factor w/ 2 levels "14","30": 1 2 1 2 #> ..@ elementType : chr "ANY" #> ..@ elementMetadata: NULL #> ..@ metadata : list()
assays(bcb)[["rlog"]] %>% colData() %>% glimpse()
#> Formal class 'DataFrame' [package "S4Vectors"] with 6 slots #> ..@ rownames : chr [1:4] "group1_1" "group1_2" "group2_1" "group2_2" #> ..@ nrows : int 4 #> ..@ listData :List of 5 #> .. ..$ sampleID : Factor w/ 4 levels "group1_1","group1_2",..: 1 2 3 4 #> .. ..$ sampleName : Factor w/ 4 levels "group1_1","group1_2",..: 1 2 3 4 #> .. ..$ description: Factor w/ 4 levels "group1_1","group1_2",..: 1 2 3 4 #> .. ..$ group : Factor w/ 2 levels "ctrl","ko": 1 1 2 2 #> .. ..$ age : Factor w/ 2 levels "14","30": 1 2 1 2 #> ..@ elementType : chr "ANY" #> ..@ elementMetadata: NULL #> ..@ metadata : list()
assays(bcb)[["vst"]] %>% colData() %>% glimpse()
#> Formal class 'DataFrame' [package "S4Vectors"] with 6 slots #> ..@ rownames : chr [1:4] "group1_1" "group1_2" "group2_1" "group2_2" #> ..@ nrows : int 4 #> ..@ listData :List of 5 #> .. ..$ sampleID : Factor w/ 4 levels "group1_1","group1_2",..: 1 2 3 4 #> .. ..$ sampleName : Factor w/ 4 levels "group1_1","group1_2",..: 1 2 3 4 #> .. ..$ description: Factor w/ 4 levels "group1_1","group1_2",..: 1 2 3 4 #> .. ..$ group : Factor w/ 2 levels "ctrl","ko": 1 1 2 2 #> .. ..$ age : Factor w/ 2 levels "14","30": 1 2 1 2 #> ..@ elementType : chr "ANY" #> ..@ elementMetadata: NULL #> ..@ metadata : list()