Learn R Programming

Seurat (version 3.1.1)

SetAssayData: Setter for multimodal data

Description

Setter for multimodal data

Usage

SetAssayData(object, ...)

# S3 method for Assay SetAssayData(object, slot, new.data, ...)

# S3 method for Seurat SetAssayData(object, slot = "data", new.data, assay = NULL, ...)

Arguments

object

An object

...

Arguments passed to other methods

slot

Where to store the new data

new.data

New data to insert

assay

Name of assay whose data should be set

Value

object with the assay data set

Examples

Run this code
# NOT RUN {
# Set an Assay slot directly
count.data <- GetAssayData(object = pbmc_small[["RNA"]], slot = "counts")
count.data <- as.matrix(x = count.data + 1)
new.assay <- SetAssayData(object = pbmc_small[["RNA"]], slot = "counts", new.data = count.data)

# Set an Assay slot through the Seurat object
count.data <- GetAssayData(object = pbmc_small[["RNA"]], slot = "counts")
count.data <- as.matrix(x = count.data + 1)
new.seurat.object <- SetAssayData(
    object = pbmc_small,
    slot = "counts",
    new.data = count.data,
    assay = "RNA"
)

# }

Run the code above in your browser using DataLab