Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pathway_errorbar nonspecific error #74

Open
AbbiHern opened this issue Nov 22, 2023 Discussed in #73 · 9 comments
Open

pathway_errorbar nonspecific error #74

AbbiHern opened this issue Nov 22, 2023 Discussed in #73 · 9 comments

Comments

@AbbiHern
Copy link

Discussed in #73

Originally posted by AbbiHern November 22, 2023
When trying to generate pathway error bar plot, I'm getting a very unhelpful error.

"Error in pathway_errorbar(abundance = ko_abundance, daa_results_df = daa_annotated_sub_method_results_df, :"

This is the code Im inputting:

pathway_errorbar(
abundance = ko_abundance,
daa_results_df = daa_annotated_sub_method_results_df,
Group = metadata$diet,
p_values_threshold = 0.05,
order = "name",
select = NULL,
ko_to_kegg = FALSE,
p_value_bar = TRUE,
colors = NULL,
x_lab = "description"
)

@cafferychen777
Copy link
Owner

Hello AbbiHern,

Thank you for posting your issue with the pathway_errorbar function in the ggpicrust2 package.

I noticed that the error message seems to be cut off in your message. To assist you more effectively, could you please provide the complete error message that follows after:

"Error in pathway_errorbar(abundance = ko_abundance, daa_results_df = daa_annotated_sub_method_results_df, :"

The full error message will give us more insight into what might be going wrong. If possible, please also include any additional warnings or messages that appear in your R console when the error occurs.

Your cooperation is greatly appreciated, and we aim to resolve your issue as soon as we can.

Best regards,
Chen YANG

@AbbiHern
Copy link
Author

AbbiHern commented Nov 27, 2023 via email

@cafferychen777
Copy link
Owner

Hi Abbi,

Thank you for your prompt response and for clarifying the situation with the error message. It's indeed puzzling when the error message is incomplete, as it provides limited information to diagnose the issue.

Given the circumstances, it might be beneficial if I could take a closer look at your data and the specific context in which this error occurs. Would you be comfortable sending your data files to me? You can email them to cafferychen7850@gmail.com. This will allow me to directly examine the files in their specific setup and possibly identify what might be causing the error in the pathway_errorbar function.

Please ensure that any sensitive or confidential information is removed or anonymized in the data files you send. Your privacy and the security of your data are paramount.

I appreciate your cooperation and look forward to assisting you further in resolving this issue.

Best regards,
Caffery Yang

@bingli2019
Copy link

function pathway_errorbar error and how save to png ?

p <- pathway_errorbar(abundance = kegg_abundance, daa_results_df = daa_annotated_sub_method_results_df1, Group = metadata$Group, p_values_threshold = 0.05, order = "pathway_class", select = NULL, ko_to_kegg = TRUE, p_value_bar = TRUE, colors = NULL, x_lab = "pathway_name")
ggsave(filename = "pathway_errorbar.png", plot = p, width = 20, height = 8, dpi = 300)

Error in plot_theme():
! The legend.text.align theme element is not defined in the element hierarchy.
Run rlang::last_trace() to see where the error occurred.

It seems ggplot2 packages function error, but I don't know how to fix it.

package version

other attached packages:
[1] devtools_2.4.5 usethis_2.2.3 ggh4x_0.2.8 patchwork_1.2.0
[5] ggprism_1.0.4 lubridate_1.9.3 forcats_1.0.0 stringr_1.5.1
[9] purrr_1.0.2 tidyr_1.3.1 tidyverse_2.0.0 tibble_3.2.1
[13] ggplot2_3.5.0 dplyr_1.1.4 ggpicrust2_1.7.3 readr_2.1.5

@cafferychen777
Copy link
Owner

Dear @bingli2019,

Thank you for reaching out and reporting the issue with the pathway_errorbar function in the ggpicrust2 package.

The error you are encountering seems to be related to a compatibility issue with the newer version of the ggplot2 package. To resolve this, I would recommend downgrading ggplot2 to version 3.4.0, as this version is known to be compatible with ggpicrust2.

You can downgrade ggplot2 by running the following command in R:

install.packages("ggplot2", version = "3.4.0")

After downgrading, please try running your code again. If you continue to experience any issues or have further questions, please don't hesitate to reach out.

Regarding saving the plot, your usage of ggsave is correct. Once the error is resolved with the ggplot2 version downgrade, you should be able to save the plot using your provided ggsave command.

Best regards,
Chen YANG

@bingli2019
Copy link

I changed ggplot2 version to 3.4.0, but failed again.

other attached packages:
[1] devtools_2.4.5 usethis_2.2.3 ggh4x_0.2.8 patchwork_1.2.0
[5] ggprism_1.0.4 lubridate_1.9.3 forcats_1.0.0 stringr_1.5.1
[9] dplyr_1.1.4 purrr_1.0.2 tidyr_1.3.1 ggplot2_3.4.0
[13] tidyverse_2.0.0 tibble_3.2.1 ggpicrust2_1.7.3 readr_2.1.5

Error in plot_theme():
! The legend.text.align theme element is not defined in the element hierarchy.
Run rlang::last_trace() to see where the error occurred.

@bingli2019
Copy link

come errors
Error: package ‘ggplot2’ 3.4.0 is loaded, but >= 3.4.2 is required by ‘ggh4x’

finally, it fixed by update ggplot2 version to 3.4.2.

@isa-wilson
Copy link

Hi there,

I am getting the exact same undefined error in pathway_errorbar as described by the original poster in this thread. I was wondering if you ever managed to find a solution?

I can run the ggpicrust2 command perfectly fine with the example data so I suspect that the issue may be with the way that my metadata or abundance files are formatted. I have tried to compare them to the example data and cannot see any obvious differences.

@cafferychen777
Copy link
Owner

Hi,

Thank you for reaching out about this issue. Since the package works fine with the example data but not with your data, it does suggest there might be some formatting differences that aren't immediately apparent.

To help diagnose the problem, you can send your data files to cafferychen777@tamu.edu, and I'll be happy to test them and identify any potential formatting issues.

Please include:

  1. Your metadata file
  2. Your abundance data
  3. A brief description of how you're running the pathway_errorbar function

This will allow me to replicate the error and provide specific guidance for your case.

Best regards,
Chen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants