
Simulate Zero-Inflated Negative Binomial (ZINB) Count Matrices with Sequencing Depth
Source:R/zinb_simdata.R
zinb_simdata.Rd
Simulates one or more count matrices following a zero-inflated negative binomial (ZINB) distribution, incorporating gene-gene interaction structures and cell-specific sequencing depth variation.
Arguments
- n
Integer. Number of cells (samples) in each simulated matrix.
- p
Integer. Number of genes (features) in each simulated matrix.
- B
A symmetric binary adjacency matrix (0/1) defining gene-gene connectivity. Row and column names correspond to gene names.
- mu_range
List of numeric vectors (length 2 each). Range of gene expression means for each simulated matrix.
- mu_noise
Numeric vector. Mean of background noise for each matrix.
- theta
Numeric vector. Dispersion parameters of the negative binomial distribution for each matrix. Smaller
theta
implies higher overdispersion.- pi
Numeric vector. Probability of excess zeros (
0 < pi < 1
) for each matrix.- kmat
Integer. Number of count matrices to simulate. Default is 1.
- depth_range
Numeric vector of length 2 or
NA
. Range of total sequencing depth per cell. IfNA
, no depth adjustment is performed.
Value
A list containing kmat
matrices. Each matrix has:
Rows representing cells (
cell_1, ..., cell_n
).Columns representing genes (
rownames(B)
).Count values following a ZINB distribution.
Details
Each simulated matrix:
Generates gene expression values based on a ZINB model.
Modulates expression using the adjacency matrix
B
.Applies random sequencing depth scaling if
depth_range
is provided.
Useful for benchmarking single-cell RNA-seq network inference methods with dropout events and network structure.