This function calculates mean relative abundance, standard deviation, and log2 fold change for each feature between two groups.
calculate_abundance_stats(abundance, metadata, group, features, group1, group2)A data frame with columns:
Feature identifier
Mean relative abundance for group1
Standard deviation of relative abundance for group1
Mean relative abundance for group2
Standard deviation of relative abundance for group2
Log2 fold change (group2/group1)
A matrix or data frame with features as rows and samples as columns
A data frame containing sample information
Character string specifying the group column name in metadata
Character vector of feature names to calculate statistics for
Character string specifying the first group name
Character string specifying the second group name