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

generate_alpha_trend_test_long giving fatal error, aborting R session #30

Open
aherms12 opened this issue Feb 8, 2024 · 6 comments
Open
Labels
bug Something isn't working user-environment Issues tagged with this label are suspected to arise from the user's specific environment or setup r

Comments

@aherms12
Copy link

aherms12 commented Feb 8, 2024

Thank you for this great package for longitudinal microbiome analyses. Every time I try to run the generate_alpha_trend_test_long function my R is crashing. it says "R encountered a fatal error, The session was terminated". I have tried both with my data and with the example data (subset_T2D), and it crashes on that function each time.

Code:
data("subset_T2D.obj")
alpha_trend_test_results <- generate_alpha_trend_test_long(
data.obj = subset_T2D.obj,
alpha.name = c("shannon","observed_species"),
time.var = "visit_number_num",
subject.var = "subject_id",
group.var = "subject_race",
adj.vars = NULL
)

and also my data:
alpha_trend_test_results <- generate_alpha_trend_test_long(
data.obj = mbstat.obj,
alpha.name = c("shannon","simpson","observed_species"),
time.var = "time.num",
subject.var = "ID",
group.var = "Study.Group",
adj.vars = NULL
)
Screenshot 2024-02-08 145801

I have tried to use debug() and find the spot in the code where it is crashing and it seems to be after the alpha_df line. I have tried this many times and can get all other functions in the alpha diversity longitudinal analysis to run except for this one.

  • Operating System: Windows 11
  • R Version: 4.3.1
  • Package Version: 1.1.3
@aherms12 aherms12 added the bug Something isn't working label Feb 8, 2024
@cafferychen777
Copy link
Owner

cafferychen777 commented Feb 9, 2024

Dear @aherms12,

Thank you for bringing this issue to my attention and for your detailed report. It's indeed puzzling that the generate_alpha_trend_test_long function from the MicrobiomeStat package is causing R sessions to crash on your end, especially given that it runs without issue on my MacBook. Here's the session information for my setup for reference:

  • R Version: 4.3.1 (2023-06-16)
  • Platform: x86_64-apple-darwin20 (64-bit)
  • Running under: macOS Sonoma 14.0
  • Other Details: Using MicrobiomeStat version 1.1.3, with other packages like tibble 3.2.1 and rlang 1.1.2 loaded.

Given the differences in our operating systems and possibly other environmental factors, it's possible that the issue might be specific to certain setups or configurations. I will attempt to replicate the issue on a Windows machine to better understand what might be causing the crash. Debugging these kinds of issues can be quite challenging and time-consuming, but please rest assured that I'm committed to resolving it.

In the meantime, if you haven't already, could you please try updating all your R packages to the latest versions? Occasionally, compatibility issues between packages or specific versions of R can lead to unexpected behavior. Additionally, checking the memory usage might be helpful, as intensive computations could potentially lead to crashes if the system runs out of memory.

I appreciate your patience and understanding as I work through this issue. Resolving it is a priority for me, and I'll keep you updated on my progress. Should you have any more information or if there's anything else I can assist you with, please don't hesitate to reach out.

Best regards,

Chen YANG
Screenshot 2024-02-09 at 14 40 43

Screenshot 2024-02-09 at 14 41 01

@cafferychen777
Copy link
Owner

Dear @aherms12,

Following up on our previous conversation regarding the issue with the generate_alpha_trend_test_long function in the MicrobiomeStat package causing R sessions to crash, I have an additional suggestion that might help us pinpoint the problem more quickly.

If you have access to another computer, could you please try running the same code there to see if the issue persists? This could provide valuable insight into whether the problem is specific to a particular system or setup. It would be especially helpful if you could test it on a system with a different operating system or on another version of Windows, if available.

This step could help us determine if the issue is related to system-specific configurations, R versions, package versions, or perhaps even hardware limitations. Your cooperation in this troubleshooting process is greatly appreciated and could be crucial in resolving the issue more swiftly.

Please let me know the outcome of these tests at your earliest convenience. Your feedback is invaluable in helping us improve the package and ensure it functions correctly across various environments.

Thank you once again for your patience and assistance. I look forward to hearing back from you soon.

Best regards,

Chen YANG

@cafferychen777
Copy link
Owner

Dear @aherms12,

I hope this message finds you well. I wanted to provide you with an update following our recent discussions regarding the issue you've encountered with the generate_alpha_trend_test_long function in the MicrobiomeStat package.

After conducting tests on several different computers, including various operating systems and configurations, I've been able to run the function successfully on all tested systems. This extensive testing has led me to believe that the problem might be related to the available memory on your computer.

The generate_alpha_trend_test_long function performs complex calculations, including linear mixed-effects models, which can consume a significant amount of memory. If the available memory on your computer is insufficient, it could lead to the R session being terminated abruptly, as you've experienced.

Here are a few suggestions to help mitigate this issue:

  1. Close other programs that might be running on your computer to free up as much memory as possible before running the analysis.
  2. Increase your computer's memory, if possible, to provide more resources for processing intensive tasks.

I understand that these suggestions might not be ideal or immediately feasible, but they could provide a temporary workaround until a more permanent solution is found. I will continue to explore ways to optimize the function to reduce its memory footprint and improve its efficiency across all systems.

Thank you for your patience and cooperation in this matter. Your feedback has been invaluable, and I'm committed to resolving this issue to ensure the MicrobiomeStat package meets the needs of all its users. Please keep me posted on any developments on your end or if there's anything further I can do to assist.

Best regards,

Chen Yang

@cafferychen777 cafferychen777 added the user-environment Issues tagged with this label are suspected to arise from the user's specific environment or setup r label Feb 10, 2024
@aherms12
Copy link
Author

I have updated all packages, checked the memory, closed out all other programs, and the fatal error is still happening.

I was able to download R on another laptop (it's also windows 11 with same memory), and I'm able to get the package to work on that computer. It has the same R version.

I still haven't been able to find what's causing the crash, although the generate_beta_trend_test_long also gives the fatal error, and the generate_alpha_change_test_long function doesn't crash the system, but won't work on my personal laptop. Both functions work on the alternate laptop. It seems to be something with my system, but that's as far as I've gotten. I will report back if I figure it out.

@cafferychen777
Copy link
Owner

Dear @aherms12,

Regarding the fatal error when running generate_alpha_trend_test_long and generate_beta_trend_test_long on your personal laptop, could you let me know the RAM capacities on both laptops? I suspect the RAM could be a decisive factor causing the crashes.

Comparing the hardware specs between the two systems would help narrow down what's different that allows the functions to work properly on one laptop but crash on the other. Once we determine that, there may be ways to optimize the code or system resources to prevent crashing.

Please let me know the RAM and any other major hardware details. I'm happy to help troubleshoot further so we can get the functions running smoothly!

Best regards,
Chen YANG

@aherms12
Copy link
Author

They both have 16 GB RAM and the same processor (11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working user-environment Issues tagged with this label are suspected to arise from the user's specific environment or setup r
Projects
None yet
Development

No branches or pull requests

2 participants