This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Find UniFrac metric based on grouping

Hi, I am looking for way to calculate UniFrac based on the groups in my samples. As there are too many samples in my project (around 300+), I want to look at the UniFrac metric based on grouping instead of samples.

I am using phyloseq at the moment and I couldn't find a way to reproduce phyloseq object based on groups only. Is there a way to do this?

Thank you in advance.

unifrac r phyloseq

1 answer

I found the answer and hope this can help other users as well.

It is actually a simple solution where we can use merge_samples from phyloseq and merge it according to group or other variable that you have.

Here is the link for further explanation: merge_samples | RDocumentation

Log in to answer this question.