Venn diagram

How to make easy venn (or euler) diagrams of taxa shared or unique to a group of samples

In [1]:
# Package with venn functions
library(MicEco)
In [2]:
# Data
library(phyloseq)
load("../data/physeq.RData")

With counts of shared and unique taxa (ASVs):

In [3]:
ps_venn(phy, group = "Time", quantities = list(type=c("counts")))

With percentage of shared and unique:

In [4]:
ps_venn(phy, group = "Time", quantities = list(type=c("percent")))

As an euler diagram

In [6]:
ps_euler(phy, group = "Time", quantities = list(type=c("counts","percent")))

Only include ASVs present in at least 5% of the samples in each group:

In [7]:
ps_euler(phy, group = "Time", quantities = list(type=c("counts")), fraction = 0.05)

Percent is weighted by relative abundance

In [8]:
ps_venn(phy, group = "Time", quantities = list(type=c("percent")), weight = TRUE)

Changing colors etc.

In [10]:
ps_venn(phy, group = "Time", fill = c("red", "green", "blue"), alpha = 0.5, quantities = list(type=c("percent"), col = "white"))