Hi All, I noticed from my latest run of the pipel...
# differentialabundance
d
Hi All, I noticed from my latest run of the pipeline (
dev
branch), that the p-values reported tend to fall in discrete clusters instead of being more continuously spread. For example, sorting from smallest to largest, the p-values I'm seeing are a series of the following: 0 1.00E-04 2.00E-04 3.00E-04 4.00E-04 5.00E-04 6.00E-04 7.00E-04 etc. Dozens or hundreds of genes have these same p-values, and there are no values in between these groups of numbers. In prior runs of the pipeline, p-values were more continuously spread (e.g., I might have values between 0 and 1.00E-04 or between 1.00E-04 and 2.00E-04). Is this difference due to some change in the way that the pipeline (or DESeq2) is rounding the p-values, or is this a peculiarity of my specific data set?
Just to provide some more detail, here is a screenshot of the table in the report, sorted by log2FC: This is from the latest dev version
Here is the same table, but using the latest release version (1.5.0): The number of differentially expressed genes is the same, and the log2FC scores look the same, but the p-values (and therefore adjusted p-values) are different from the dev version.
d
Hi @David Carlson, Yes this difference is probably due to the
--round_digits
parameter that has been implemented since the last release. By default the pipeline uses 4 digits, but you can try changing this for a higher number.
d
Thanks. Do you happen to know what the default number of digits would have been prior to the addition of the
--round_digits
parameter?
@Delfina Terradas I've done some experimenting with different values of the
--round_digits
parameter in the current dev version. I've set the parameter to 8 and 12, and I'm still seeing many p-values set to zero when they are not zero in the release version: This is true in both the results table and the report. See the following screenshot:
u
Don't know if this is still of interest, but there's a problem in the way the digits are rounded (in R scripts, possibly in general). If you look at this line https://github.com/nf-core/modules/blob/master/modules/nf-core/deseq2/differential/templates/deseq2_differential.R#L485 the digits are rounded using round, which means that if you're using 8 digits for example, everything below 1E-8 (or 1E-9) will become 0. Since the default is 4 digits, it means everything below 1E-4. I suggest replacing it with something like
apply(data.frame(comp.results), 2, function(x) sprintf(paste0("%g" opt\$round_digits), x))
I'd have to check and see exactly how to write this in R. This will print everything below significant digits in E format, but still keep a fixed amount of significant digits. I can open an issue, but this will need to be fixed on multiple modules. Would you like me to do that? If so, would you like me to have one PR per module, or one big PR that shifts all the R code (and the relevant snapshots)?