Skip to contents

Replaces the experimental groups of the samples of a ScreenR object. A warning is given when the number of groups differs from the number of samples.

Usage

set_groups(object, groups)

# S4 method for class 'screenr_object'
set_groups(object, groups)

Arguments

object

The ScreenR object obtained using create_screenr_object.

groups

A factor (or a vector, which is converted to a factor) with the group of each sample, for example "Control" and "Treated".

Value

The ScreenR object with the new groups.

Examples

object <- get0("object", envir = asNamespace("ScreenR"))
groups <- get_groups(object)
set_groups(object, groups)
#> class: screenr_object 
#> dim: 5320 14 
#> metadata(2): screenr_layout normalization
#> assays(1): counts
#> rownames(5320): 10208 10502 ... 13876 13995
#> rowData names(5): Barcode Gene Gene_ID Sequence Library
#> colnames(14): T1 T2 ... Time4_B Time4_c
#> colData names(5): Sample Day Treatment EffectiveLibSize Group
#> normalization: cpm (effective library sizes in colData(object)$EffectiveLibSize)