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

an SCESet object

effective_length

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

calc_from

character string indicating whether to compute TPM from "counts", "norm_counts", "fpkm" or "norm_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")
pd <- new("AnnotatedDataFrame", data = sc_example_cell_info)
example_sceset <- newSCESet(countData = sc_example_counts, phenoData = pd)
effective_length <- rep(1000, 2000)
tpm(example_sceset) <- calculateTPM(example_sceset, effective_length,
    calc_from = "counts")

## calculate from FPKM
fpkm(example_sceset) <- calculateFPKM(example_sceset, effective_length)
tpm(example_sceset) <- calculateTPM(example_sceset, effective_length,
                                    calc_from = "fpkm")

dynverse/scaterlegacy documentation built on Feb. 17, 2020, 5:07 a.m.