joey711 / phyloseq

phyloseq is a set of classes, wrappers, and tools (in R) to make it easier to import, store, and analyze phylogenetic sequencing data; and to reproducibly share that data and analysis with others. See the phyloseq front page:
http://joey711.github.io/phyloseq/
586 stars 186 forks source link

Abundance Plot Help #1757

Closed goodguynickpt closed 3 months ago

goodguynickpt commented 5 months ago

Hello, everyone!

I have just posted a question regarding my heatmap but now I have another question.

I have obtained an abundance plot using this code:

BAR PLOT Tissue

top <- names(sort(taxa_sums(ps), decreasing=TRUE))#[1:100] #Uncomment this in case you want an interval ps.top <- transform_sample_counts(ps, function(OTU) OTU / sum(OTU)) ps.top <- prune_taxa(top, ps.top)

plot_bar(ps.top, x="Tissue", fill="Family") + geom_bar(stat="identity", width=0.8, color=NA) + facet_wrap(~Infection, scales="free_x")

plot_bar(ps.top, x="Tissue", fill="Family") + geom_bar(stat="identity", width=0.8, color=NA) + theme(legend.position="none") + guides(fill=guide_legend(ncol=7)) + # bottom, top, left, right, none facet_wrap(~Infection, scales="free_x")

ps

Giving me this plot: Relative Abundance Taxonomy Plot - All data - no legend

Thing is, by including ALL data my legend is so big that I cannot possibly include it. Even not including it seems wrong, as there are countless amounts of similar colors and it is super hard to know what is happening. Is there a way around this?

If I include the legend, I get this: Abundance Plot (partial legend only)

I thought that Families would not be as plentiful but maybe I should go for a higher taxonomic level like Class or Order. Do you agree? I usually see microbiome data analyses going for Family.

Someone told me I should include everything, but maybe going for the top 100 or 300 abundances could grant me readable plots. Any thoughts on this? I tried it and got these (the plots still need work, not sure how, though): Rplot - abundance plot (100) Rplot - Abundance Plot (300)

Thank you so much! Cheers, João Lucas