SingleCellExperiment
object.
Note that the variability metrics must be computed using the `runFeatureSelection`
method before extracting the feature names of the top variable features. If
`altExp` parameter is a character
value, this function will return the
input SingleCellExperiment
object with the subset containing only the
top variable features stored as an altExp
slot in returned object.
However, if this parameter is set to NULL
, only the names of the top
variable features will be returned as a character
vector.R/getTopHVG.R
getTopHVG.Rd
getTopHVG
Extracts the top variable genes from an input SingleCellExperiment
object.
Note that the variability metrics must be computed using the `runFeatureSelection`
method before extracting the feature names of the top variable features. If
`altExp` parameter is a character
value, this function will return the
input SingleCellExperiment
object with the subset containing only the
top variable features stored as an altExp
slot in returned object.
However, if this parameter is set to NULL
, only the names of the top
variable features will be returned as a character
vector.
getTopHVG(inSCE, method, n = 2000, altExp = NULL)
Input SingleCellExperiment
object
Specify which method to use for variable gene extraction from either Seurat "vst", "mean.var.plot", "dispersion" or Scran "modelGeneVar".
Specify the number of top variable genes to extract.
A character
value that specifies the name of the altExp
slot that should be created to store the subset SingleCellExperiment
object containing only the top `n` variable features. Default value is
NULL
, which will not store the subset SingleCellExperiment
object
and instead will only return the names of the top `n` variable features.
A character
vector of the top variable feature names or the
input SingleCellExperiment
object with subset of variable features
stored as an altExp
in the object.
data(sce_chcl, package = "scds")
sce_chcl <- scranModelGeneVar(sce_chcl, "counts")
#> Warning: collapsing to unique 'x' values
# return top 10 variable genes
topGenes <- getTopHVG(sce_chcl, "modelGeneVar", 10)
#> Warning: cannot xtfrm data frames