Russel88 / MicEco

Various functions for analysis of microbial community data
GNU General Public License v3.0
42 stars 11 forks source link

ps_venn and ps_euler give different results #12

Closed camillethuyentruong closed 2 years ago

camillethuyentruong commented 2 years ago

Hi Russel, I have been playing with your package and really enjoy it!

Based on the same dataset, the Venn and Euler diagrams look different and I don't understand why. For example in the Euler plot, what happened to the 23 OTUs shared between all forest types in the Venn plot? Am I missing something here?

Thanks!

ps_venn(
  data,
  group = "ForestType",
  quantities = list(type=c("counts")),
  plot = TRUE
  )

image

ps_euler(
  data,
  group = "ForestType",
  quantities = list(type=c("counts")),
  plot = TRUE
  )

image

Russel88 commented 2 years ago

Dear Camille,

Optimal euler plots are often not theoretically possible to make with more than 3 groups, so the function will just plot the best fitting one, which can exclude some non-zero overlaps.

In the next version of MicEco I will add a message warning the user if some taxa are excluded in the plot.

Best, Jakob

camillethuyentruong commented 2 years ago

Thanks Jacob, do you now based on which criteria are those overlaps eliminated? Is there a way to keep them even though the figure looks ugly?

Russel88 commented 2 years ago

As far as I know it's not possible. The function uses the R package eulerr, and you can see how it works here: https://cran.r-project.org/web/packages/eulerr/vignettes/under-the-hood.html

It is possible to make quasi-proportional Venn diagrams with nVennR, however I think they can be hard to read: https://cran.r-project.org/web/packages/nVennR/vignettes/nVennR.html

camillethuyentruong commented 2 years ago

Ok thanks, maybe I'll stick with Venn diagrams then, as the Euler plot gives the false impression that no OTUs are shared between all forest types.

Russel88 commented 2 years ago

If you update to the newest MicEco version you can now use the shape="ellipse" argument, which might make it possible to make a plot with all overlaps