Question: DESeq2 cannot compute log geometric means
0
gravatar for Bioinfonext
5 months ago by
Bioinfonext320
Korea
Bioinfonext320 wrote:

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

rna-seq deseq2 R • 479 views
ADD COMMENTlink modified 5 months ago by andres.firrincieli1.1k • written 5 months ago by Bioinfonext320
0
gravatar for andres.firrincieli
5 months ago by
andres.firrincieli1.1k wrote:

check this: link

ADD COMMENTlink written 5 months ago by andres.firrincieli1.1k

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 REPLYlink written 5 months ago by Bioinfonext320

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 REPLYlink modified 5 months ago • written 5 months ago by andres.firrincieli1.1k

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 REPLYlink modified 5 months ago • written 5 months ago by Bioinfonext320

Just use:

dds<-estimateSizeFactors(dds, type = 'iterate')
dds <- DESeq(dds, test="Wald")
ADD REPLYlink written 5 months ago by andres.firrincieli1.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 2.3.0
Traffic: 967 users visited in the last hour
_