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 June 15, 2024, 1:05 a.m.