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?

Thanks in advance.

pvalue Deseq2 bonferroni • 252 views
ADD COMMENT
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.

ADD COMMENT
0
Entering edit mode

So the p-values I got are already ajusted?

ADD REPLY
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.

Please see https://bioconductor.org/packages/release/bioc/vignettes/DESeq2/inst/doc/DESeq2.html

It contains all code for a differential analysis.

See also StatQuest for further (excellent) information:

ADD COMMENT

Login before adding your answer.

Traffic: 1958 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6