-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathREADME.Rmd
More file actions
100 lines (69 loc) · 5.08 KB
/
README.Rmd
File metadata and controls
100 lines (69 loc) · 5.08 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
title: "README"
output: md_document
---
```{r setup, fig.height=4, fig.width=8, echo = F, message = F}
library(tidyverse)
library(cowplot)
knitr::opts_chunk$set(fig.path = './', echo = F, message = F)
```
[](http://beta.mybinder.org/v2/gh/raynamharris/vennbar/master?urlpath=rstudio)
Click the button to launch a Binder R session and tinker with all the bar plots or explore the code in the cloud. Navigate to the `examples` directory where there is a subdirectory for each of the four examples, all identified by the first or last author.
```{r vennbar, include=F}
p1 <- ggdraw() + draw_image("examples/toth2017/toth-original-alt-1.png")
p2 <- ggdraw() + draw_image("examples/pena2019/pena-original-alt-1.png")
p3 <- ggdraw() + draw_image("examples/geffre2017/geffre-original-alt-1.png")
p4 <- ggdraw() + draw_image("examples/calisi2017/calisi-original-alt-1.png")
plot_grid(p1,p3,p4,p2, labels = c(1,2,3,4), label_size = 8)
```
```{r vennbar2, include=T}
p1a <- ggdraw() + draw_image("examples/toth2017/GOvenn-original.png")
p1b <- ggdraw() + draw_image("examples/toth2017/GOvenn-alt-1.png")
p2a <- ggdraw() + draw_image("examples/pena2019/fig2venn-original.png")
p2b <- ggdraw() + draw_image("examples/pena2019/fig2venn-alt2-3.png")
p3a <- ggdraw() + draw_image("examples/geffre2017/venn-original.png")
p3b <- ggdraw() + draw_image("examples/geffre2017/venn-alt-1.png")
p4a <- ggdraw() + draw_image("examples/calisi2017/venn-original.png")
p4b <- ggdraw() + draw_image("examples/calisi2017/venn-alt-1.png")
plot_grid(p1a,p3a,p4a,p2a,
p1b,p3b,p4b,p2b,
nrow = 2,
labels = c(1,2,3,4,
NULL,NULL,NULL,NULL), label_size = 8)
```
[Venn diagrams](https://en.wikipedia.org/wiki/Venn_diagram) are a type of figure that I see a lot in the literature. While Venn diagrams are a great way to _conceptualize_ the goal of looking for shared or unique transcriptional responses to experimental manipulations, I don't think they are the best way to _visualize empirical data_.
I searched for “Venn” in Garrett Grolemund & Hadley Wickham’s [R for
Data Science](https://r4ds.had.co.nz/) book and in Claus Wilke’s
[Fundamentals of Data Visualization](https://serialmentor.com/dataviz/)
book, for guidance alternatives to the Venn diagram. Neither book
discusses Venn diagrams, but they both provide valuable insight into
creating bar plots. Interestingly, the R for Data Science book does use
Venn diagrams to illustrate the differences between `inner_join` and
`full_join`, so that provides some evidence that Venn diagrams are
useful for conceptualizing ideas about data.)
The [UpSet plot](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4720993/)
has gained some popularity since 2016. I’ve made a handful of UpSet
plots with [`upsetR`](https://github.com/hms-dbmi/UpSetR). While it is
possible to modify the aesthetics of an UpSet plot, it is very
challenging to manipulate the size, shape, colors, and font to the
degree that is needed to combine many plots into one multi-panel figure
for a manuscript.
In this repository, I turn 12 Venn diagrams from published research articles to four bar plots made with `tidyverse` and `cowplot`. I think these bar plots can be made more simplicity, flexibility, reliability, and reproducibility than a Venn diagram.
Let me know what you think!

**Example 1** is inspired by "Cognitive specialization for learning faces is associated with shifts in the brain transcriptome of a social wasp"" by [Berens _et al_. 2017](http://jeb.biologists.org/content/220/12/2149).
* [Source .Rmd code](./examples/toth2017/toth-venn.Rmd)
* [Markdown output](./examples/toth2017/toth-venn.md)

**Example 2** is from "Transcriptomics of an extended phenotype: parasite manipulation of wasp social behaviour shifts expression of caste-related genes"" by [Geffre _et al_](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).
* [Source .Rmd code](./examples/geffre2017/geffre-venn.Rmd)
* [Markdown output](./examples/geffre2017/geffre-venn.md)

**Example 3** is from "Sex-biased transcriptomic response of the reproductive axis to stress"" by [Calisi _et al_ 2017](https://www.sciencedirect.com/science/article/pii/S0018506X17302696?via%3Dihub).
* [Source .Rmd code](./examples/geffre2017/calisi-venn.Rmd)
* [Markdown output](./examples/calisi2017/calisi-venn.md)

**Example 4** is from "Early life stress alters transcriptomic patterning across reward circuitry in male and female mice"" by [Peña _et al._ 2017](https://www.biorxiv.org/content/10.1101/624353v1).
* [Source .Rmd code](./examples/pena2017/pena-venn.Rmd)
* [Markdown output](./examples/pena2017/pena-venn.md)
So, that's my comparison of four Venn diagrams and four possible bar plot alternatives. What do you think? Do you see the advantages? What other alternatives do you suggest? Comments welcome!