Is relative abundance an acceptable format for MicrobiomeStat data object? #75
Replies: 2 comments 3 replies
-
Hello Max, Thank you for your interest in MicrobiomeStat! I'm happy to address your question about using relative abundance data with CLR transformation in the package. Yes, relative abundance data is an acceptable input format for MicrobiomeStat. Your approach of:
is appropriate for many of our package functions. However, I see that you're encountering an error when running
This error occurs because the one-click report function attempts to perform rarefaction on your data, which requires integer count data. Since you're using relative abundance data that has already been CLR-transformed, rarefaction is not appropriate (nor mathematically possible) for your dataset. To resolve this issue, you need to set Your modified code should look like: mStat_generate_report_long(
data.obj = data.obj,
group.var = group.var,
test.adj.vars = test.adj.vars,
vis.adj.vars = vis.adj.vars,
strata.var = strata.var,
subject.var = subject.var,
time.var = time.var,
alpha.obj = NULL,
alpha.name = c("shannon", "observed_species"),
dist.obj = NULL,
dist.name = c("BC", "Jaccard"),
feature.dat.type = "other",
feature.analysis.rarafy = FALSE, # Set this to FALSE for CLR-transformed data
vis.feature.level = c("Phylum", "Family", "Genus"),
test.feature.level = c("Family"),
bar.area.feature.no = 30,
heatmap.feature.no = 40,
feature.mt.method = "fdr",
feature.sig.level = 0.1,
theme.choice = "classic",
output.file = "~/my/directory/of/interest"
) For alpha diversity calculations, you may want to provide pre-calculated alpha diversity indices using the The CLR transformation is excellent for differential abundance and correlation analyses, but some analyses in the package are designed with count data in mind. By setting the appropriate parameters as suggested above, you should be able to use your CLR-transformed relative abundance data effectively with our package. If you have any further questions or encounter other issues, please don't hesitate to ask! Best regards, |
Beta Was this translation helpful? Give feedback.
-
Thanks, Chen. Following up on this issue, I have two questions. I've switched to applying single functions, with mixed success. Yesterday, I ran the generate_taxa_trend_test_long/generate_taxa_trend_volcano_long functions with my physeq_MetaG (non transformed object created above) and had no difficulties. When I try with the CLR transformed version (Mcbm_Stat_physeq_CLR), I get:
When I inspect my object, there are no zeros, as I have performed:
Are you aware of what might cause this? Can I use the CLR transformed objects, or should I stick with the non-transformed data, and if so is that reliable? Do you know why, with both CLR transformed and non-transformed objects, I cannot perform the longitudinal dotplot nor the area plot functions? I get this error when using the CLR object:
and this when using the non-transformed object:
|
Beta Was this translation helpful? Give feedback.
-
Hi there!
I am really excited by this package, thank you for putting it together. I have a longitudinal shotgun metagenomics study, though I only have relative abundances (output from HUMAnN/MetaPHLAN pipeline from the Huttenhower lab) and extensive metadata/exposomics. I've transformed these data into a phyloseq object and used the "mStat_convert_phyloseq_to_data_obj" function to create a data obj, but I want to make sure that this data (which has been clr transformed) is an acceptable input.
Phyloseq code:
Finally:
Gives what looks to be an acceptable output. Yet, when I run the one-click analysis:
I get the error:
EDIT: Which, to be clear, appears to confirm my initial concerns about using relative abundances. Despite feature.dat.type = "other",
& feature.analysis.rarafy = FALSE (I also tried "proportional"), the pipeline tries to use vegan::rrarefy().
Beta Was this translation helpful? Give feedback.
All reactions