Extracts results of identifyVariableMolecules().

getVariableMolecules(object, method = NULL, 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.

method

Character value or NULL. If NULL and there are only variable features stored for one method these results are returned, else the method must be specified.

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

Value

Character vector.

Examples


library(SPATA2)
data("example_data")

object <- loadExampleObject("UKF269T")

# default is method = 'vst'
object <- identifyVariableMolecules(object, n_mol = 2000)

# multiple results can be stored simultaneously
object <- identifyVariableMolecules(object, n_mol = 3000, method = "mean.var.plot")

# fails, cause results for two methods are stored and method = NULL
vars_vst <- getVariableMolecules(object)

vars_vst <- getVariableMoleculs(object, method = "vst") # works

# should work
vars_mvp <- getVariableMolecules(object, method = "mean.var.plot")

length(vars_vst)
length(vars_mvp)