Heatmap #61
-
Hello, Thanks for the package! I've encountered some issues while trying to annotate the KO pathways and plot a heatmap. Below are the details: 1. Annotation of KO Pathways:> daa_results_df_ALDE <- pathway_daa(abundance = kegg_abundance, metadata = metadata1, group = "Group", daa_method = "ALDEx2", select = NULL, p.adjust = "BH", reference = NULL)
> daa_results_df_ALDE_sig <- daa_results_df_ALDE %>% filter(p_adjust < 0.05)
> daa_results_df_ALDE_sig_sub <- daa_results_df_ALDE_sig[daa_results_df_ALDE_sig$method == "ALDEx2_Kruskal-Wallace test", ]
> daa_annotated_results_df_ALDE_sig_sub <- pathway_annotation(pathway = "KO", daa_results_df = daa_results_df_ALDE_sig_sub, ko_to_kegg = TRUE) Error Received:
Solution Attempt: 2. Plotting Heatmap:> daa_results_df_ALDE1 <- daa_results_df_ALDE_sig_sub[c(1:100),]
> daa_results_df_ALDE2 <- daa_results_df_ALDE_sig_sub[c(101:200),]
> daa_results_df_ALDE3 <- daa_results_df_ALDE_sig_sub[c(201:204),]
> daa_annotated_results_df_ALDE1 <- pathway_annotation(pathway = "KO", daa_results_df = daa_results_df_ALDE1, ko_to_kegg = TRUE)
> daa_annotated_results_df_ALDE2 <- pathway_annotation(pathway = "KO", daa_results_df = daa_results_df_ALDE2, ko_to_kegg = TRUE)
> daa_annotated_results_df_ALDE3 <- pathway_annotation(pathway = "KO", daa_results_df = daa_results_df_ALDE3, ko_to_kegg = TRUE)
> daa_annotated_results_df_ALDE <- rbind(daa_annotated_results_df_ALDE1, daa_annotated_results_df_ALDE2, daa_annotated_results_df_ALDE3)
> pathway_heatmap(
abundance = daa_annotated_results_df_ALDE,
metadata = metadata1,
group = "Group"
) Error Received:
Any assistance would be much appreciated. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello @aston9090 , It appears there's a misunderstanding about the data structure required by the Load necessary data
data("metacyc_abundance")
data("metadata")
Perform differential abundance analysis
metacyc_daa_results_df <- pathway_daa(abundance = metacyc_abundance %>%
column_to_rownames("pathway"),
metadata = metadata, group = "Environment", daa_method = "LinDA")
Annotate the results
annotated_metacyc_daa_results_df <- pathway_annotation(pathway = "MetaCyc",
daa_results_df = metacyc_daa_results_df, ko_to_kegg = FALSE)
Filter pathways with p-adjusted value less than 0.05
feature_with_p_0.05 <- metacyc_daa_results_df %>% filter(p_adjust < 0.05)
Prepare the abundance data for heatmap
pathway_heatmap(abundance = metacyc_abundance %>%
right_join(annotated_metacyc_daa_results_df %>%
select(all_of(c("feature","description"))), by = c("pathway" = "feature")) %>%
filter(pathway %in% feature_with_p_0.05$feature) %>%
select(-"pathway") %>%
column_to_rownames("description"), metadata = metadata, group = "Environment") I recommend aligning your data structure and steps with the ones presented in this example. Please let me know if you have further questions or need assistance. Best wishes! |
Beta Was this translation helpful? Give feedback.
Hello @aston9090 ,
It appears there's a misunderstanding about the data structure required by the
pathway_heatmap()
function. Here's a reference code that might clarify the expected input and steps: