Closed montenegrina closed 1 year ago
There are not enough p-values to estimate the proportion of truly null tests. You should fix pi0=1
in the qvalue
function:
qout <- qvalue(pvals, pi0 = 1)
there is 91 p values
How many p values is enough?
Also with
qval_obj=qvalue(pvals, pi0=1) pi1=1-qval_obj$pi0 pi1 [1] 0
I am getting TPR 0 which can not be
On Mon, Oct 28, 2019 at 7:14 PM Andrew Bass notifications@github.com wrote:
There are not enough p-values to estimate the proportion of truly null tests. You should fix pi0=1 in the qvalue function:
qout <- qvalue(pvals, pi0 = 1)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/StoreyLab/qvalue/issues/19?email_source=notifications&email_token=ACF3RTERGESRYJZNYROGD7LQQ5577A5CNFSM4JGBRBU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECOZ6PQ#issuecomment-547200830, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACF3RTCBIZRC67EJSRQU2ADQQ5577ANCNFSM4JGBRBUQ .
Hi,
I was wondering if there is something I am doing wrong when trying to calculate True positive rate, TPR with your function this is what I am doing:
head(qq) chr pos gene_id pval_nominal pval_ret META 1: chr1 54490 ENSG00000227232 0.608495 0.783778 0.7733204 2: chr1 58814 ENSG00000227232 0.295211 0.897582 0.6970567 3: chr1 60351 ENSG00000227232 0.439788 0.867959 0.7525581 4: chr1 61920 ENSG00000227232 0.319528 0.601809 0.4407018 5: chr1 63671 ENSG00000227232 0.237739 0.988039 0.8626555 6: chr1 64931 ENSG00000227232 0.276679 0.907037 0.6971364
library(qvalue) pvals=qq$META qval_obj=qvalue(pvals) #is false discovery rate pi1=1-qval_obj$pi0 #TPR
pi1 [1] 0.08827036
It is very unlikely that TPR would be this small, can you please advise?
I do have 59981 META p values in this data frame.
Thanks Ana
On Mon, Oct 28, 2019 at 7:18 PM Ana Marija sokovic.anamarija@gmail.com wrote:
there is 91 p values
How many p values is enough?
Also with
qval_obj=qvalue(pvals, pi0=1) pi1=1-qval_obj$pi0 pi1 [1] 0
I am getting TPR 0 which can not be
On Mon, Oct 28, 2019 at 7:14 PM Andrew Bass notifications@github.com wrote:
There are not enough p-values to estimate the proportion of truly null tests. You should fix pi0=1 in the qvalue function:
qout <- qvalue(pvals, pi0 = 1)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Hi Andrew,
I have 1493313 p values in a data frame:
> head(dt)
pvals
1 0.0084956486
2 0.0012681537
3 0.0021218873
4 0.0001551133
5 0.0001894240
I am trying to use qvalue package to calculate True Positive Rate. (TPR)
I am doing this and getting error:
library(qvalue)
pvals=dt$pvals
qval_obj=qvalue(pvals) #is false discovery rate
Error in smooth.spline(lambda, pi0, df = smooth.df) :
missing or infinite values in inputs are not allowed
It this would work I would calculate TPR via:
pi1=1-qval_obj$pi0 #TPR
I don't have any NAs or infinite values there, and
> min(dt$pvals)
[1] 3.988883e-156
> max(dt$pvals)
[1] 0.8746981
> sapply(dt,class)
pvals
"numeric"
Can you please help me resolve this issue?
Thanks Ana
On Tue, Oct 29, 2019 at 2:18 PM Ana Marija sokovic.anamarija@gmail.com wrote:
Hi,
I was wondering if there is something I am doing wrong when trying to calculate True positive rate, TPR with your function this is what I am doing:
head(qq) chr pos gene_id pval_nominal pval_ret META 1: chr1 54490 ENSG00000227232 0.608495 0.783778 0.7733204 2: chr1 58814 ENSG00000227232 0.295211 0.897582 0.6970567 3: chr1 60351 ENSG00000227232 0.439788 0.867959 0.7525581 4: chr1 61920 ENSG00000227232 0.319528 0.601809 0.4407018 5: chr1 63671 ENSG00000227232 0.237739 0.988039 0.8626555 6: chr1 64931 ENSG00000227232 0.276679 0.907037 0.6971364
library(qvalue) pvals=qq$META qval_obj=qvalue(pvals) #is false discovery rate pi1=1-qval_obj$pi0 #TPR
pi1 [1] 0.08827036
It is very unlikely that TPR would be this small, can you please advise?
I do have 59981 META p values in this data frame.
Thanks Ana
On Mon, Oct 28, 2019 at 7:18 PM Ana Marija sokovic.anamarija@gmail.com wrote:
there is 91 p values
How many p values is enough?
Also with
qval_obj=qvalue(pvals, pi0=1) pi1=1-qval_obj$pi0 pi1 [1] 0
I am getting TPR 0 which can not be
On Mon, Oct 28, 2019 at 7:14 PM Andrew Bass notifications@github.com wrote:
There are not enough p-values to estimate the proportion of truly null tests. You should fix pi0=1 in the qvalue function:
qout <- qvalue(pvals, pi0 = 1)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
I did histogram of my data and it appears I do have too many small p values
is there is anything I can do here?
On Sat, Nov 2, 2019 at 7:46 PM Ana Marija sokovic.anamarija@gmail.com wrote:
Hi Andrew,
I have 1493313 p values in a data frame:
> head(dt) pvals 1 0.0084956486 2 0.0012681537 3 0.0021218873 4 0.0001551133 5 0.0001894240
I am trying to use qvalue package to calculate True Positive Rate. (TPR)
I am doing this and getting error:
library(qvalue) pvals=dt$pvals qval_obj=qvalue(pvals) #is false discovery rate Error in smooth.spline(lambda, pi0, df = smooth.df) : missing or infinite values in inputs are not allowed
It this would work I would calculate TPR via:
pi1=1-qval_obj$pi0 #TPR
I don't have any NAs or infinite values there, and
> min(dt$pvals) [1] 3.988883e-156 > max(dt$pvals) [1] 0.8746981 > sapply(dt,class) pvals "numeric"
Can you please help me resolve this issue?
Thanks Ana
On Tue, Oct 29, 2019 at 2:18 PM Ana Marija sokovic.anamarija@gmail.com wrote:
Hi,
I was wondering if there is something I am doing wrong when trying to calculate True positive rate, TPR with your function this is what I am doing:
head(qq) chr pos gene_id pval_nominal pval_ret META 1: chr1 54490 ENSG00000227232 0.608495 0.783778 0.7733204 2: chr1 58814 ENSG00000227232 0.295211 0.897582 0.6970567 3: chr1 60351 ENSG00000227232 0.439788 0.867959 0.7525581 4: chr1 61920 ENSG00000227232 0.319528 0.601809 0.4407018 5: chr1 63671 ENSG00000227232 0.237739 0.988039 0.8626555 6: chr1 64931 ENSG00000227232 0.276679 0.907037 0.6971364
library(qvalue) pvals=qq$META qval_obj=qvalue(pvals) #is false discovery rate pi1=1-qval_obj$pi0 #TPR
pi1 [1] 0.08827036
It is very unlikely that TPR would be this small, can you please advise?
I do have 59981 META p values in this data frame.
Thanks Ana
On Mon, Oct 28, 2019 at 7:18 PM Ana Marija sokovic.anamarija@gmail.com wrote:
there is 91 p values
How many p values is enough?
Also with
qval_obj=qvalue(pvals, pi0=1) pi1=1-qval_obj$pi0 pi1 [1] 0
I am getting TPR 0 which can not be
On Mon, Oct 28, 2019 at 7:14 PM Andrew Bass notifications@github.com wrote:
There are not enough p-values to estimate the proportion of truly null tests. You should fix pi0=1 in the qvalue function:
qout <- qvalue(pvals, pi0 = 1)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
@montenegrina @ajbass
I've run into this problems a couple times as well. The problem is that there are no p-values greater than one of the values of lambda used to fit the smoothing spline to estimate pi0.
Here is a quick work-around I found:
p_values <- term_data$p.value
q_values <- try(qvalue::qvalue(p_values)$qvalues, silent = TRUE)
if ("try-error" %in% class(q_values)) {
# if qvalue fails this is probably because there are no p-values greater than
# 0.95 (the highest lambda value
# if so add a single p-value of 1 to try to combat the problem
q_values = qvalue::qvalue(c(p_values, 1))$qvalues
q_values = q_values[-length(q_values)]
This generally occurs when there are ludicrously small p-values (like p-values from an intercept). Having some default behavior which doesn't require interpreting a cryptic error message and manually setting pi0 would be helpful.
You are a life-saver @shackett. Thank you for your recommendation.
Thanks a lot, @shackett for the quick work-around.
I am analyzing results from a program DeepVirFinder which recommends converting its output p-values to q-value's to control the false discovery rate.
As I am a newbie in the R applications, would you please elaborate on the commented lines in this workaround?
Regards
Hello,
I have p values like this:
when I do:
I installed qvalue via:
I use r-3.6.1
Please assist, Ana