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

R Session Aborted #14

Open
JosephCrispell opened this issue Aug 31, 2020 · 2 comments
Open

R Session Aborted #14

JosephCrispell opened this issue Aug 31, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@JosephCrispell
Copy link
Owner

I think the R Session Aborted error is caused by homoplasyFinder hanging after an error has been introduced. See the image below, I introduced an error by sending the wrong file name, it sends error and the next time I try runHomoplasyFinderInJava() I get the R Session Aborted error.

image

Maybe I could add an rJava close all function at the start of runHomoplasyFinderInJava()?

@hofskatr
Copy link

Hi,
I'm running into this problem whenever I try to load in a tree.
I've tried both the annotated trees made in R and Java, and get the same results.

If I try and use quotes around the tree file name instead of pointing to the working directory I get an error that the file doesn't exist.
tree <- readAnnotatedTree("annotatedNewickTree_29-04-22.tree")
Error in file(file, "r") : cannot open the connection
In addition: Warning message:
In file(file, "r") :
cannot open file 'annotatedNewickTree_29-04-22.treeannotatedNewickTree_29-04-22.tree': No such file or directory
I don't understand why it's duplicating the tree name though.

If I try to use the working directory the R session crashes.

Do you have any advice or can I provide any files to help troubleshoot this?

Thanks!

@JosephCrispell
Copy link
Owner Author

JosephCrispell commented May 19, 2022

Hi @hofskatr,

Sorry for responding so slowly on this. The readAnnotatedTree() function is a really simple one:

#' Read in the annotated Newick tree
#'
#' This function runs reads in the annotated Newick formatted phylogenetic tree file produced by HomoplasyFinder. Node labels of tree report where changes occured for inconsistent positions ("-" separated)
#' @param path The full path to the directory where the output files were created (must match what was used for \code{runHomoplasyFinderInJava()})
#' @param date Date \code{runHomoplasyFinderInJava()} was ran. Format: "\%d-\%m-\%y". Defaults to today.
#' @keywords tree newick annotated
#' @export
readAnnotatedTree <- function(path, date=format(Sys.Date(), "%d-%m-%y")){
return(ape::read.tree(paste0(path, "annotatedNewickTree_", date, ".tree")))
}

The issue you have is that this function only wants the path to the file and then it will read in a file with file name structured:
"path/to/file/annotatedNewickTree_%d-%m-%y.tree"

Note the %d-%m-%y is a formatted date set through the date parameter, which defaults to today's date (the date you are running script).

In your case to avoid the error you might run something like:

readAnnotatedTree(path=".", date="29-04-22")

Sorry again for not replying sooner and let me know if the above makes sense and helps!

Joe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants