Entering edit mode
anamaria
▴
10
@anamaria-21976
Last seen 4.4 years ago
Hello,
I tried using qvalue function to calculate TPR:
library(qvalue)
qval_obj=qvalue(pvalR)
pi1=1-qval_obj$pi0
but after running:
qval_obj=qvalue(pvalR)
Error in smooth.spline(lambda, pi0, df = smooth.df) :
missing or infinite values in inputs are not allowed
or
qval_obj=qvalue(pvalR,lambda=0.5)
Error in pi0est(p, ...) :
ERROR: The estimated pi0 <= 0. Check that you have valid p-values or use a different range of lambda.
I checked:
max(pvalR)
[1] 0.000352731
min(pvalR)
[1] 1.84872e-127
> sumis.na(pvalR))
[1] 0
> sum(is.infinite(pvalR))
[1] 0
> length(pvalR)
[1] 129368
Also I tried using this flag: lambda=0 But:
> qval_objR=qvalue(pvalR,lambda=0)
> pi1=1-qval_objR$pi0
> pi1
[1] 0
Thanks Ana
Estimating FDRs or q-values requires that p-values resulting from a true null hypothesis follow the Uniform(0,1) distribution, which is the usual requirement in hypothesis testing. If you have 129K p-values and the maximum p-value is 0.000352731, then this property is not true for your p-values. It seems that you truncated your p-values at a small size due to the high number of p-values in your study. Try this function to see if it is more suitable: https://github.com/StoreyLab/qvalue/blob/master/R/qvalue_trunc.R
Hi,
thank you so much for getting back to me. I tried this:
Do you have any other suggestion?
Thanks Aan
Hi John,
I tried that function that you suggested without luck (see bellow) any idea what I can do next, do I miss some flags in that function or?
Thanks Ana
Dear John,
I am having a similar problem and I would like to ask you help.
I am getting the pvalues from hypergeometric tests of enrichments on gene sets. First, I get the enrichment Enr=(X/K)/(M/PopS) Then, if(curEnr>1){ curHG=phyper(X-1,M,N,K,lower.tail = F, log.p = FALSE) }else{ curHG=phyper(X,M,N,K,lower.tail = T, log.p = FALSE) } That is to consider both enrichment and depletion.
But then, running the qvalue, I get the error. I saw your reply before, and I then tried the other script qvalue_trunc.R When I use this, I get no error.
My Q is, why is the original script giving an error and what is the second doing that gives no error? And can I use it then for this data?
Thank you very much! Greetings, Mafalda.