# \donttest{
# Note: all the available CPU cores might be used
set.seed(42)
# Simulate UMI counts for 1000 genes in 2 conditions
mat <- matrix(rpois(2000, lambda = 100), ncol = 2)
rownames(mat) <- paste0("gene", 1:1000)
colnames(mat) <- c("condition1", "condition2")
result <- tgs_chi2(mat)
head(result)
# Without Yates' correction
result_no_yates <- tgs_chi2(mat, yates = FALSE)
# With sparse matrix
sparse_mat <- Matrix::Matrix(mat, sparse = TRUE)
result_sparse <- tgs_chi2(sparse_mat)
# }
# \dontshow{
options(tgs_max.processes = 1)
set.seed(42)
mat <- matrix(rpois(200, lambda = 100), ncol = 2)
rownames(mat) <- paste0("gene", 1:100)
result <- tgs_chi2(mat)
# }
Run the code above in your browser using DataLab