FROGS Phyloseq: Sample clustering using different linkage method

Phyloseq 1.24.2

Ward D2


Complete


Single


R code

Loading packages & data

library(scales)
library(ape)
source("https://raw.githubusercontent.com/mahendra-mariadassou/phyloseq-extended/master/load-extra-functions.R")
#if in new session 
#library(phyloseq)
#data <- path to Rdata file 
#load(data)

##get dist object from distance matrix file
distance <- # path to Beta diversity tsv file 
A      <- read.table(file=distance, row.names=1)
dist   <- as.dist(A)

## Env types
varExp <- # (discrete) experimental variable used to color samples

Sample clustering using different linkage method

plot_clust(data, dist, method = "ward.D2", color = varExp)
plot_clust(data, dist, method = "complete", color = varExp)
plot_clust(data, dist, method = "single", color = varExp)