Russel88 / MicEco

Various functions for analysis of microbial community data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

In ps_venn percentage does not add up to 100%

zohrazahir opened this issue · comments

Hi MicEco :)

I am using ps_venn function, but the percentage of each group does not add up to 100%. I used this code before taking the number of samples into account:

ps_venn(
  ps.prop,
  group = "Ecosites", type = "Pond"
)

And this is the diagram:

Venn_no_fraction

And then I added the fraction:

fractions <- c(Dugout = 0.2, Upland = 0.2, Lowland = 0.6)

ps_venn(
ps.prop,
group = "Ecosites", type = "Pond", relative = TRUE, quantities = list(type = c("percent", "counts")), fraction = fractions
)

And got this:

Venn_with_fraction

But the sum of the unique and common percentages does not add up. Any idea what went wrong?

Thank you,
Z.

I'm not sure what you mean.
In the last plot the percentages all add up to 100%

Hi @Russel88,

Ah! Did you sum up all ecosites to get 100? That makes sense; I was summing each ecosites individually. Do you know what "counts" indicate, then?

Yes, it's a percentage across all. The counts are the actual number of ASVs/OTUs or whatever feature you have in your input

Thank you so much Russel for the clarification.

Cheers,
z.