Alpha Diversity question #19
-
Hi, I was looking over the alpha diversity example and you state that if rarefying isn't used as a normalisation step, precalculated alpha diversity indices can be passed to the alpha.obj parameter in the alpha diversity analysis functions. What format does this need to be in and is there an example I can follow that does not use rarefying? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
Hi there, Thank you for reaching out with your question about using precalculated alpha diversity indices with our R package's alpha diversity analysis functions. If you choose not to rarefy your data as a normalization step, you can indeed pass precalculated alpha diversity indices to the Here is an example of how you can calculate the alpha diversity indices and then pass them to the # Calculate alpha diversity indices
alpha.obj <- mStat_calculate_alpha_diversity(
x = data.obj$feature.tab,
alpha.name = c("shannon", "simpson", "observed_species", "chao1", "ace", "pielou")
)
# Now, you can pass this `alpha.obj` directly to the alpha diversity analysis function
# For example, if you have a function `alpha_diversity_analysis`, you would do:
result <- mStat_alpha_xxxx(alpha.obj = alpha.obj, ...)
# Replace '...' with any other arguments your function requires. Please make sure that the column names of Best regards, Chen YANG |
Beta Was this translation helpful? Give feedback.
-
Following up on this... However, when using generate_alpha_test_long, it still defaults to rarefy. There is no difference between using it and not using it. alpha_test <- generate_alpha_test_long( ... Warning messages: What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
Hi there,
Thank you for reaching out with your question about using precalculated alpha diversity indices with our R package's alpha diversity analysis functions.
If you choose not to rarefy your data as a normalization step, you can indeed pass precalculated alpha diversity indices to the
alpha.obj
parameter.Here is an example of how you can calculate the alpha diversity indices and then pass them to the
alpha.obj
parameter: