ChiLiubio / microeco

An R package for data analysis in microbial community ecology
GNU General Public License v3.0
194 stars 56 forks source link

doubt trans_beta #269

Closed jamorillo closed 10 months ago

jamorillo commented 1 year ago

Hello, I apologize for this basic question regarding the calculation of beta diversity in microeco. In the following operation, on which otu table is the Bray-Curtis distance calculated? Is it a matrix already normalized by total sum scaling, or directly from the OTU matrix without any other transformations?

Given my general background, I understand that the steps should be: 1) rarefaction (optional...), 2) Total Sum Scaling (TSS) normalization, 3) optional transformation (sqrt, Hellinger, etc.,), 4) dissimilarity calculation, 5) finally,subsequent analyses (PERMANOVAs, NMDS, etc.). However, after reviewing the analyses with microeco, I've realized that I dont know how trans_beta works internally, and I would like to confirm this. Thank you!

ChiLiubio commented 1 year ago

Hi, Bray-Curtis distance calculation is performed in microtable class, not in trans_beta class. So the correct format should be dataset$cal_betadiv(). For the rarefaction, please see the microtable part of tutorial (https://chiliubio.github.io/microeco_tutorial/basic-class.html#microtable-class). The operation dataset$rarefy_samples() may be what you need and is very easy to use. I donnot suggest using TSS for bray distance. For the normalization methods, please also see the tutorial (https://chiliubio.github.io/microeco_tutorial/mecodev-package.html#trans_norm). The things that trans_beta does is the subsequent analysis.

jamorillo commented 1 year ago

Hello, I got it. I also did the most of the analysis directly in vegan, and my results are consistent with what I got from microeco. Thanks for your kind reply, and for developing this project. Best reagrds!