Open JosephCrispell opened 4 years ago
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!
Hi @hofskatr,
Sorry for responding so slowly on this. The readAnnotatedTree()
function is a really simple one:
https://github.com/JosephCrispell/homoplasyFinder/blob/faed16f2ff1602a2a939663a942e0b8640b9bc50/R/homoplasyFinder.R#L270-L279
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
I think the
R Session Aborted
error is caused byhomoplasyFinder
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 tryrunHomoplasyFinderInJava()
I get theR Session Aborted
error.Maybe I could add an
rJava
close all function at the start ofrunHomoplasyFinderInJava()
?