Creating an interaction network in R
0
0
Entering edit mode
3.4 years ago
zizigolu ★ 4.3k

Hello

I want to create an interaction network of mutations in terms of mutual exclusivity and co-occurance

I have this data

> dput(dat[1:5,])
structure(list(gene1 = c("XIRP2", "ABCA13", "VIRMA", "AHNAK2", 
"TPTE"), gene2 = c("CFAP54", "FAT3", "TENM4", "TP53", "CCDC168"
), pValue = c(0.0052991452991453, 0.0128205128205128, 0.0128205128205128, 
0.0257950744907267, 0.0299888517279821), oddsRatio = c(43.1892125950047, 
24.4044402363621, 24.4044402363621, Inf, 12.6559160941983), `00` = c(22L, 
21L, 21L, 9L, 20L), `11` = c(3, 3, 3, 8, 3), `01` = c(1, 2, 2, 
10, 2), `10` = c(1, 1, 1, 0, 2), Event = c("Co_Occurence", "Co_Occurence", 
"Co_Occurence", "Co_Occurence", "Co_Occurence"), pair = c("CFAP54, XIRP2", 
"ABCA13, FAT3", "TENM4, VIRMA", "AHNAK2, TP53", "CCDC168, TPTE"
), event_ratio = c("3/2", "3/3", "3/3", "8/10", "3/4")), row.names = c(NA, 
-5L), .internal.selfref = <pointer: 0x0000022bced61ef0>, class = c("data.table", 
"data.frame"))
>

And I need something like

enter image description here

I am wondering if there is any script to produce this from the data I have?

Thank you

R • 654 views
ADD COMMENT
1
Entering edit mode

You should take a look at the corrplot package. That might do the trick. If not, maybe ComplexHeatmap can help (althogh I don't know if CH can do upper triangle/lower triangle plots)

ADD REPLY
0
Entering edit mode

If you have your data in maf format or you convert them into this format, maftools packages do such a job very well.

ADD REPLY
0
Entering edit mode

Thank you my data is in maf. I have two groups so that I want to create two plot with same order of genes but when I put my genes in order argument in maftools that returns an error so I am trying to create the interaction network myself

ADD REPLY

Login before adding your answer.

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