rcpp_mmutil_svd.Rd
Approximate SVD
rcpp_mmutil_svd(
mtx_file,
RANK,
TAKE_LN = TRUE,
TAU = 1,
COL_NORM = 10000,
EM_ITER = 0L,
EM_TOL = 1e-04,
LU_ITER = 5L,
row_weight_file = "",
NUM_THREADS = 1L,
BLOCK_SIZE = 10000L
)
data file (feature x n)
SVD rank
take log(1 + x) trans or not
regularization parameter (default = 1)
column normalization
EM iteration for factorization (default: 10)
EM convergence (default: 1e-4)
LU iteration
row-wise weight file
number of threads for multi-core processing
number of columns per block
a list of (1) U (2) D (3) V
## Generate some data
set.seed(1)
rr <- rgamma(1000, 1, 1) # 1000 cells
mm <- matrix(rgamma(100 * 3, 1, 1), 100, 3)
.dat <- mmutilR::rcpp_mmutil_simulate_poisson(mm, rr, "sim_test")
.pc <- mmutilR::rcpp_mmutil_svd(.dat$mtx, 3, TAKE_LN = FALSE)
.ind <- read.table(.dat$indv)
.col <- unlist(read.table(.dat$col))
.ind <- .ind[match(.col, .ind$V1), ]
plot(.pc$V[, 1], .pc$V[, 2], col = .ind$V2,
xlab = "PC1", ylab = "PC2")
plot(.pc$V[, 2], .pc$V[, 3], col = .ind$V2,
xlab = "PC2", ylab = "PC3")
## clean up temp directory
unlink(list.files(pattern = "sim_test"))