Description Usage Arguments Value Examples
Cluster cells using SNN and a list of given genes, estimate missing expression values for each cell-gene combination with the within-cluster non-zero expression mean
1 2 3 4 5 6 7 8 9 10 11 12 |
expression_matrix |
Row by column log-normalized expression matrix |
subset_genes |
A vector of informative gene names, defaults to all genes |
scale_data |
Whether to standardize expression by gene, default TRUE |
number_pcs |
Number of dimensions to inform SNN clustering |
k_neighbors |
Number of k neighbors to use for NN network |
snn_resolution |
Resolution parameter for SNN |
impute_index |
Index to impute, will default to all zeroes |
pseudo_zero |
Pseudo-zero expression value |
python_path |
path to your python binary (default = system path) |
verbose |
Print progress output to the console |
Returns a sparse matrix of class 'dgCMatrix'
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | set.seed(0)
requireNamespace("Matrix")
## generate (meaningless) counts
c1 <- stats::rpois(5e3, 1)
c2 <- stats::rpois(5e3, 2)
m <- t(
rbind(
matrix(c1, nrow = 20),
matrix(c2, nrow = 20)
)
)
## construct an expression matrix m
colnames(m) <- paste0('cell', 1:ncol(m))
rownames(m) <- paste0('gene', 1:nrow(m))
m <- log(m/colSums(m)*1e4 + 1)
m <- methods::as(m, 'dgCMatrix')
## impute
m_imputed <- rescue::sampleImputation(
expression_matrix = m,
k_neighbors = 10
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.