StoreyLab / qvalue

R package to estimate q-values and false discovery rate quantities.
110 stars 36 forks source link

qvalue() error: The estimated pi0 <= 0. #4

Closed cryptic0 closed 9 years ago

cryptic0 commented 9 years ago

I am estimating empirical P values for a set of genome-wide SNPs using their quantile in the null distribution of another set of SNPs located in intergenic regions.

range(gwSNP)  ## a vector containing absolute values of a test statistic for genome-wide SNPs
[1] 0.0000 3.9315

range(igSNP)  ## a vector containing absolute values of a test statistic for intergenic SNPs
[1] 0.0000 1.2486

emPval <- empPvals(gwSNP, igSNP)
range(emPval)
[1] 0.0006064281 0.4020618557

emPqval <- qvalue(emPval, fdr.level=0.01)
Error in pi0est(p, ...) : 
  ERROR: The estimated pi0 <= 0. Check that you have valid p-values or use a different range of lambda. 
ajbass commented 9 years ago

Please see this informative post on interpreting p-value histograms: http://varianceexplained.org/statistics/interpreting-pvalue-histogram/. I am not an expert in the application you are using it for but to calculate q-values, there needs to be a range of p-values from [0,1]. In fact, section 5.2 in the vignette clarifies this further. Based on the ranges you showed me, there may be an issue with the observed/null test statistics.

You could also have very high power in which case nearly all hypothesis tests are significant. In this case, using q-values is not necessary. Please let me know if you have additional questions.

cryptic0 commented 9 years ago

Hi AJB: Thank you for the response. We figured out that the empirical P value truncation at 0.4 was being caused due to up to 0.6 quantile of the igSNP test statistic being filled with 0's (as would be expected). So we replaced these values with very small (close to zero) random numbers. This resulted in the empirical P value range of 0,1. All is well now. Thanks again.