#Test with enterotype dataset
library(phyloseq)
library(ape)
library(phytools)
data(enterotype)
set.seed(1)
#Generate an example tree and label it with the names of the microbial taxa
enterotype_tree<-rtree(length(taxa_names(enterotype)))
enterotype_tree$tip.label<-taxa_names(enterotype)
#keep only those samples with gender identified
gendered<-which(!(is.na(sample_data(enterotype)$Gender)))
enterotypeMF<-prune_samples(sample_names(enterotype)[gendered],enterotype)
#Create a phyloseq object with a tree
example_phyloseq<-phyloseq(otu_table(enterotypeMF))
coreJaccard(example_phyloseq,grouping=sample_data(enterotypeMF)$Gender)
Run the code above in your browser using DataLab