RecoverCounts | R Documentation |
Attempt to recover raw counts from the normalized matrix.
RecoverCounts(
srt,
assay = NULL,
trans = c("expm1", "exp", "none"),
min_count = c(1, 2, 3),
tolerance = 0.1,
sf = NULL,
verbose = TRUE
)
srt |
A Seurat object. |
assay |
Name of assay to recover counts. |
trans |
The transformation function to applied when data is presumed to be log-normalized. |
min_count |
Minimum UMI count of genes. |
tolerance |
When recovering the raw counts, the nCount of each cell is theoretically calculated as an integer. However, due to decimal point preservation during normalization, the calculated nCount is usually a floating point number close to the integer. The tolerance is its difference from the integer. Default is 0.1 |
sf |
Set the scaling factor manually. |
verbose |
Whether to show messages. |
data("pancreas_sub")
raw_counts <- pancreas_sub@assays$RNA@counts
# Normalized the data
pancreas_sub <- Seurat::NormalizeData(pancreas_sub)
# Now replace counts with the log-normalized data matrix
pancreas_sub@assays$RNA@counts <- pancreas_sub@assays$RNA@data
# Recover the counts and compare with the raw counts matrix
pancreas_sub <- RecoverCounts(pancreas_sub)
identical(raw_counts, pancreas_sub@assays$RNA@counts)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.