LebeerLab / tidytacos

Functions to manipulate and visualize microbial community data
https://lebeerlab.github.io/tidytacos/
GNU General Public License v3.0
9 stars 1 forks source link

tacoplot_stack relative abundances not a fraction of 1 or 100% #59

Closed slambrechts closed 1 month ago

slambrechts commented 1 month ago

Hi,

When I want to use tacoplot_stack like so:

tacoplot_stack(tidy_physeq_rarefied, x = Protocol2)

The y-axis is not correctly adjusted to range from 0 to 1 (0% to 100%), so representation of relative abundances is not comparable across x-axis categories.

Anything I'm doing wrong here?

TheOafidian commented 1 month ago

Is it possible that the 'Protocol2' column does not have unique values (a warning is likely raised too)? If that is the case using x=Protocol2 will stack all samples with similar Protocol2 on top of eachother.

If you want to compare relative abundaces between these groups of samples you could maybe do something along the lines of:

tidy_physeq_rarefied %>%
select_samples(sample_id,  Protocol2) %>%
aggregate_samples() %>%
tacoplot_stack(x=Protocol2)
slambrechts commented 1 month ago

Ok yes, that was indeed what I was trying to do, and your solution works! Thank you