Sets and extracts the active (default) matrix name of a MolecularAssay.

activateMatrix(
  object,
  mtr_name,
  assay_name = activeAssay(object),
  verbose = NULL
)

activeMatrix(object, assay_name = activeAssay(object))

Arguments

object

An object of class SPATA2 or, in case of S4 generics, objects of classes for which a method has been defined.

mtr_name

Character value. The name of the matrix to activate as the default matrix.

assay_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().

verbose

Logical. If TRUE, informative messages regarding the computational progress will be printed.

(Warning messages will always be printed.)

Value

  • activateMatrix(): Updated SPATA2 object.

  • activeMatrix(): Character value. Name of the currently active matrix in the respective assay.

Examples


library(SPATA2)
library(ggplot2)

data("example_data")

object <- example_data$object_UKF275T_diet

object <- normalizeCounts(object, mtr_name = "LogNormalize")

p1 <- plotSurface(object, color_by = "METRN") + labs(subtitle = activeMatrix(object))

object <- activateMatrix(object, mtr_name = "LogNormalize")

p2 <- plotSurface(object, color_by = "METRN") + labs(subtitle = activeMatrix(object))

plot(p1)
plot(p2)