Description Usage Arguments Value Examples
Calculates the variance of the chi-square components matrix and selects the top e.g 5000 rows.
1 | var_rows(mat, top = 5000)
|
mat |
A numeric matrix. For sequencing a count matrix, gene expression values with genes in rows and samples/cells in columns. Should contain row and column names. |
top |
Integer. Number of most variable rows to retain. Default 5000. |
Returns a matrix, which consists of the top variable rows of mat.
1 2 3 4 5 6 7 8 9 10 | set.seed(1234)
# Simulate counts
cnts <- mapply(function(x){rpois(n = 500, lambda = x)},
x = sample(1:20, 50, replace = TRUE))
rownames(cnts) <- paste0("gene_", 1:nrow(cnts))
colnames(cnts) <- paste0("cell_", 1:ncol(cnts))
# Choose top 5000 most variable genes
cnts <- var_rows(mat = cnts, top = 5000)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.