Get a normalized TFIDF matrix from peak-by-cell matrix from single cell profiles.
tfidf(bmat, mat_binary = TRUE, TF = TRUE, log_TF = TRUE, scale_factor = 1e+05)
a sparse/dense matrix or dataframe indicating count matrix (peak-by-cell matrix).
a logic value to indicate if input bmat is spare matrix or not. bmat will be converted into a sparse matrix.
a logic value to indicate if term frequency (TF) normalization is performed.
a logic value to indicate if natural logarithm values of the TF are calculated and used.
a scale factor used to multiple the resulting TF-IDF matrix.
a sparse matrix of normalized TFIDF matrix.
SE_pbmc5k <- example_data(name="pbmc5k_SE.rda")
peak_by_cell_mat <- SummarizedExperiment::assay(SE_pbmc5k)
#### Downsample to speed up example ####
peak_by_cell_mat <- peak_by_cell_mat[seq_len(500), seq_len(100)]
tfidf_mat <- tfidf(bmat=peak_by_cell_mat)
#> [info] binarize matrix
#> [info] calculate tf
#> [info] calculate idf
#> [info] fast log tf-idf