EcoJulia / Phylo.jl

Simple phylogenetic trees in Julia to work with Diversity.jl - https://github.com/EcoJulia/Diversity.jl
BSD 2-Clause "Simplified" License
34 stars 13 forks source link

Add function to save/write a tree in Newick format #61

Closed diegozea closed 10 months ago

diegozea commented 3 years ago

I think it will be useful, particularly to share the tree between sessions and programs.

richardreeve commented 3 years ago

Yes, it's a good idea. I also want to write an entirely new parser for newick and nexus format, because the current one is a mess, and it looks like CombinedParsers.jl can handle recursion (finally, a julia parser that can!) - and something to convert between PhyloNetwork's format and this one, possibly just via a wrapper of some kind:

struct TreeWrapper{Tree} <: AbstractTree
  tree::Tree
end

where the wrapper implements our interface. From there I was wondering whether there was a sensible way of allowing us to traverse a tree to allow us to convert between any file format or tree format via a common interface... essentially iterating over the one you have while creating the other one. Just speculating really, but it would solve a lot of problems...

richardreeve commented 10 months ago

This was solved in #88.