How to make alpha diversity boxplot?
1
0
Entering edit mode
2.0 years ago
Amr ▴ 180

How to make alpha diversity boxplot? I am trying to perform alpha diversity and I performed scatter plot for shannon measure,How can I make boxplot??

meta.physeq = sample_data(meta)

tax <- otu_table(tax,taxa_are_rows=FALSE)

physeq.alpha = phyloseq(ASV, tax, meta.physeq)

sample_data(physeq.alpha)$shannon.physeq <- estimate_richness(physeq.alpha, measures="Shannon")

plot_richness(physeq.alpha, measures="Shannon")enter image description here

alpha_diversity taxa ASV box_plot shannon • 3.2k views
ADD COMMENT
0
Entering edit mode

Use plot_richness() directly with your phyloseq object instead estimate_richness, define "x=Treatment", with your groups-treatments, etc.

ADD REPLY
0
Entering edit mode

so no boxplot function? what do you mean by x=Treatment? do you mean groups of meta data? please write your code to make it clearer to me

ADD REPLY
0
Entering edit mode

yes, you need a function from ggplot2.

ADD REPLY
2
Entering edit mode
2.0 years ago
zorbax ▴ 650

you need to add a ggplot function:

p <- plot_richness(physeq.alpha, x = "Treatment", measures="Shannon")
p + geom_boxplot()
ADD COMMENT
0
Entering edit mode

thanks a lot! can't believe that is so simple

ADD REPLY

Login before adding your answer.

Traffic: 1476 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6