Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

RunTFIDF

Compute the term-frequency inverse-document-frequency


Description

Run term frequency inverse document frequency (TF-IDF) normalization on a matrix.

Usage

RunTFIDF(object, ...)

## Default S3 method:
RunTFIDF(
  object,
  assay = NULL,
  method = 1,
  scale.factor = 10000,
  verbose = TRUE,
  ...
)

## S3 method for class 'Assay'
RunTFIDF(
  object,
  assay = NULL,
  method = 1,
  scale.factor = 10000,
  verbose = TRUE,
  ...
)

## S3 method for class 'Seurat'
RunTFIDF(
  object,
  assay = NULL,
  method = 1,
  scale.factor = 10000,
  verbose = TRUE,
  ...
)

Arguments

object

A Seurat object

...

Arguments passed to other methods

assay

Name of assay to use

method

Which TF-IDF implementation to use. Choice of:

  • 1: The TF-IDF implementation used by Stuart & Butler et al. 2019 (doi: 10.1101/460147). This computes \log(TF \times IDF).

  • 2: The TF-IDF implementation used by Cusanovich & Hill et al. 2018 (doi: 10.1016/j.cell.2018.06.052). This computes TF \times (\log(IDF)).

  • 3: The log-TF method used by Andrew Hill. This computes \log(TF) \times \log(IDF).

  • 4: The 10x Genomics method (no TF normalization). This computes IDF.

scale.factor

Which scale factor to use. Default is 10000.

verbose

Print progress

Details

Four different TF-IDF methods are implemented. We recommend using method 1 (the default).

Value

Returns a Seurat object

References

Examples

mat <- matrix(data = rbinom(n = 25, size = 5, prob = 0.2), nrow = 5)
RunTFIDF(object = mat)
RunTFIDF(atac_small[['peaks']])
RunTFIDF(object = atac_small)

Signac

Analysis of Single-Cell Chromatin Data

v1.2.1
MIT + file LICENSE
Authors
Tim Stuart [aut, cre] (<https://orcid.org/0000-0002-3044-0897>), Avi Srivastava [aut] (<https://orcid.org/0000-0001-9798-2079>), Paul Hoffman [ctb] (<https://orcid.org/0000-0002-7693-8957>), Rahul Satija [ctb] (<https://orcid.org/0000-0001-9448-8833>)
Initial release
2021-05-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.