Search
Question: DESeq2 variance transformation error and plot dispersion Estimate
0
3.0 years ago by
United States
yuan.qing0 wrote:

Hi,

I was trying to visualize the normalized count of my data, however, I was running into errors:

normalized.count <- as.data.frame(counts(DESeq2, normalized=TRUE))

Error in as.data.frame(counts(DESeq2, normalized = TRUE)) :
error in evaluating the argument 'x' in selecting a method for function 'as.data.frame': Error in .local(object, ...) :
first calculate size factors, add normalizationFactors, or set normalized=FALSE

I was following DESeq2 vignette, whenever I put "normalized=TRUE",  like

select<-order(rowMeans(counts(DESeq2, normalized=TRUE)), decreasing=TRUE)[1:30]
Error in .local(object, ...) :
first calculate size factors, add normalizationFactors, or set normalized=FALSE.

But how do I add normalizationFactors?

Also when I ran plot Dispersion Estimates, the following error message is shown:

plotDispEsts(DESeq2)
Error in plot.window(...) : need finite 'xlim' values
1: In min(py[py > 0], na.rm = TRUE) :
no non-missing arguments to min; returning Inf
2: In is.na(x) : is.na() applied to non-(list or vector) of type 'NULL'
3: In min(x) : no non-missing arguments to min; returning Inf
4: In max(x) : no non-missing arguments to max; returning -Inf
5: In min(x) : no non-missing arguments to min; returning Inf
6: In max(x) : no non-missing arguments to max; returning -Inf

If anyone knows how to solve the problem?

Thanks a lot!

modified 3.0 years ago by Michael Love18k • written 3.0 years ago by yuan.qing0
0
3.0 years ago by
Michael Love18k
United States
Michael Love18k wrote:

if you have a DESeqDataSet, dds, then you need to first run:

dds <- estimateSizeFactors(dds)

You can take a look at the help pages for these functions for more information:

?counts

?estimateSizeFactors

In order to visualize dispersion values, you need to have calculated dispersion values. This will occur by using the DESeq() function:

dds <- DESeq(dds)

Right, I renamed it to be DESeq2_1 instead of DESeq2, my mistake. Thank you very much!

Another question is, do I need to filter low gene expression before inputting into DESeq2?

1

I believe the standard DESeq2 pipeline automatically performs low count filtering for you, and does so in a principled way rather than picking an arbitrary cut-off.

Ryan is right.

This is described in the vignette ("independent filtering").