This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to use filterbyExpr with DESeq2?

Hello I am trying to use edgeR's filterbyExpr with DESeq2. I am running into an issue where I cannot use filterByExpr with DESeq2, unless I do not specify keep.lib.sizes = FALSE (which is recommended by edgeR) how do I use filterByExpr on my DESeqDataSet object.

dds <- DESeqDataSetFromTximport(txi=txi.kallisto.tsv, colData=meta, design= ~1)
# Filter by expression (Get rid of low variance )
keep.exprs <- filterByExpr(dds)
dds_pre_filt<- dds[keep.exprs,]
dim(dds_pre_filt)
dds_deseq <- DESeq(dds_pre_filt) #
norm_dds<-vst(dds_deseq) # vst normalization

What I want is to be able to to is:

dds_pre_filt<- dds[keep.exprs,, keep.lib.sizes = FALSE]

and then precede with normalization

deseq2 rna-seq edger

1 answer

You cannot run it directly on a DESeqDataSet (dds) but must run it on counts(dds). The libsize option is irrelevant here, it only applies if you run it on a DGEList from edgeR.

dds <- DESeqDataSetFromTximport(txi=txi.kallisto.tsv, colData=meta, design= ~your_design)

keep <- filterByExpr(counts(dds))

dds <- DESeq(dds[keep,])

Log in to answer this question.