Skip to content

Commit

Permalink
Maaslin2 Typo Modify
Browse files Browse the repository at this point in the history
  • Loading branch information
cafferychen777 committed Sep 1, 2023
1 parent 6995052 commit fd9c46f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
14 changes: 12 additions & 2 deletions R/compare_daa_results.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,25 @@
#' data("metadata")
#'
#' # Run pathway_daa function for multiple methods
#' methods <- c("ALDEx2", "DESeq2", "edgeR")
#' methods <- c("ALDEx2", "DESeq2", "edgeR","Maaslin2")
#' daa_results_list <- lapply(methods, function(method) {
#' pathway_daa(abundance = metacyc_abundance %>% column_to_rownames("pathway"),
#' metadata = metadata, group = "Environment", daa_method = method)
#' })
#'
#' names(daa_results_list) <- methods
#' # Correct Maaslin2 feature names by replacing dots with hyphens.
#' # Note: When using Maaslin2 as the differential abundance analysis method,
#' # it modifies the original feature names by replacing hyphens (-) with dots (.).
#' # This replacement can cause inconsistencies when trying to compare results from Maaslin2
#' # with those from other methods that do not modify feature names.
#' # Therefore, this line of code reverses that replacement, converting the dots back into
#' # hyphens for accurate and consistent comparisons across different methods.
#' daa_results_list[["Maaslin2"]]$feature <- gsub("\\.", "-", daa_results_list[["Maaslin2"]]$feature)
#'
#' # Compare results across different methods
#' comparison_results <- compare_daa_results(daa_results_list = daa_results_list,
#' method_names = c("ALDEx2_Welch's t test","ALDEx2_Wilcoxon rank test","DESeq2", "edgeR"))
#' method_names = c("ALDEx2_Welch's t test","ALDEx2_Wilcoxon rank test","DESeq2", "edgeR", "Maaslin2"))
#' }
#' @export
utils::globalVariables(c("group1","group2"))
Expand Down
14 changes: 12 additions & 2 deletions man/compare_daa_results.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fd9c46f

Please sign in to comment.