transformTFIDF: Transform/normalize compartment calls using TF-IDF

View source: R/transformTFIDF.R

transformTFIDFR Documentation

Transform/normalize compartment calls using TF-IDF

Description

Transform/normalize compartment calls using TF-IDF

Usage

transformTFIDF(mat, scale.factor = 100000)

Arguments

mat

n x p input matrix (n = samples/cells; p = compartments)

scale.factor

Scaling factor for the term-frequency (TF)

Details

This function and its helpers were modeled after or taken from:

  • http://andrewjohnhill.com/images/posts/2019-5-6-dimensionality-reduction-for-scatac-data/analysis.html

  • https://divingintogeneticsandgenomics.rbind.io/post/clustering-scatacseq-data-the-tf-idf-way/

Value

A TF-IDF transformed matrix of the same dimensions as the input

Examples

m <- 1000
n <- 100
mat <- round(matrix(runif(m * n), m, n))
# Input needs to be a tall matrix
tfidf <- transformTFIDF(mat)


biobenkj/compartmentalizer documentation built on June 10, 2025, 1:57 a.m.