-
Notifications
You must be signed in to change notification settings - Fork 1
/
geffre-venn.Rmd
63 lines (52 loc) · 2.21 KB
/
geffre-venn.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
title: "Geffre Venn"
output: md_document
---
# Transcriptomics of an extended phenotype: parasite manipulation of wasp social behaviour shifts expression of caste-related genes
This venn diagram is from [this paper](https://royalsocietypublishing.org/doi/full/10.1098/rspb.2017.0029?url_ver=Z39.88-2003&rfr_id=ori:rid:crossref.org&rfr_dat=cr_pub%3dpubmed)
![](geffre2017.png)
```{r setup, message = F}
library(ggplot2)
library(dplyr)
library(cowplot)
knitr::opts_chunk$set(fig.path = './', message = F)
```
```{r venn-alt}
venn <- read.csv("venn.csv")
mycolors <- c("All" = "#0FC74C",
"WorkSytl" = "#43C78E",
"WorkGyne and WorkSytl" = "#cb181d",
"WorkGyne" = "#91AEDA",
"WorkGyne and StylGyne" = "#BAD54A" ,
"StylGyne" = "#E5EF4E",
"StylGyne and WorkSytl" = "#46CD4A"
)
p2 <- ggplot(data=venn, aes(x=reorder(comparison, desc(count)), y = count, fill = comparison)) +
geom_bar(stat="identity") +
labs(y = "Total DEGs", x = NULL) +
scale_fill_manual(values = mycolors) +
theme_minimal() +
theme(legend.title = element_blank(),
legend.position = "none") +
scale_x_discrete(labels=c("All" = "All",
"WorkSytl" = "WorkSytl",
"WorkGyne and WorkSytl" = "WorkGyne \nandWorkSytl",
"WorkGyne" = "WorkGyne",
"WorkGyne and StylGyne" = "WorkGyne \nandStylGyne" ,
"StylGyne" = "StylGyne",
"StylGyne and WorkSytl" = "StylGyne \nandWorkSytl")) +
geom_text(aes(x=reorder(comparison, desc(count)), label = count, hjust = 0.5)) +
coord_flip()
p2
```
```{r geffre-original-alt}
p1 <- ggdraw() + draw_image("venn-original.png")
plot_grid(p1, p2, rel_widths = c(0.6,0.4))
```
As with example 1, the size of these circles does convey any meaning
about the size of the sets. The bar chart really highlights that fact
that that “worker versus gyne” (or “WorkGyne” for short) comparison
yields the most differentially expressed genes. However, that was not
the main message of the Venn diagram. The authors used an arrow an `*`
to highlight one particular comparison, so I used a bright red fill to
highlight the parasite manipulation candidate genes.