Search
Question: DESeq estimateSizeFactors() is returning error "Error: all(!is.na(value)) is not TRUE"
0
gravatar for abhishek.yedugondla
7 weeks ago by
abhishek.yedugondla0 wrote:

So upstream seems to be working well, I have run into an issue where the estimatesizefactors is returning a strange error. Input is:

dds <- dds[ rowSums(counts(dds)) > 1, ]

cts <- counts(dds)

geoMeans <- apply(cts, 1, function(row) if (all(row == 0)) 0 else exp(mean(log(row[row != 0]))))

dds <- estimateSizeFactors(dds, geoMeans=geoMeans)

This returns the error

> Error: all(!is.na(value)) is not TRUE

This results in a downstream error of:

>estimating size factors
Error in estimateSizeFactorsForMatrix(counts(object), locfunc = locfunc,  : 
  every gene contains at least one zero, cannot compute log geometric means

Ran the following to troubleshoot:

traceback()
table(rowSums(counts(dds) == 0 ))
table(colSums(counts(dds) == 0))

Resulted in : 

> traceback()
6: stop("every gene contains at least one zero, cannot compute log geometric means")
5: estimateSizeFactorsForMatrix(counts(object), locfunc = locfunc, 
       geoMeans = geoMeans, controlGenes = controlGenes)
4: .local(object, ...)
3: estimateSizeFactors(object)
2: estimateSizeFactors(object)
1: rlogTransformation(dds)
> table(rowSums(counts(dds) == 0 ))

    1     2     3     4     5     6     7     8     9    10    11    12    13    14    15 
10933   926   705   560   488   450   417   396   384   402   419   419   467   469   534 
   16    17    18    19    20    21    22    23    24    25    26    27    28    29    30 
  582   723   908   799   567   622   539   588   546   550   651   646   702   727   833 
   31    32    33    34    35 
  713   348    94     7     1 
> table(colSums(counts(dds) == 0))

 6372  6503  6575  6699  6757  6847  6923  6994  7005  7009  7024  7105  7203  7307  7377 
    1     1     1     1     1     1     1     1     1     1     1     1     1     1     1 
 8246  8280  8447  8557  8804  8907  9655  9783 10338 10345 10358 10485 10504 10524 10606 
    1     1     1     1     1     1     1     1     1     1     1     1     1     1     1 
10699 10700 11427 11544 11580 29115 
    1     1     1     1     1     1 

 

Don't See any zero numbers in the tables so I am unsure as to what is causing this error. The fix of removing all values less than 1 should have fixed it no? Please advise.

 

ADD COMMENTlink modified 7 weeks ago by Michael Love15k • written 7 weeks ago by abhishek.yedugondla0
0
gravatar for Michael Love
7 weeks ago by
Michael Love15k
United States
Michael Love15k wrote:

Can you try estimateSizeFactors(dds, type="poscount")?

This was implemented recently, although proposed a while ago on phyloseq/DESeq2 forums, and hopefully avoids users having to do their own estimation of the geometric means, etc.

ADD COMMENTlink modified 7 weeks ago • written 7 weeks ago by Michael Love15k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 132 users visited in the last hour