Adjust p-values of a matrix of p-values
1
0
Entering edit mode
Jon Bråte ▴ 260
@jon-brate-6263
Last seen 5 months ago
Norway

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 • 6.2k views
ADD COMMENT
4
Entering edit mode
@gordon-smyth
Last seen 11 minutes ago
WEHI, Melbourne, Australia

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 COMMENT
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

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