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

Error message 'R session aborted' when running modelTest(primates) #157

Open
Zhangvvv opened this issue Dec 15, 2023 · 2 comments
Open

Error message 'R session aborted' when running modelTest(primates) #157

Zhangvvv opened this issue Dec 15, 2023 · 2 comments

Comments

@Zhangvvv
Copy link

Zhangvvv commented Dec 15, 2023

H i, I am currently facing an issue while using the modelTest function in R, and I would greatly appreciate your assistance in resolving it.
Every time I run the code modelTest(primates) in RStudio, I encounter an error message stating that the R session has aborted. The only option available to me is to start a new session. I have attempted various troubleshooting steps, including reinstalling the package, restarting my computer, and even switching to a different computer, but I consistently receive the same error message.
To investigate further, I also tested the code with previously successful data, but I still encountered the same error. The size of my data is within 200 KB and stored in a FASTA file format.
截屏2023-12-15 23 32 20

Here is the code I am using:

library(ape)
library(seqinr)
library(adegenet)
library(phangorn)
bin_name <- fasta2DNAbin(file = "./g1a.fasta")
primates <- as.phyDat(bin_name)
modelTest(primates)

The alignment of my dna data is as follows:
截屏2023-12-16 00 10 33

Information about version:

R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.4

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] phangorn_2.11.1 adegenet_2.1.7  ade4_1.7-19     seqinr_4.2-16   ape_5.7-1      

I would be grateful if you could provide any insights or advice on how to resolve this issue. Please let me know if there is any additional information or steps I can provide to assist in troubleshooting.

Thank you very much for your time and support. I look forward to your response.

@KlausVigo
Copy link
Owner

Dear @Zhangvvv,

What version of phangorn are you using?
First, you can shorten your code a bit

library(phangorn)
g1a <- read.phyDat(file = "./g1a.fasta", fomat="fasta)

From the image it looks like your sequences are not very well aligned, but that is hard to judge from this image alone.
What kind of sequences are you using? And is it possible to send or share the sequences with me?
Can you run

dm <- dist.hamming(ga1)
max(dm)

If max(dm) is close to 0.75 or larger edge length will be large (or infinity) and this could be the reason for the error.

The alignment of my dna data is as follows: 截屏2023-12-16 00 10 33

Information about version:

R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.4

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] phangorn_2.11.1 adegenet_2.1.7  ade4_1.7-19     seqinr_4.2-16   ape_5.7-1      

I would be grateful if you could provide any insights or advice on how to resolve this issue. Please let me know if there is any additional information or steps I can provide to assist in troubleshooting.

Thank you very much for your time and support. I look forward to your response.

@Zhangvvv
Copy link
Author

Dear@KlausVigo
Thank you very much for taking the time to help me with my issue amid your busy schedule.

My phangorn version is: phangorn_2.11.1

I've just executed the code you provided, and my results are as follows:

g1a <- read.phyDat(file = "./g1a.fasta", format="fasta")
dm <- dist.hamming(g1a)
max(dm)
[1] 0.658671

Previously, I was able to run this code perfectly, but now I'm unsure why it's suddenly not working as expected. To help you better understand the issue, I've uploaded my raw data, the code for data processing, and the processed data to a GitHub repository. The link is provided below:

https://github.com/Zhangvvv/error-about-modelTest

I'm looking forward to your response and further guidance. Once again, thank you for your assistance!

@Zhangvvv Zhangvvv reopened this Dec 19, 2023
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

2 participants