Issue with qvalue function: Error in smooth.spline(lambda, pi0, df = smooth.df) : missing or infinite values in inputs are not allowed
0
1
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

qvalue • 4.3k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

Hi,

thank you so much for getting back to me. I tried this:

> qq=qvalue_truncp(pvalR)
Error in pi0est(p, ...) : 
  ERROR: The estimated pi0 <= 0. Check that you have valid p-values or use a different range of lambda.

Do you have any other suggestion?

Thanks Aan

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

Dear John,

I am having a similar problem and I would like to ask you help.

qobj <- qvalue(p = DisTPval) Error in smooth.spline(lambda, pi0, df = smooth.df) : missing or infinite values in inputs are not allowed max(DisTPval) [1] 0.6424068 min(DisTPval) [1] 1.285958e-288 sumis.na(DisTPval)) [1] 0 sum(is.infinite(DisTPval)) [1] 0 dim(DisTPval) [1] 20 5

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.

ADD REPLY

Login before adding your answer.

Traffic: 574 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