Skip to contents

Encode using run-length encoding

Usage

encode(x, ...)

# S4 method for SummarizedExperiment
encode(x)

Arguments

x

Object.

...

Additional arguments.

Value

Modified object. All atomic columns will be encoded to Rle S4 class.

Note

Updated 2021-02-03.

See also

Examples

data(RangedSummarizedExperiment, package = "AcidTest")

## SummarizedExperiment ====
## This works on rowData and colData.
object <- RangedSummarizedExperiment
object <- encode(object)
lapply(
    X = SummarizedExperiment::rowData(object),
    FUN = class
)
#> $broadClass
#> [1] "Rle"
#> attr(,"package")
#> [1] "S4Vectors"
#> 
#> $description
#> [1] "Rle"
#> attr(,"package")
#> [1] "S4Vectors"
#> 
#> $geneBiotype
#> [1] "Rle"
#> attr(,"package")
#> [1] "S4Vectors"
#> 
#> $geneId
#> [1] "Rle"
#> attr(,"package")
#> [1] "S4Vectors"
#> 
#> $geneIdNoVersion
#> [1] "Rle"
#> attr(,"package")
#> [1] "S4Vectors"
#> 
#> $geneIdVersion
#> [1] "Rle"
#> attr(,"package")
#> [1] "S4Vectors"
#> 
#> $geneName
#> [1] "Rle"
#> attr(,"package")
#> [1] "S4Vectors"
#> 
#> $geneSynonyms
#> [1] "CompressedCharacterList"
#> attr(,"package")
#> [1] "IRanges"
#> 
#> $ncbiGeneId
#> [1] "CompressedIntegerList"
#> attr(,"package")
#> [1] "IRanges"
#> 
#> $seqCoordSystem
#> [1] "Rle"
#> attr(,"package")
#> [1] "S4Vectors"
#>