ms609 / TreeSearch

R package for phylogenetic tree search under custom optimality criteria
https://ms609.github.io/TreeSearch/
GNU General Public License v3.0
5 stars 4 forks source link

Random crashes due to allocation issues #56

Open nicolamos opened 4 years ago

nicolamos commented 4 years ago

Turbinicarpus ss_26 paupout.txt

I have tested the package with some data (attached). Here the code that causes the crash. This snippet is taken from vignettes/inapplicable.rmd example code, which runs flawlessly.


turbini.data <- ReadAsPhyDat("Turbinicarpus ss_26 paupout.nex")
RNGversion("3.5.0")
set.seed(0)

nj.tree <- NJTree(turbini.data)
outgroup <- c("beguinii")
rooted.tree <- EnforceOutgroup(nj.tree, outgroup)

better.tree <- TreeSearch(tree=rooted.tree, dataset=turbini.data,
                        EdgeSwapper=RootedNNISwap, verbosity=3)

Thank you very much for the help.

ms609 commented 4 years ago

Thanks for the report! I'll take a look when I'm back in the office next month.

ms609 commented 4 years ago

Sorry for the delay in investigating this.

I believe that the issue lies with the high number of character states employed. Are you able to regenerate the matrix such that only the digits 0:9 are used?

When I replaced characters outwith this range with '?',

turbiniChars <- ReadCharacters('../Turbinicarpus.ss_26.nex')
turbiniChars[!turbiniChars %in% as.character(0:9)] <- '?'
just0to9 <- MatrixToPhyDat(turbiniChars)

I did not experience the crash.

Hopefully this is a viable workaround whilst I make the software fail more gracefully, or better still not at all!

nicolamos commented 4 years ago

Thank you for the response. Yes, that should be the problem. Another possible workaround can be

raw_data <- ReadCharacters(“../Turbinicarpus.ss_26.nex")
turbini_phydata <- phyDat(raw_data, type='USER', levels=c(0:9, ":", "<", "=", ">", "@", "A", "B", "C", "D", "E", "G", "H", "K", "-“))

Best, Nicola