cafferychen777 / ggpicrust2

Make Picrust2 Output Analysis and Visualization Easier
https://cafferychen777.github.io/ggpicrust2/
Other
91 stars 11 forks source link

Error in pathway_errorbar(abundance = metcyc_abundance_data %>% column_to_rownames("pathway"), : The feature with statistically significance is zero, pathway_errorbar can't do the visualization. #39

Closed mayagabitzsch closed 8 months ago

mayagabitzsch commented 12 months ago

Sorry for constantly posting issues, but I was able to make PCA plots of my metacyc data, but I cannot form error bars of the pathways. Here is my code

`metcyc_abundance_file <- "path_abun_unstratroots.tsv" metcyc_abundance_data <- read_delim(metcyc_abundance_file, delim = "\t", col_names = TRUE, trim_ws = TRUE) view(metcyc_abundance_data) metadataM<- read_delim( "~/Desktop/microbiome2/MetadataROOTS.txt", delim = "\t", escape_double = FALSE, trim_ws = TRUE) view(metcyc_abundance_data) view(metadataM)

This is the process of getting an error bar,heat map and hopefully pca of metacyc abundance

Perform differential abundance analysis

START HERE

metacyc_daa_results_df <- pathway_daa(abundance = metcyc_abundance_data%>% column_to_rownames("pathway"), metadata = metadataM, group = "ENV_C", daa_method = "ALDEx2")

Annotate the results

metacyc_daa_annotated_results_df <- pathway_annotation(pathway = "MetaCyc", daa_results_df = metacyc_daa_results_df, ko_to_kegg = FALSE)

view(meta) metacyc_daa_annotated_results_df <- metacyc_daa_annotated_results_df [!is.na(metacyc_daa_annotated_results_df$description),] metacyc_daa_annotated_results_df$p_adjust <- round(metacyc_daa_annotated_results_df$p_adjust,5) low_p_feature <- metacyc_daa_annotated_results_df[order(metacyc_daa_annotated_results_df$p_adjust), ]$description[1:20]

pathway_errorbar(abundance = metcyc_abundance_data %>% column_to_rownames("pathway"), daa_results_df = metacyc_daa_annotated_results_df, Group = metadataM$ENV_C, ko_to_kegg = FALSE, p_values_threshold = 0.05, order = "group", select = low_p_feature, p_value_bar = TRUE, colors = NULL, x_lab = "description") `

I get the error Error in pathway_errorbar(abundance = metcyc_abundance_data %>% column_to_rownames("pathway"), : The feature with statistically significance is zero, pathway_errorbar can't do the visualization. Does that mean that I cannot visualize these error bars at all? I was able to make error bars with the KEGG pathways, and for my project having the descriptions of the Metacyc pathways would be good as well.

Thank you for your quick and helpful responses to my errors.

cafferychen777 commented 12 months ago

Dear @mayagabitzsch ,

Thank you for reaching out and providing the details of the issue you encountered while attempting to visualize error bars for Metacyc pathways using ggpicrust2. I understand that you were able to generate PCA plots of your metacyc data successfully, but encountered difficulties in forming error bars for the pathways.

Upon reviewing your code and the error message you received, it appears that the error stems from the fact that the pathway_daa function did not yield any statistically significant results. Consequently, this prevents the visualization of error bars for the pathways.

To address this issue, I would recommend referring to the FAQ section of the ggpicrust2 tutorial, specifically the following link. This section provides detailed information on the reasons behind this issue and potential solutions.

If you have any further questions or require additional assistance, please don't hesitate to let me know. I'm here to help and provide further guidance.

Thank you for your understanding and for your quick responses. We appreciate your support and interest in ggpicrust2.

Best regards, Chen