Learn R Programming

GeneNMF (version 0.8.0)

getDataMatrix: Extract data matrix from Seurat object

Description

Get the gene expression matrix from a Seurat object, optionally centered and/or subset on highly variable genes

Usage

getDataMatrix(
  obj,
  assay = "RNA",
  slot = "data",
  hvg = NULL,
  center = FALSE,
  scale = FALSE,
  non_negative = TRUE
)

Value

Returns a sparse data matrix (cells per genes), subset according to the given parameters

Arguments

obj

Seurat object

assay

Get data matrix from this assay

slot

Get data matrix from this slot (=layer)

hvg

List of variable genes to subset the matrix. If NULL, uses all genes

center

Whether to center the data matrix

scale

Whether to scale the data matrix

non_negative

Enforce non-negative values for NMF

Examples

Run this code
data(sampleObj)
matrix <- getDataMatrix(sampleObj)

Run the code above in your browser using DataLab