Chapter 3 Third break-out room
3.1 Barplot
<- microbiome::transform(ps1, "compositional")
ps1.com
# filtering 0.001, 0.01,
= filter_taxa(ps1.com, function(x) sum(x) > .01, TRUE)
ps1.com.fil
# Phylum - Family
= tax_glom(ps1.com.fil, taxrank="Phylum", NArm=FALSE)
ps.phylum plot_bar(ps.phylum, fill="Phylum") + facet_wrap(~Pen, scales= "free_x", nrow=1)
Try how filtering influence the barplot
3.2 Dendrogram
<- distance(ps1, method = "bray")
d #d <- distance(ps1, method = "jaccard", binary = TRUE)
#d <- distance(ps1, method = "unifrac")
#d <- distance(ps1, method = "wunifrac") # distance
<- hclust(d, method = "complete")
hpws #hpws <- hclust(d, method = "ward.D2")
# add color
library(dendextend)
<- as.dendrogram(hpws)
dend <- as.numeric(meta$Pen)
colors_to_use <- colors_to_use[order.dendrogram(dend)]
colors_to_use labels_colors(dend) <- colors_to_use
plot(as.dendrogram(dend, hang = -1, cex = 0.6))
Try how cluster type influence the dendrogram