Skip to contents

Summarizes the gene-level effective lengths from rsem_read(expr = "length"). RSEM's gene effective length is an average of its transcripts' effective lengths weighted by their abundance, so it changes between samples when transcript usage or the fragment length distribution changes, and it is 0 where every transcript is shorter than the mean fragment length. Large variation is therefore not by itself a sign of an error or of poor quality.

Usage

rsem_length_profile(x)

Arguments

x

Effective lengths, as returned by rsem_read(expr = "length").

Value

A data frame with one row per gene: gene, median, mean, cv (standard deviation / mean, over all samples), zero_fraction (share of samples with length 0) and max_min_ratio (largest / smallest nonzero length; NA with fewer than two nonzero samples).

Details

Genes with length 0 in some samples are the ones that stop tximport/DESeq2::DESeqDataSetFromTximport(); zero_fraction > 0 finds them.

Examples

len <- data.frame(S1 = c(1000, 0, 500), S2 = c(1100, 200, 500),
                  row.names = c("A", "B", "C"))
rsem_length_profile(len)
#> rsem_length_profile: 3 genes x 2 samples; length 0 in some samples: 1 genes, in every sample: 0 genes
#>   gene median mean        cv zero_fraction max_min_ratio
#> 1    A   1050 1050 0.0673435           0.0           1.1
#> 2    B    100  100 1.4142136           0.5            NA
#> 3    C    500  500 0.0000000           0.0           1.0