Error when adjusting p-values in R
2
0
Entering edit mode
7 weeks ago

Hello. I'm trying to ajust the pvalues from the file I've got from Deseq2. But I keep getting error mesages:

p.adjust(dds, method = "bonferroni") Error in as.vector(x, mode = "numeric") : no method to coerce this S4 class to vector

Then I tried to leave only the gene ids and the pvalue. But I got another error mesage:

p.adjust(pvalue, method = "bonferroni") Error in p.adjust(pvalue, method = "bonferroni") : 'list' object cannot be coerced to type 'double'

Is there something wrong with my data? What can I do to solve this?

pvalue Deseq2 bonferroni • 250 views
3
Entering edit mode
7 weeks ago

You need just a vector of p-values. Note that DESeq2 will use a much better adjustment method than Bonferroni by default.

0
Entering edit mode

So the p-values I got are already ajusted?

2
Entering edit mode
7 weeks ago
ATpoint 57k

DESeq2 output, so the output of results() or lfcShrink()) should contain a column pvalue which is the nominal/raw/"uncorrected" pvalues, and padj which contains the FDR-corrected (Benjamini-Holm method) pvalues, so yes, padj is already corrected and there is nothing you need (and should) to do manually. In fact, the independent filtering procedure (see paper and manual/vignette) will do a good job at removing genes with low power to maximize the number of significant genes so the multiple testing burden for the surviving genes gets smaller. In other words, it is a smart method that will do some good magic under the hood, much better than doing this yourself without experts knowledge. That is not a pun against you, rather always advisable for any analyst to follow the workflow of expert software such as DESeq2 rather than coming up with custom approaches unless you really know what you're doing.

It contains all code for a differential analysis.