Question: Adjust p-values of a matrix of p-values
0
gravatar for Jon Bråte
5.0 years ago by
Jon Bråte160
Norway
Jon Bråte160 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.3k views
ADD COMMENTlink modified 5.0 years ago by Gordon Smyth39k • written 5.0 years ago by Jon Bråte160
Answer: Adjust p-values of a matrix of p-values
4
gravatar for Gordon Smyth
5.0 years ago by
Gordon Smyth39k
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Gordon Smyth39k 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 5.0 years ago • written 5.0 years ago by Gordon Smyth39k

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

ADD REPLYlink written 5.0 years ago by Jon Bråte160
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: 290 users visited in the last hour