Search
Question: deseq2 zeros in all treatments, fold change
0
4 weeks ago by
mary.cho7530 wrote:

Suppose you have 4 treated and 4 untreated samples.

On avg if all 8 columns are zero Deseq2 will output NA across the results for, baseMean log2FoldChange lfcSE stat pvalue.

However, in a few cases I can see numbers for baseMean log2FoldChange lfcSE stat pvalue (though padj will be NA) when all 8 columns are zero.

Is this possible?

Thanks.

modified 4 weeks ago by Michael Love19k • written 4 weeks ago by mary.cho7530
0
4 weeks ago by
Michael Love19k
United States
Michael Love19k wrote:

Can you show this happening? The base mean is the mean of normalized counts so equal to zero if the counts are zero for the whole row (gene). These genes are not used in computation of LFC or pvalues.

Thanks for your reply. I figured out at least what has happened.

If I have 16 samples and I normalize them together. (At least I think I am normalizing them together)

Then when I contrast samples ac (1,2,3,4)  and an (5,6,7,8)

If some rows have zeros for raw counts 0,0,0,0,0,0,0,0 - I expected NA for  baseMean log2FoldChange lfcSE stat pvalue. This is true the majority of the time.

However, if sample 15 has a normalized value of 3.6 (example 0,0,0,0,0,0,0,0,0,0,0,0,0,3.6,0, then I will get values for baseMean log2FoldChange lfcSE stat pvalue even

when comparing ac and an with the contrast function. Here I thought I was comparing (0,0,0,0,0,0,0,0) and not (0,0,0,0,0,0,0,0,0,0,0,0,0,0,3.6,0) Please see code below. Please let me know if I was not clear of what happened. Is there a mistake in my code or design table? or is this just something that I ignore.  Thanks for your quick reply.

Design table

 id condition cor1 ac cor2 ac cor3 ac cor4 ac cor5 an cor6 an cor7 an cor8 an cor9 zc cor10 zc cor11 zc cor12 zc cor13 zn cor14 zn cor15 zn cor16 zn

####################################################################
library( "DESeq2" )
setwd ("C:/dseq/data")
getwd()

colData<-data.frame(colData1)[,c("id","condition")]

dds<-DESeqDataSetFromMatrix(countData= countData,colData= colData,design=~condition)

dds$condition<-factor(dds$condition,levels=c("ac","an","zc","zn"))

ddsresults<-DESeq(dds)

test <- results(ddsresults, contrast=c("condition","an","ac"))
plotMA(test,main="DESeq2",ylim=c(-6,6))
write.csv (test, "results_ac_vs_an.csv")