Identfies molecules that are outliers on a mean-variability plot as proposed by Seurat.

identifyVariableMolecules(
  object,
  n_mol = 2500,
  method = "vst",
  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.

n_mol

Numeric value. The number of molecules to be identified. Given to nfeatures of Seurat::FindVariableFeatures().

method

Character value. The identification method. One of 'vst', 'mean.var.plot' or 'dispersion'. Given to selection.method of Seurat::FindVariableFeatures().

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

...

Used to absorb deprecated arguments or functions.

Value

The updated input object, containing the added, removed or computed results.

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)