Learn R Programming

ggpicrust2 (version 2.5.10)

compare_daa_results: Compare the Consistency of Statistically Significant Features

Description

This function compares the consistency and inconsistency of statistically significant features obtained using different methods in `pathway_daa` from the `ggpicrust2` package. It creates a report showing the number of common and different features identified by each method, and the features themselves.

Value

A data frame with the comparison results. The data frame has the following columns:

  • method: The name of the method.

  • num_features: The total number of statistically significant features obtained by the method.

  • num_common_features: The number of features that are common to other methods.

  • num_diff_features: The number of features that are different from other methods.

  • common_features: The names of the features that are common to all methods.

  • diff_features: The names of the features that are different from other methods.

Arguments

daa_results_list

A list of data frames containing statistically significant features obtained using different methods.

method_names

A character vector of names for each method used.

p_values_threshold

A numeric value representing the threshold for the p-values. Features with p-values less than this threshold are considered statistically significant. Default is 0.05.

Examples

Run this code
# Minimal DAA-like results from three methods (no external dependencies required)
deseq2_df <- data.frame(
  feature = c("ko00010", "ko00020", "ko00564"),
  group1 = c("A", "A", "A"),
  group2 = c("B", "B", "B"),
  p_adjust = c(0.01, 0.20, 0.03),
  stringsAsFactors = FALSE
)

edgeR_df <- data.frame(
  feature = c("ko00010", "ko00680", "ko00564"),
  group1 = c("A", "A", "A"),
  group2 = c("B", "B", "B"),
  p_adjust = c(0.02, 0.04, 0.01),
  stringsAsFactors = FALSE
)

maaslin2_df <- data.frame(
  feature = c("ko00010", "ko03030", "ko00564"),
  group1 = c("A", "A", "A"),
  group2 = c("B", "B", "B"),
  p_adjust = c(0.03, 0.02, 0.04),
  stringsAsFactors = FALSE
)

daa_results_list <- list(DESeq2 = deseq2_df, edgeR = edgeR_df, Maaslin2 = maaslin2_df)
comparison_results <- compare_daa_results(
  daa_results_list = daa_results_list,
  method_names = c("DESeq2", "edgeR", "Maaslin2"),
  p_values_threshold = 0.05
)
comparison_results

Run the code above in your browser using DataLab