Hot answers tagged


I could write a long story about this but actually I will just link this excellent resource from HBCtraining which dissects the individual steps DESeq2 does, starting from normalization over dispersion estimation (this is where the baseMean comes into play) over model fitting and testing. I think it will clarify the role of the baseMean in DESeq2.


The DESeq2 function collapseReplicates sums the counts for the technical replicates. Here is the code reference: OPs actual confusion was with the DESeq2 function plotCounts which by default normalizes count data and adds a pseudocount of 0.5 for plotting on log2 scale.


sample is a character vector, so levels(dds$sample) is returning null. Presumably you mean to use dds$sample[1] here instead, which will likely solve the problem.

Only top voted, non community-wiki answers of a minimum length are eligible