how to make a heatmap with phyloseq?

Hi Yu,
Yes it looks like you are on the right track. You could also do it in less lines of codes by subsetting your input and using functions already in qiime2R with something like:

submeta<-subset(metadata, Source=="Plastic")
subsv<-SVs[,submeta$SampleID]
tsum<-summarize_taxa(subsv, taxonomy)$Phylum
taxa_heatmap(tsum, submeta, "Source", ntoplot=20)

PS there could be typos in what I wrote so a little debugging might be necessary.

1 Like