Question: Adjust p-values of a matrix of p-values
0
gravatar for Jon Bråte
4.6 years ago by
Jon Bråte150
Norway
Jon Bråte150 wrote:

I have a matrix of p-values (named Fisher) and I calculated adjusted p-values using multtest like this:

> class(Fisher)
[1] "matrix"
AdjPvalues = mt.rawp2adjp(Fisher, proc=c("Bonferroni"))
> class(AdjPvalues)
[1] "list"

The output is a list, but I am not sure how to access (understand) it. I want to extract gene pairs with an adjusted p-value < 0.05. But how can I remake a matrix with gene pairs and their p-values?

Here's some info about AdjPvalues:

> head(AdjPvalues$adjp)
rawp Bonferroni
[1,]    0          0
[2,]    0          0
[3,]    0          0
[4,]    0          0
[5,]    0          0
[6,]    0          0

> head(AdjPvalues$index)
[1]     1  2688  5375  8062 10749 13436
> head(AdjPvalues$h0.ABH)
NULL
> head(AdjPvalues$h0.TSBH)
NULL

The matrix Fisher contained names of the gene pairs, and I would like to output the gene pairs and the adjusted p-values from AdjPvalues

A few lines from Fisher:

row.names   scigt000002 scigt000019 scigt000020
1   scigt000002 0.000000e+00    2.195239e-01    8.305768e-01
2   scigt000019 2.195239e-01    0.000000e+00    1.059412e-0
3   scigt000020 8.305768e-01    1.059412e-02    0.000000e+00
multtest • 3.0k views
ADD COMMENTlink modified 4.6 years ago by Gordon Smyth37k • written 4.6 years ago by Jon Bråte150
Answer: Adjust p-values of a matrix of p-values
4
gravatar for Gordon Smyth
4.6 years ago by
Gordon Smyth37k
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Gordon Smyth37k wrote:

No need for the multest package, just code in plain R:

gene <- colnames(Fisher)
gene.pair <- paste(gene[row(Fisher)], gene[col(Fisher)], sep=".")
i <- lower.tri(Fisher)
Dat <- data.frame(gene.pair[i], p.value=Fisher[i])
Dat$Holm <- p.adjust(Dat$p.value, method="holm")
Dat

 

ADD COMMENTlink modified 4.6 years ago • written 4.6 years ago by Gordon Smyth37k

Thanks! (Also teached me a lot about R in just a few lines :)  )

ADD REPLYlink written 4.6 years ago by Jon Bråte150
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 270 users visited in the last hour