calculateTPM {scater} | R Documentation |
Calculate transcripts-per-million (TPM) values for expression from counts for a set of features.
calculateTPM(object, effective_length = NULL, exprs_values = "counts", subset_row = NULL)
object |
A SingleCellExperiment object or a count matrix. |
effective_length |
Numeric vector containing the effective length for each feature in |
exprs_values |
String or integer specifying the assay containing the counts in |
subset_row |
A vector specifying the subset of rows of |
For read count data, this function assumes uniform coverage along the (effective) length of the transcript. Thus, the number of transcripts for a gene is proportional to the read count divided by the transcript length.
For UMI count data, this function should be run with effective_length=NULL
, i.e., no division by the effective length.
This is because the number of UMIs is a direct (albeit probably biased) estimate of the number of transcripts.
A numeric matrix of TPM values.
data("sc_example_counts") data("sc_example_cell_info") example_sce <- SingleCellExperiment( assays = list(counts = sc_example_counts), colData = sc_example_cell_info) eff_len <- runif(nrow(example_sce), 500, 2000) tout <- calculateTPM(example_sce, effective_length = eff_len)