Learn R Programming

Seurat (version 2.1.0)

MakeSparse: Make object sparse

Description

Converts stored data matrices to sparse matrices to save space. Converts object@raw.data and object@data to sparse matrices.

Usage

MakeSparse(object)

Arguments

object

Seurat object

Value

Returns a seurat object with data converted to sparse matrices.

Examples

Run this code
# NOT RUN {
pbmc_raw <- read.table(
  file = system.file('extdata', 'pbmc_raw.txt', package = 'Seurat'),
  as.is = TRUE
)
pbmc_small <- CreateSeuratObject(raw.data = pbmc_raw)
class(x = pbmc_small@raw.data)
pbmc_small <- MakeSparse(object = pbmc_small)
class(x = pbmc_small@raw.data)

# }

Run the code above in your browser using DataLab