I have a little confusion while running DESeq2 (I have 2 conditions and three biological replicates). some genes display NA for p and p adjusted even though other values such as base mean and log2 fold change are all given. When I run DESeq on the same sample I get a p value rounded to zero for the same genes with NA with DESeq2. Can you please explain me the reason behind this variation? how can I fix it?
Look at the help for 'results' and read through the detail section, particularly through these paragraphs:
On p-values:
By default, independent filtering is performed to select a set of
genes for multiple test correction which will optimize the number
of adjusted p-values less than a given critical value ‘alpha’ (by
default 0.1). The adjusted p-values for the genes which do not
pass the filter threshold are set to ‘NA’. By default, the mean of
normalized counts is used to perform this filtering, though other
statistics can be provided. Several arguments from the
‘filtered_p’ function of genefilter are provided here to control
or turn off the independent filtering behavior.
By default, ‘results’ assigns a p-value of ‘NA’ to genes
containing count outliers, as identified using Cook's distance.
See the ‘cooksCutoff’ argument for control of this behavior.
Cook's distances for each sample are accessible as a matrix
"cooks" stored in the ‘assays()’ list. This measure is useful for
identifying rows where the observed counts might not fit to a
Negative Binomial distribution.
In other words, set independentFiltering = FALSE, and cooksCutoff = Inf, and the missing values from the p-values should disappear.