Venn Diagrams
Today’s goal is to make a venn diagram showing overlap of any significant DGEs between the time points. Similar to something like this from Traylor-Knowles et al. 2021 and Connelly et al. 2020
Code from Nick Kron and Mike Connelly
I got this to work pretty easily (you have to manually calculate all the intersects which is kinda annoying… what’s the point of the Venn Diagram package then)
# need to manually calculate the totals and the intersects of each interaction (0-1, 0-2, 0-4, 1-2, 1-4, 2-4)
# use data frames anno_h0, anno_h1, anno_h2, anno_h4
# all DEGs is annotated_DEG_list
length(annotated_DEG_list$Row.names) #142 total
##Pairwise
h0_h1 <- intersect(anno_h0$Row.names, anno_h1$Row.names)
h0_h2 <- intersect(anno_h0$Row.names, anno_h2$Row.names)
h0_h4 <- intersect(anno_h0$Row.names, anno_h4$Row.names)
h1_h2 <- intersect(anno_h1$Row.names, anno_h2$Row.names)
h1_h4 <- intersect(anno_h1$Row.names, anno_h4$Row.names)
h2_h4 <- intersect(anno_h2$Row.names, anno_h4$Row.names)
##Triple
h0_h1_h2 <- intersect(h0_h1, anno_h2$Row.names)
h0_h2_h4 <- intersect(h0_h2, anno_h4$Row.names)
h1_h2_h4 <- intersect(h1_h2, anno_h4$Row.names)
h0_h1_h4 <- intersect(h0_h1, anno_h4$Row.names)
##Quadruple
h0_h1_h2_h4 <- intersect(h0_h1, h2_h4)
DGE_hour_venn <- draw.quad.venn(area1 = length(anno_h0$Row.names),
area2 = length(anno_h1$Row.names),
area3 = length(anno_h2$Row.names),
area4 = length(anno_h4$Row.names),
n12 = length(h0_h1),
n13 = length(h0_h2),
n14 = length(h0_h4),
n23 = length(h1_h2),
n24 = length(h1_h4),
n34 = length(h2_h4),
n123 = length(h0_h1_h2),
n124 = length(h0_h1_h4),
n134 = length(h0_h2_h4),
n234 = length(h1_h2_h4),
n1234 = length(h0_h1_h2_h4),
category = c("Hour 0", "Hour 1", "Hour 2", "Hour 4"),
fill = c("olivedrab3", "skyblue", "springgreen", "deepskyblue"),
lwd = rep(1,4),
cat.cex = rep(1.4, 4),
#cat.fontfamily = rep("Arial", 4),
cat.fontface = rep("plain", 4),
alpha = c(0.3,0.3,0.3,0.3),
cex = c(rep(1.4,5), 3, rep(1.4, 9)),
fontface = c(rep("plain", 5), "bold", rep("plain", 9)),
#fontfamily = c(rep("Arial", 15)),
label.col = c(rep("black", 5), "red", rep("black", 9)),
print.mode = "raw",
sigdigs = 2,
scaled = TRUE
)
pdf("~/OneDrive - University of Miami/Cnidimmunity Lab/Wound_Healing_Project/2022 updates with Sami Beasley/manuscript figures and tables/VennDiagram_DGEallhours")
grid.draw(DGE_hour_venn)
When I look up that one gene that’s shared among all time points, it is pdam_00003271 which was annotated as “unknown function” in the .gff file.
Written on November 22, 2022