ggtree icon indicating copy to clipboard operation
ggtree copied to clipboard

Visualizing phyloseq tree object by collapsing clades at family level

Open iadamo1 opened this issue 5 years ago • 1 comments
trafficstars

Hi, I have a phyloseq object containing a phylogenetic tree at OTU level and I would like to do somenthing like this: data(GlobalPatterns) GP <- prune_taxa(taxa_sums(GlobalPatterns) > 0, GlobalPatterns) GP.chl <- subset_taxa(GP, Phylum=="Chlamydiae")

ggtree(GP.chl) + geom_text2(aes(subset=!isTip, label=label), hjust=-.2, size=4) + geom_tiplab(aes(label=Genus), hjust=-.3) + geom_point(aes(x=x+hjust, color=SampleType, shape=Family, size=Abundance),na.rm=TRUE) + scale_size_continuous(trans=log_trans(5)) + theme(legend.position="right") but insted of visualizing the tree with each OTU I would like to have it by family and show the total abundance of each family. is it possible? I saw that you can collapse clades by node but my tree is big and it is quite long to collapse clade by clade.

Thanks a lot!

iadamo1 avatar Feb 25 '20 12:02 iadamo1

Have you collapsed the clade successfully? I encountered the same problem.

huizhen-yan avatar Apr 19 '22 08:04 huizhen-yan