addProcessedMatrix.Rd
Adds a processed matrix to the chosen molecular assay of the object.
addProcessedMatrix(
object,
proc_mtr,
mtr_name,
assay_name = activeAssay(object),
overwrite = FALSE,
...
)
An object of class SPATA2
or, in case of S4 generics,
objects of classes for which a method has been defined.
A character value that denotes the name of the matrix with
which one can refer to it in subsequent functions via mtr_name
.
Only relevant if the SPATA2
object contains more than
one assay: Denotes the assay of interest and thus the
molecular modality to use. Defaults to the active assay
as set by activateAssay()
.
Logical value. Must be TRUE
to allow overwriting.
Used to absorb deprecated arguments or functions.
A matrix in which the rownames correspond to the feature names and the column names correspond to the barcodes.
The updated input object, containing the added, removed or computed results.
library(SPATA2)
library(tidyverse)
data("example_data")
object <- example_data$object_UKF275T_diet
library(Seurat)
scaled_mtr <-
CreateSeuratObject(getCountMatrix(object)) %>%
NormalizeData() %>%
ScaleData() %>%
GetAssayData(layer = "scale.data")
object <- addProcessedMatrix(object, proc_mtr = scaled_mtr, mtr_name = "scaled")
p1 <- plotSurface(object, color_by = "METRN")
object <- activateMatrix(object, mtr_name = "scaled")
p2 <- plotSurface(object, color_by = "METRN")
plot(p1)
plot(p2)