prevalence_abundance: prevalence_abundance return a list that contains a dataframe...

View source: R/prevalence_abundance.R

prevalence_abundanceR Documentation

prevalence_abundance return a list that contains a dataframe of the prevalence and abundance (mean across samples) of each taxon (from relative abundance matrix) and a plot.

Description

prevalence_abundance return a list that contains a dataframe of the prevalence and abundance (mean across samples) of each taxon (from relative abundance matrix) and a plot.

Usage

prevalence_abundance(abundance_matrix)

Arguments

abundance_matrix

dataframe; samples are columns and features are rows (relative abundance)

Value

list

Examples

feature_count <- dss_example$merged_abundance_id %>%
tibble::column_to_rownames('featureID')

colnames(feature_count) <- paste0('id', colnames(feature_count))
feature_tax <- dss_example$merged_taxonomy
feature_count <- feature_count[feature_tax$featureID,]
aggregated_list <- aggregate_count(feature_count, feature_tax,
                                   aggregate_by = "Genus")

abundance_matrix <- relab(aggregated_list[['count_df']])
pa <- prevalence_abundance(abundance_matrix)
pa$data
pa$plot

OxfordCMS/OCMSutility documentation built on Feb. 27, 2025, 8:19 p.m.