I know that we can do different classification level taxa barplots from 1 to 7, from kingdom to species level. But, is it possible to do the same for diversity plots like beta diversity? Lets say diversity analysis at Family level.
Certainly, though I’m not sure if it something you want to do. Beta diversity plots like PCoAs are always more meaningful when you are working at the highest resolution because as you move higher on the classification levels you tend to lose sensitivity on detecting community patterns.
With that caveat in mind if you still want to do that you can simply collapse your feature-table using the taxa collapse function and perform your beta diversity analyses using this new table.
I believe you have found a slight (and very very hard to fix) hole in our available actions. Here’s what’s happened:
When you collapsed your table by taxonomy, all of the ASVs have been removed and grouped by taxonomy. Your phyolgenetic tree is still based on ASVs. Constructing a new phylogenetic tree would required some sequence, which we don’t have readily available (databases work hard to estimate/reconstruct ancestral sequences for higher taxonomic ranks, this is certainly beyond the scope of your analysis here).
Nor is it straightforward to “group” a phylogenetic tree based on taxonomic rank, as a de-novo phylogeny is unlikely to agree as closely as you would like to your taxonomy. I suspect fragment-insertion could actually make a very strong case here as your phylogeny is based on the database, but grouping a phylogeny is unpleasant business that I would avoid.
This means you have no phylogenetic information from your samples. You could use the taxonomic database directly, however here we run into another problem. Your taxonomic classifications may not always map to a particular internal node in the database’s phylogeny, as the classifier may choose to “abort” if it can’t reliably determine a rank. This means in order to use a database phylogeny, you’d need to ensure you had ancestral OTUs available for each taxonomic rank. I believe Greengenes may fit this bill, but you’ll still need to manually map OTU ids to phylogenetic tips, and then back to a truncated form of your taxonomy. None if that is fun to do.
Instead, I would recommend using your taxonomic information as feature metadata using something like qiime emperor biplot instead.
Alternatively, you can ignore all phylogenetic metrics and run core-metrics alone (instead of core-metrics-phylogenetic)