Question: DESeq Every Gene Contains at Least One Zero Error
1
gravatar for Flow
4 days ago by
Flow100
Flow100 wrote:

Have you experienced this error in galaxy?:

Fatal error: An undefined error occurred, please check your input carefully and contact your administrator.
estimating size factors
Error in estimateSizeFactorsForMatrix(counts(object), locfunc = locfunc,  :
  every gene contains at least one zero, cannot compute log geometric means
Calls: DESeq ... estimateSizeFactors -> .local -> estimateSizeFactorsForMatrix
ADD COMMENTlink modified 4 days ago • written 4 days ago by Flow100
1
gravatar for Flow
4 days ago by
Flow100
Flow100 wrote:

Every gene has at least one zero for at least one sample of your four samples. The thing is that DESeq2 calculates a geometric mean for every gene over every sample. The geometric mean will be zero if at least one entry is zero, i.e., if one of the four samples has a zero count it will be zero and cannot be used. The geometric means are later important for the DESeq2 normalisation.

Example:

  • ID S1 S2 S3 S4
  • Gene_1 1 22 3 0
  • Gene_2 30 0 12 5
  • Gene_3 0 0 1 6

All Genes above are invalid and cannot be used by DESeq2 because at least one entry is zero.

What you need is something like:

  • ID S1 S2 S3 S4
  • Gene_1 1 22 3 1
  • Gene_2 30 1 12 5
  • Gene_3 0 0 1 6

That would be fine since Gene_1 and Gene_2 can be used later for the normalisation. Gene_3 will be filtered out by DESeq2.

Solution:

  1. You include more data
  2. You add a pseudo-count of 1 to all counts. Just add 1 to every entry. Thats technically not cheating because you treat every entry and DESeq takes the log of the data anyway. If you do that make sure you remove beforehand genes that have zeros for all samples, e.g., Remove Gene_1 in this example:
  • ID S1 S2 S3 S4
  • Gene_1 0 0 0 0
  • Gene_2 30 0 12 5
  • Gene_3 0 0 1 6

Galaxy (DESeq) has an option for that under (Optional) Method for estimateSizeFactors, which are more sophisticated. Choose either 'poscounts' or 'iterate'. Please read the documentation in the tool description for both these models, before you use one of them.

ADD COMMENTlink modified 2 days ago • written 4 days ago by Flow100

Very very cool Flow. Keep them coming!!!

ADD REPLYlink written 4 days ago by Bjoern Gruening5.1k
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 16.09
Traffic: 178 users visited in the last hour