Skip to contents

Builds the list list(abundance, counts, length, countsFromAbundance) that DESeq2::DESeqDataSetFromTximport() and edgeR's offset recipe take, from the expected counts, TPM and effective lengths of RSEM files, without changing a value. It is the same list that tximport::tximport(type = "rsem", txIn = FALSE) returns for the same files (countsFromAbundance = "no"); the differential expression itself, and the length offset, stay with those packages.

Usage

rsem_as_tximport(x, zero_length = "stop")

Arguments

x

The result of rsem_import() with the assays "count", "tpm" and "length".

zero_length

"stop", "drop" or "keep", see Details.

Value

A list with the matrices abundance (TPM), counts and length, and countsFromAbundance = "no".

Details

DESeq2 stops when a gene has an effective length of 0, which RSEM writes for a transcript shorter than the mean fragment length (see rsem_read()). zero_length decides what happens: "stop" (the default) names the genes, "drop" removes every gene that has a zero length in any sample (the counts of these genes are lost; the number is printed), and "keep" leaves them. Replacing 0 by another length is not offered: it changes the offset of those genes only.

Rows that combine several gene IDs (from id = "symbol") are refused: their length is an average over different genes, not a length that RSEM estimated.