Set motif matrix for given assay

SetMotifData(object, ...)

# S3 method for Motif
SetMotifData(object, slot, new.data, ...)

# S3 method for ChromatinAssay
SetMotifData(object, slot, new.data, ...)

# S3 method for Seurat
SetMotifData(object, assay = NULL, ...)

Arguments

object

A Seurat object

...

Arguments passed to other methods

slot

Name of slot to use

new.data

motif matrix to add. Should be matrix or sparse matrix class

assay

Name of assay whose data should be set

Value

Returns a Seurat object

Examples

motif.obj <- SeuratObject::GetAssayData(
  object = atac_small[['peaks']], slot = "motifs"
)
SetMotifData(object = motif.obj, slot = 'data', new.data = matrix(1:2))
#> A Motif object containing 1 motifs in 2 regions
SetMotifData(
  object = atac_small[['peaks']], slot = 'data', new.data = matrix(1:2)
)
#> ChromatinAssay data with 323 features for 100 cells
#> Variable features: 323 
#> Genome: hg19 
#> Annotation present: TRUE 
#> Motifs present: TRUE 
#> Fragment files: 0 
motif.matrix <- GetMotifData(object = atac_small)
SetMotifData(
object = atac_small, assay = 'peaks', slot = 'data', new.data = motif.matrix
)
#> An object of class Seurat 
#> 1323 features across 100 samples within 3 assays 
#> Active assay: peaks (323 features, 323 variable features)
#>  2 other assays present: bins, RNA
#>  2 dimensional reductions calculated: lsi, umap