Counts_to_tpm: Transforms count data into Transcripts Per Million (TPM) data

View source: R/Counts_to_tpm.R

Counts_to_tpmR Documentation

Transforms count data into Transcripts Per Million (TPM) data

Description

With the matrix of counts and the size of the genes/transcripts, it calculates the TPM.

Usage

Counts_to_tpm(counts, featureLength)

Arguments

counts

Data frame genes/features (in the rows) by samples (in the columns). Rownames must be in the names of the features and in the same format as the names of the featureLength vector

featureLength

Named numeric vector with the length of each gene/feature. Names must be the names of the features and in the same format as the rownames of the data frame counts.

Details

This function was modified from a gist from Slowkow (https://gist.github.com/slowkow/c6ab0348747f86e2748b).

Here, we do not calculate the effective length.

Value

List with: a data frame with TPM of genes (rows) per sample (columns) and a vector with the names of the genes/features for which the TPM was calculated

References

https://gist.github.com/slowkow/c6ab0348747f86e2748b

Examples

data("sample_counts"); data("ath_featureLength")
Counts_to_tpm(counts = sample_counts, featureLength = ath_featureLength)


KarenGoncalves/CustomSelection documentation built on Oct. 24, 2023, 12:39 a.m.