While running DESeq2 on a Human dataset (commands given below), I have noticed the following error. How I can handle my data with this case? Is that the same case of Error in estimateDispersions of DEXSeq? Could you tell me how to solve the problem, please?
> library("DESeq2")
> setwd("/folder/to/path/")
> sampleFiles =grep("count",list.files("/folder/to/path/"),value=TRUE)
> sampleFiles
> sampleCondition<-c("Cont","Cont","Test-1","Test-1","Test-2","Test-2","Test-3","Test-3")
> sampleTable<-data.frame(sampleName=sampleFiles, fileName=sampleFiles, condition=sampleCondition)
> ddsHTSeq<-DESeqDataSetFromHTSeqCount(sampleTable=sampleTable, directory="/folder/to/path/", design=~condition)
> colData(ddsHTSeq)$condition<-factor(colData(ddsHTSeq)$condition)
> dds<-DESeq(ddsHTSeq)
# estimating size factors
# estimating dispersions
# gene-wise dispersion estimates
# mean-dispersion relationship
# Error in estimateDispersionsFit(object, fitType = fitType, quiet = quiet) :
# all gene-wise dispersion estimates are within 2 orders of magnitude
# from the minimum value, and so the standard curve fitting techniques will not work.
# One can instead use the gene-wise estimates as final estimates:
# dds <- estimateDispersionsGeneEst(dds)
# dispersions(dds) <- mcols(dds)$dispGeneEst
This means that the replicates are very similar: the coefficient of variation is less than 0.1% for all genes. This is really atypical for biological replicates of RNA-seq experiments. You might look at plotPCA to see how close the replicates are. Also you can plot the counts of rep1 vs rep2 to see how they fall on a diagonal line.
Is there something special about this experiment?
If everything is correct, and these really are biological replicates, you can use the two lines of code in the error message to continue. And then use nbinomWaldTest() for testing and results() for building the results table.