Extract genes from ggvenn?
2
0
Entering edit mode
axe880 • 0
@172ed42b
Last seen 24 months ago
United Kingdom

Hi there,

Here is my script for generating a Venn diagram:

vennlistUp <- list( "Control" = UPDEGsTRCSRCgenes,
                    "40-min" = UPDEGsTR40SR40genes,
                    "120-min" = UPDEGsTR120SR120genes,
                    "Recovery" = UPDEGsTRRSRRgenes)

vennlistUp_venn <- ggvenn(vennlistUp, fill_color = c("orange", "#0073C2FF", "#EFC000FF", "#868686FF"), 
                      stroke_size = 1, set_name_size = 8, text_size = 5)
vennlistUp_venn*

This works well and shows what I want it to.

My issue is, I need to extract the gene ID's that are shared across three time points: 40-min, 120-min, and Recovery. I do not want to observe the genes that overlap with the control.

Is there a method of doing this? I understand the intersect function can intersect the genes, but I seem to only be able to do this for all 4 time points at once.

Any help is appreciated, thanks!

ggvenn • 3.1k views
ADD COMMENT
1
Entering edit mode
Michael ▴ 10
@af947582
Last seen 1 day ago
United States

use this instead:

    library(gplots)

  x <- list(
    `set 1` = c("A","B","C","D"),
    `set 2` = c("A","C","E","F"),
    `set 3` = c("A","D","F","G")
      )   

    v.table <- venn(x)

    print(v.table)

    all_intersections <- attr(v.table, "intersections")
    for (comparison in names(all_intersections)) {
      cat(comparison, "\n")
      print(all_intersections[[comparison]])
    }
ADD COMMENT
0
Entering edit mode
Basti ▴ 780
@7d45153c
Last seen 20 minutes ago
France

I think intersect() is exactly what you need

intersect(UPDEGsTR40SR40genes, intersect(UPDEGsTRRSRRgenes, UPDEGsTR120SR120genes))
ADD COMMENT

Login before adding your answer.

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