Here we show two options for using limorhyde2
to analyze
RNA-seq data: limma-voom
and DESeq2.
The two approaches give very similar results.
This vignette assumes you are starting with the output of tximport.
You will need two objects:
txi
, a list from tximport
metadata
, a data.frame
having one row per
sampleThe rows in metadata
must correspond to the columns of
the elements of txi
.
library('limorhyde2')
# txi = ?
# metadata = ?
There are many reasonable strategies to do this, here is one.
= rowSums(edgeR::cpm(txi$counts) >= 0.5) / ncol(txi$counts) >= 0.75
keep
= txi
txiKeep for (name in c('counts', 'length')) {
= txi[[name]][keep, ]} txiKeep[[name]]
This avoids unrealistically low log2 CPM values and thus artificially inflated effect size estimates.
for (i in seq_len(nrow(txiKeep$counts))) {
= txiKeep$counts[i, ] > 0
idx $counts[i, !idx] = min(txiKeep$counts[i, idx])} txiKeep
= edgeR::DGEList(txiKeep$counts)
y = edgeR::calcNormFactors(y)
y
= getModelFit(y, metadata, ..., method = 'voom') # replace '...' as appropriate for your data fit
The second and third arguments to
DESeqDataSetFromTxImport()
are required, but will not be
used by limorhyde2
.
= DESeq2::DESeqDataSetFromTximport(txiKeep, metadata, ~1)
y
= getModelFit(y, metadata, ..., method = 'deseq2') # replace '...' as appropriate for your data fit
limorhyde2
Regardless of which option you choose, the next steps are the same:
getPosteriorFit()
, getRhythmStats()
, etc.