rcpp_mmutil_compute_scores.Rd
Collect row-wise and column-wise statistics
rcpp_mmutil_compute_scores(mtx_file, row_file = NULL, col_file = NULL)
data file
row file
column file
a list of stat vectors
rr <- rgamma(10, 1, 1) # ten cells
mm <- matrix(rgamma(10 * 3, 1, 1), 10, 3)
dat <- mmutilR::rcpp_mmutil_simulate_poisson(mm, rr, "sim_test")
scr <- mmutilR::rcpp_mmutil_compute_scores(dat$mtx)
A <- as.matrix(Matrix::readMM(dat$mtx))
colMeans(A)
#> [1] 1.7 1.1 3.0 1.3 1.0 0.4 0.9 0.8 0.3 0.8
scr$col$mean
#> [1] 1.7 1.1 3.0 1.3 1.0 0.4 0.9 0.8 0.3 0.8
rowMeans(A)
#> [1] 1.8 0.7 2.8 0.5 0.5 0.2 2.6 1.1 0.4 0.7
scr$row$mean
#> [1] 1.8 0.7 2.8 0.5 0.5 0.2 2.6 1.1 0.4 0.7