View source: R/feature_selection.R
| find_variable_genes | R Documentation |
Identifies highly variable genes from a sparse gene expression matrix using one of two methods: variance-stabilizing transformation (VST) or deviance-based modeling. The VST method uses a C++-accelerated approach to compute standardized variance, while the deviance-based method models gene variability across libraries using negative binomial deviances.
find_variable_genes(
gene_expression_matrix,
method = "vst",
n_threads = 1,
verbose = FALSE,
...
)
gene_expression_matrix |
A sparse gene expression matrix (of class |
method |
Character string, either |
n_threads |
If OpenMP is available for your device, the function suggests using multi-thread processing for even faster computation (only for sum_deviance method). |
verbose |
Logical. If |
... |
Additional arguments (currently unused). |
A data.table containing gene names (column events) and computed metrics.
For the deviance method, this includes sum_deviance and variance columns.
library(Matrix)
# loading the toy dataset
toy_obj <- load_toy_M1_M2_object()
# getting high variable genes
HVG_VST <- find_variable_genes(toy_obj$gene_expression, method = "vst")
# sum_deviance method
HVG_DEV <- find_variable_genes(toy_obj$gene_expression, method = "sum_deviance")
# Using multi-threading for faster computation (sum_deviance method only)
HVG_DEV_MT <- find_variable_genes(toy_obj$gene_expression,
method = "sum_deviance",
n_threads = 4) # 4 threads
# printing the results
print(HVG_VST[order(-standardize_variance)])
print(HVG_DEV[order(-sum_deviance)])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.