DESeq2 cannot compute log geometric means
1
1
Entering edit mode
3.6 years ago
Bioinfonext ▴ 460

Hi,

Could anyone please suggest how can get rid of the below error in DESeq2 analysis?

 library('DESeq2')
    countMatrix = read.table("Count.txt",header=T,sep='\t',check.names=F)
    dim(countMatrix)
    colData <- read.table("metadata.txt", check.names=F)
    rownames(colData)
    dim(colData)
    colnames(countMatrix)
    all(rownames(colData) %in% colnames(countMatrix))
    count <- countMatrix[,-1] 
    rownames(count) <- countMatrix[,1]
    rownames(count) 

all(rownames(colData) %in% colnames(count))

all(rownames(colData) == colnames(count))

count <- count[, rownames(colData)]
all(rownames(colData) == colnames(count))

dds <- DESeqDataSetFromMatrix(countData=count,colData=colData,design=~Season)
keep <- rowSums(counts(dds)) >= 10
dds <- dds[keep,]
dds <- DESeq(dds, test="Wald")
estimating size factors
Error in estimateSizeFactorsForMatrix(counts(object), locfunc = locfunc,  :
  every gene contains at least one zero, cannot compute log geometric means

Thanks

DESeq2 RNA-Seq R • 5.0k views
ADD COMMENT
0
Entering edit mode
3.6 years ago

check this: link

ADD COMMENT
0
Entering edit mode

Thanks, but I am not sure how to add pseudocount 1 to count data and then how I should proceed further? after estimating the size factor should I use the wald test command?

add a pseudo-count value of '1' to your data
 estimateSizeFactors(dds, type = 'iterate')
dds <- DESeq(dds, test="Wald")

Thanks

ADD REPLY
0
Entering edit mode

Before doing that, did you check if your count matrix has one or more samples with all 0 values? Is so, simply run:

dds<-estimateSizeFactors(dds, type = 'iterate')
dds <- DESeq(dds, test="Wald")
ADD REPLY
0
Entering edit mode

I checked samples count with below command shows that no samples with all 0.

    > all.zero <- apply(count, 2, function(x) all(x==0))
    > all.zero
        PN0086D.1.S1     PN0086D.2.S2     PN0086D.3.S3     PN0086D.4.S4
               FALSE            FALSE            FALSE            FALSE
        PN0086D.5.S5     PN0086D.6.S6     PN0086D.7.S7     PN0086D.8.S8
               FALSE            FALSE  

Should I now used the further command like this?
dds<-estimateSizeFactors(dds, type = 'iterate')
dds <- estimateDispersions(dds)
dds <- nbinomWaldTest(dds)

Many thanks

ADD REPLY
0
Entering edit mode

Just use:

dds<-estimateSizeFactors(dds, type = 'iterate')
dds <- DESeq(dds, test="Wald")
ADD REPLY

Login before adding your answer.

Traffic: 1789 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6