Alpha diversity for each phylum

Is there any way in qiime2 to measure each phylum's contribution to the alpha diversity, separately? I mean, if I want to see the contribution of different phylum in the alpha diversity between two group of my data does qiime2 has any way for it? If not, is there any way to do it?

Know that I have phyloseq object imported in the RStudio and already created "Shannon", and "Observed" diversity. But now want to know which phylum is effecting more in the diversity and which is less.

1 Like

Hi @turtle

I think using the function 'subset_taxa' in the phyloseq package in R is the potential solution to your query.

You can use 'subset_taxa' function to separate your data into individual phylum groups:

Phyloseq - Subset Taxa by Phylum
library(phyloseq)
library(tidyverse)

# Assume physeq is your phyloseq object

# Get a list of unique phyla
phyla <- unique(tax_table(physeq)[, "Phylum"])

# Create a list to store subsetted phyloseq objects
physeq_phyla <- list()

for (phylum in phyla) {
  physeq_phyla[[phylum]] <- subset_taxa(physeq, Phylum == phylum)
}

I think you might have to carry out the Shannon and Observed diversity for each of these subsets again, but then you should be able to analyse the contribution each phylum is making towards your alpha diversity!

Hope that helps!

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.