Skip to contents

This function performs median ratio normalization on a counts matrix to adjust for differences in sequencing depth across samples.

Usage

medianRatioNormalization(countsMatrix)

Arguments

countsMatrix

A counts matrix where rows represent genes and columns represent samples.

Value

A normalized counts matrix after applying median ratio normalization.

Details

This function calculates the logarithm of the counts matrix, computes the average log expression for each gene, and then scales each sample's counts by the exponential of the difference between its average log expression and the median of those averages.

Examples

counts <- matrix(c(100, 200, 300, 1000, 1500, 2500), ncol = 2)
normalized_counts <- medianRatioNormalization(counts)