#Test with enterotype dataset
library(phyloseq)
data(enterotype)
#Covert the OTU table to reads, rather than fractional abundances
otu_table(enterotype)<-round(10000*otu_table(enterotype))
#Randomly assign host classes (these should be known in a real hybrid microbiome dataset)
#The two parent species are assigned '1' and '3' respectively, the hybrid is assigned '2'
hybrid_status<-sample(1:3,280, replace=TRUE)
#Bootstrap the dataset
boot_samples<-FourHbootstrap(enterotype,hybrid_status,0.5,5,10)
#Plot the bootstrapped samples as a new quaternary plot including the centroid
FourHquaternary(boot_samples,col='red')
#Plot the bootstrapped samples on an existing quaternary plot without including the centroid
#An existing quaternary plot should already be open
FourHquaternary(boot_samples,col='red',addplot=TRUE, plotcentroid=FALSE)
Run the code above in your browser using DataLab