counts2cpm: Convert between counts and cpm/tpm

counts2cpmR Documentation

Convert between counts and cpm/tpm

Description

Convert between counts and cpm/tpm

Usage

counts2cpm(x, libsize = scaledlibsizes(x))

cpm2counts(x, libsize)

Arguments

x

count/cpm matrix

libsize

(scaled) libsize vector

Value

cpm/tpm/count matrix

Examples

file <- system.file('extdata/billing19.rnacounts.txt', package = 'autonomics')
object <- read_rnaseq_counts(file)
libsize <- scaledlibsizes(counts(object))
tpm <- counts2tpm(counts(object), genesize = 1)
cpm <- counts2cpm(counts(object), libsize)
counts  <- cpm2counts(cpm, libsize)
sum(counts(object) - counts)

bhagwataditya/importomics documentation built on Nov. 28, 2024, 8:28 a.m.