calculateTPM {scater} | R Documentation

## Calculate transcripts-per-million (TPM)

### Description

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

### Usage

    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

    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")

[Package scater version 1.6.3 Index]