simulate_sparse_matrix {inferCSN} | R Documentation |
Generate a simulated sparse matrix for single-cell data testing
Description
Generate a simulated sparse matrix for single-cell data testing
Usage
simulate_sparse_matrix(
nrow,
ncol,
density = 0.1,
distribution_fun = function(n) stats::rpois(n, lambda = 0.5) + 1,
seed = 1
)
Arguments
nrow |
Number of rows (genes) in the matrix. |
ncol |
Number of columns (cells) in the matrix. |
density |
Density of non-zero elements (default: 0.1, representing 90 sparsity). |
distribution_fun |
Function to generate non-zero values. |
seed |
Random seed for reproducibility. |
Value
A sparse matrix of class "dgCMatrix"
Examples
simulate_sparse_matrix(2000, 500) |>
check_sparsity()
[Package inferCSN version 1.1.7 Index]