showing co-occurrence data as correlation plot in R

Viewed 20

This is one of the function in maftools to plot the co-occurrence of genes where the odds ratio are calculated and then they are shown if they are significant or not in form of correlation, which looks something like this co-occurence.

Now I not sure how to use that function with pre-computed gene-sets to plot the same or if there is other way to do the same I would really glad to know.

My small subset of data would like to show here is this

dput(head(a,20))
structure(list(A = structure(c(4L, 34L, 13L, 13L, 26L, 26L, 18L, 
37L, 26L, 18L, 51L, 37L, 44L, 26L, 18L, 51L, 41L, 26L, 18L, 51L
), .Label = c("ADAMTS15", "AFAP1L1", "ARHGEF15", "ATP6V0E2", 
"BLID", "CADM1", "CASP1", "CAV2", "CBR1", "CD74", "CYP2E1", "EFNB3", 
"ETS2", "FAM83G", "FLNC", "GALNS", "GBP6", "GFRA3", "GJC2", "GLB1L2", 
"GPNMB", "GRAP", "HYOU1", "IGF2BP3", "IL12B", "JAKMIP2", "KCNIP1", 
"KCNK1", "KCNMB1", "KIAA0087", "KIAA1549", "MICALL2", "MMP7", 
"MX1", "NRGN", "OR2A9P", "OR9A4", "PATE2", "PATE4", "PCBP3", 
"PCDH12", "PCDHB16", "PCDHGA3", "PDIA4", "PGBD5", "PRDM6", "PRR15", 
"PRRT4", "PTGFR", "RARRES2", "RELL2", "RHOBTB3", "ROBO3", "RRAD", 
"SCIN", "SCN4B", "SDR42E1", "SH3TC2", "SIDT2", "SLC22A4", "SLC28A3", 
"SLC35F3", "SMO", "SNX24", "SORL1", "SPATA9", "THSD7A", "TLE1", 
"TRIM36", "TRPM6", "UNCX", "VENTX", "VWA5A", "ZBTB46", "ZFHX3", 
"ZNF853", "ZNRF1"), class = "factor"), B = structure(c(51L, 2L, 
35L, 2L, 17L, 52L, 52L, 45L, 42L, 42L, 42L, 48L, 48L, 61L, 61L, 
61L, 61L, 72L, 72L, 72L), .Label = c("AFAP1L1", "AGPAT3", "ARHGEF15", 
"ATP6V0E2", "BLID", "CADM1", "CASP1", "CAV2", "CBR1", "CD74", 
"CHRNB1", "CNIH3", "CRTAM", "FLNC", "GAS8", "GBP6", "GFRA3", 
"GJC2", "GKAP1", "GLB1L2", "GPNMB", "GRAP", "HYOU1", "IGF2BP3", 
"IL12B", "JAKMIP2", "KCNK1", "KCNMB1", "KIAA0087", "KIAA1549", 
"LGALS9C", "MCOLN2", "MEST", "MMP7", "MX1", "NRGN", "NUDT7", 
"OR2A9P", "PATE2", "PATE4", "PCBP3", "PCDH12", "PCDHGA12", "PCDHGA3", 
"PDIA4", "PRDM6", "PRR15", "PRRT4", "PSAT1", "PTGFR", "RARRES2", 
"RELL2", "RHOBTB3", "ROBO3", "RRAD", "SCIN", "SCN4B", "SDR42E1", 
"SH3TC2", "SIDT2", "SLC22A4", "SLC29A4", "SLC35F3", "SMO", "SNX24", 
"SORL1", "SOX18", "SPATA9", "SYCE1", "THSD7A", "TLE1", "TRIM36", 
"UNCX", "UTF1", "VWA5A", "ZFHX3", "ZNF853"), class = "factor"), 
    Neither = c(185L, 185L, 183L, 183L, 186L, 186L, 186L, 186L, 
    186L, 186L, 186L, 186L, 186L, 186L, 186L, 186L, 186L, 186L, 
    186L, 186L), A.Not.B = c(0L, 0L, 2L, 2L, 0L, 0L, 0L, 0L, 
    0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), B.Not.A = c(0L, 
    0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
    0L, 0L, 0L, 0L), Both = c(6L, 6L, 6L, 6L, 5L, 5L, 5L, 5L, 
    5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L), Log2.Odds.Ratio = structure(c(1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L), .Label = ">3", class = "factor"), p.Value = structure(c(1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L), .Label = "<0.001", class = "factor"), q.Value = structure(c(1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L), .Label = c("<0.001", "0.001", "0.003", "0.006", 
    "0.010", "0.012", "0.031"), class = "factor"), Tendency = structure(c(1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L), .Label = "Co-occurrence", class = "factor")), row.names = c(NA, 
20L), class = "data.frame")

The data frame looks like this

head(a,20)

      A       B Neither A.Not.B B.Not.A Both Log2.Odds.Ratio p.Value q.Value      Tendency
1  ATP6V0E2 RARRES2     185       0       0    6              >3  <0.001  <0.001 Co-occurrence
2       MX1  AGPAT3     185       0       0    6              >3  <0.001  <0.001 Co-occurrence
3      ETS2     MX1     183       2       0    6              >3  <0.001  <0.001 Co-occurrence
4      ETS2  AGPAT3     183       2       0    6              >3  <0.001  <0.001 Co-occurrence
5   JAKMIP2   GFRA3     186       0       0    5              >3  <0.001  <0.001 Co-occurrence
6   JAKMIP2   RELL2     186       0       0    5              >3  <0.001  <0.001 Co-occurrence
7     GFRA3   RELL2     186       0       0    5              >3  <0.001  <0.001 Co-occurrence
8     OR9A4   PDIA4     186       0       0    5              >3  <0.001  <0.001 Co-occurrence
9   JAKMIP2  PCDH12     186       0       0    5              >3  <0.001  <0.001 Co-occurrence
10    GFRA3  PCDH12     186       0       0    5              >3  <0.001  <0.001 Co-occurrence
11    RELL2  PCDH12     186       0       0    5              >3  <0.001  <0.001 Co-occurrence
12    OR9A4   PRRT4     186       0       0    5              >3  <0.001  <0.001 Co-occurrence
13    PDIA4   PRRT4     186       0       0    5              >3  <0.001  <0.001 Co-occurrence
14  JAKMIP2 SLC22A4     186       0       0    5              >3  <0.001  <0.001 Co-occurrence
15    GFRA3 SLC22A4     186       0       0    5              >3  <0.001  <0.001 Co-occurrence
16    RELL2 SLC22A4     186       0       0    5              >3  <0.001  <0.001 Co-occurrence
17   PCDH12 SLC22A4     186       0       0    5              >3  <0.001  <0.001 Co-occurrence
18  JAKMIP2  TRIM36     186       0       0    5              >3  <0.001  <0.001 Co-occurrence
19    GFRA3  TRIM36     186       0       0    5              >3  <0.001  <0.001 Co-occurrence
20    RELL2  TRIM36     186       0       0    5              >3  <0.001  <0.001 Co-occurrence

The above data was generated from here after query my gene of interests.

Any suggestion or help of I can create something similar as the plot shown above or any other way to show the information it would be of great help

0 Answers
Related