Best Practice for Group Composition Plots in Phyloseq
1
0
Entering edit mode
12 weeks ago
bioinfo ▴ 60

Hi, I have a methodological question about creating summary composition plots in phyloseq.

When creating a stacked bar plot of mean relative abundance by group, which approach is more statistically sound, especially for sparse microbiome datasets? Method A: Calculate relative abundance for each individual sample, and then group_by() and take the mean() of those abundances. Method B: Use merge_samples() to pool the raw counts for each group first, and then calculate the relative abundance on the pooled 'meta-sample.' With my sparse data, Method A produces a misleading plot where the bars do not sum to 1.0, while Method B works consistently. I'd like to confirm if Method B is the standard and recommended approach for this type of visualization.

phyloseq microbiome relative-abundance • 2.7k views
ADD COMMENT
0
Entering edit mode
14 hours ago

Method B is indeed the standard and recommended approach in phyloseq for group-level composition plots, as seen in official examples and tutorials (e.g., merging by sample variables like SampleType before transforming to relative abundance). It's particularly sound for sparse microbiome data, where pooling raw counts first captures accumulated signals from rare taxa, ensuring the bars sum to 1.0 consistently without needing extra handling for "Other" categories or precision issues.

Method A calculates true per-sample averages but can lead to sums <1 in plots if low-abundance taxa are filtered or lumped improperly post-averaging—common in sparse datasets with many zeros. To fix this in A, aggregate low means into "Other" explicitly, but B avoids the hassle and is less misleading visually.

If sample sequencing depths vary significantly, consider transforming to relative abundance before merging in B for unweighted averages; otherwise, raw pooling gives depth-weighted results, which may be preferable.

ADD COMMENT

Login before adding your answer.

Traffic: 2947 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