Adjust p-values of a matrix of p-values
1
0
Entering edit mode
Jon Bråte ▴ 250
@jon-brate-6263
Last seen 2.5 years 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 • 5.8k views
ADD COMMENT
4
Entering edit mode
@gordon-smyth
Last seen 3 hours 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: 851 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