RUV is a normalization algorithm for ERCC spike-in. In the paper http://www.nature.com/nbt/journal/v32/n9/pdf/nbt.2931.pd, the Online Methods section. It was stated:
The algorithm performs SVD decomposition on the input count gene count matrix. The hidden matrix W is estimated by the left singular matrix (U) and the diagonal matrix, both from SVD.
But in the Bioconductor code implementation, https://github.com/drisso/RUVSeq/blob/master/R/RUVg-methods.R
svdWa <- svd(Ycenter[, cIdx]) first <- 1 + drop k <- min(k, max(which(svdWa$d > tolerance))) W <- svdWa$u[, (first:k), drop = FALSE] <--- This line!!!! ONLY the U matrix is used. Bug? alpha <- solve(t(W) %*% W) %*% t(W) %*% Y correctedY <- Y - W %*% alpha
The R implementation ignores the diagonal matrix, and only use the left singular matrix (U)
The code and the paper don't match. Why?