# NOT RUN {
## Generate count data and thinning factors
## In practice, you would obtain mat from a real dataset, not simulate it.
set.seed(1)
n <- 10
p <- 1000
lambda <- 1000
mat <- matrix(lambda, ncol = n, nrow = p)
thinlog2 <- rexp(n = p, rate = 1)
## Thin total gene expressions
thout <- thin_gene(mat = mat, thinlog2 = thinlog2)
## Compare empirical thinning proportions to specified thinning proportions
empirical_propvec <- rowMeans(thout$mat) / lambda
specified_propvec <- 2 ^ (-thinlog2)
plot(empirical_propvec, specified_propvec,
xlab = "Empirical Thinning Proportion",
ylab = "Specified Thinning Proportion")
abline(0, 1, col = 2, lwd = 2)
# }
Run the code above in your browser using DataLab