Predictional functional patwhay differential abundance (DA)

pathway_daa(
  abundance,
  metadata,
  group,
  daa_method = "ALDEx2",
  select = NULL,
  p.adjust = "BH",
  reference = NULL
)

Arguments

abundance

a data frame containing predicted functional pathway abundance, with pathways/features as rows and samples as columns. The column names of abundance should match the sample names in metadata. Pathway abundance values should be counts

metadata

a tibble containing samples information

group

a character specifying the group name for differential abundance analysis

daa_method

a character specifying the method for differential abundance analysis, choices are: - "ALDEx2": ANOVA-Like Differential Expression tool for high throughput sequencing data - "DESeq2": Differential expression analysis based on the negative binomial distribution using DESeq2 - "edgeR": Exact test for differences between two groups of negative-binomially distributed counts using edgeR - "limma voom": Limma-voom framework for the analysis of RNA-seq data - "metagenomeSeq": Fit logistic regression models to test for differential abundance between groups using metagenomeSeq - "LinDA": Linear models for differential abundance analysis of microbiome compositional data - "Maaslin2": Multivariate Association with Linear Models (MaAsLin2) for differential abundance analysis - "Lefser": Linear discriminant analysis (LDA) effect size algorithm for high-dimensional microbiome data

select

a vector containing sample names for analysis, if NULL all samples are included. This parameter can be used to specify which samples are included in the differential abundance analysis. Default is NULL.

p.adjust

a character specifying the method for p-value adjustment, choices are: - "BH": Benjamini-Hochberg correction - "holm": Holm's correction - "bonferroni": Bonferroni correction - "hochberg": Hochberg's correction - "fdr": False discovery rate correction - "none": No p-value adjustment.

reference

a character specifying the reference group level, required for several differential abundance analysis methods such as LinDA, limme voom and Maaslin2. This parameter is used to specify the reference group when there are more than two groups. Default is NULL.

Value

a data frame containing the differential abundance analysis results.

Examples

# \donttest{
library(ggpicrust2)
library(MicrobiomeStat)
#> Registered S3 method overwritten by 'rmutil':
#>   method         from
#>   print.response httr
library(tibble)
library(magrittr)
abundance <- data.frame(sample1 = c(10, 20, 30),
sample2 = c(20, 30, 40),
sample3 = c(30, 40, 50),
row.names = c("pathway1", "pathway2", "pathway3"))

metadata <- tibble::tibble(sample = paste0("sample", 1:3),
group = c("control", "control", "treatment"))

#Run pathway_daa function
result <- pathway_daa(abundance = abundance, metadata = metadata, group = "group",
daa_method = "LinDA")
#> Sample names extracted.
#> Identifying matching columns in metadata...
#> Matching columns identified: sample . This is important for ensuring data consistency.
#> Using all columns in abundance.
#> Converting abundance to a matrix...
#> Reordering metadata...
#> Converting metadata to a matrix and data frame...
#> Extracting group information...
#> Running LinDA analysis...
#> Performing LinDA analysis...
#> 0  features are filtered!
#> The filtered data has  3  samples and  3  features will be tested!
#> Fit linear models ...
#> Completed.
#> Processing LinDA results...
#> LinDA analysis is complete.

data(metacyc_abundance)
data(metadata)
daa_results_df <- pathway_daa(metacyc_abundance %>%
column_to_rownames("pathway"), metadata, "Environment", daa_method = "Lefser")
#> Sample names extracted.
#> Identifying matching columns in metadata...
#> Matching columns identified: NA . This is important for ensuring data consistency.
#> Using all columns in abundance.
#> Converting abundance to a matrix...
#> Reordering metadata...
#> Error in metadata[, matching_columns]: Can't subset columns with `matching_columns`.
#>  Subscript `matching_columns` can't contain missing values.
#>  It has a missing value at location 1.
# }