calculateTPM: Calculate transcripts-per-million (TPM)

Description Usage Arguments Value Examples

View source: R/calculate-expression.R

Description

Calculate transcripts-per-million (TPM) values for expression from counts for a set of features.

Usage

1
calculateTPM(object, effective_length = NULL, calc_from = "counts")

Arguments

object

a SingleCellExperiment object

effective_length

vector of class "numeric" providing the effective length for each feature in the SingleCellExperiment object

calc_from

character string indicating whether to compute TPM from "counts", "normcounts" or "fpkm". Default is to use "counts", in which case the effective_length argument must be supplied.

Value

Matrix of TPM values.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data("sc_example_counts")
data("sc_example_cell_info")
example_sce <- SingleCellExperiment(
assays = list(counts = sc_example_counts), colData = sc_example_cell_info)
tpm(example_sce) <- calculateTPM(example_sce, effective_length = 5e04,
    calc_from = "counts")

## calculate from FPKM
fpkm(example_sce) <- calculateFPKM(example_sce, effective_length = 5e04,
use.size.factors = FALSE)
tpm(example_sce) <- calculateTPM(example_sce, effective_length = 5e04,
                                    calc_from = "fpkm")

scater documentation built on Nov. 17, 2017, 10:54 a.m.