Below instruction is modified from 10X cell-ranger website
The a cell-by-bin (bmat) or cell-by-peak (pmat) matrix is first normalized via the inverse-document
frequency (idf) transform where each peak/bin count is scaled by the log of the ratio of the number
of barcodes in the matrix and the number of barcodes where the peak has a non-zero count. This provides
greater weight to counts in peaks that occur in fewer barcodes. Singular value decomposition (SVD) is
performed on this normalized matrix using IRLBA without scaling or centering, to produce the transformed
matrix in lower dimensional space, as well as the components and the singular values signifying the
importance of each component.
LSA has four major steps:
1) term frequency - TF = t(t(X) / Matrix::colSums(X)); When logTF is TRUE, TF is also log scaled.
2) inverse document frequency - IDF = log(1 + ncol(X) / rowSums(X))
3) TF-IDF - TF * IDF
4) SVD - Run singular value decomposition