When performing a test for the detection of positive selection (i.e. with CodeML/PAML) on multiple branches one by one, we need to correct your result to avoid false discovery rate (there are many methods (see the wiki page: http://en.wikipedia.org/wiki/False_discovery_rate).
One I like is the QVALUE package, for R:
Launch R and install QVALUE by typing:
and load it:
We need to load the list of p-value into R. This is a single with only p-values. The order is really important, so we have in a separate file the ordered names of the branch and/or gene tested.
An file containing p-values from 760 gene families is provided here as an example:
Once we have our file of p-values, we can load it into R:
p <- scan("pvalues.list", na.strings=T)
First, have a look at the distribution:
which will display this histogram:
The distribution is bimodal, as expected: when the test is negative, we will have a p-value = 1, and when the test is significant, the p-value is generally very low.
Now, we can perform the qvalue correction:
qobj <- qvalue(p, pi0.meth="bootstrap", fdr.level=0.05)
- The option “bootstrap” is really important, as the distribution is bimodal (see page 11 of the QVALUE manual).
fdr.level=0.05 is a threshold which estimates that 5% of our tests could
Finally, we write the output into a file:
The output file has five columns:
- The p-values, in the same order as in the input file.
- The corresponding q-value.
- The pi0 value.
- The significance of the test, based on the threshold (0 or 1).
- The fdr threshold used to assign as significant.
"pvalue" "qvalue" "lfdr" "pi0" "significant" "fdr.level"
0.00623359809654 0.00598773686818557 0.0291702400633863 0.323886639676113 1 0.05
0.148525646364 0.0731203182099692 0.391218512376612 0.323886639676113 0 0.05
1 0.323886639676113 1 0.323886639676113 0 0.05
0.0682850741607 0.0386405371024297 0.206113388985345 0.323886639676113 1 0.05
0.0322125346865 0.0212580142290782 0.111050362300586 0.323886639676113 1 0.05
Please don't hesitate to contact me if you have any comments or questions.