PierreBarrat / TreeTools.jl

Tools for handling rooted phylogenetic or genealogic trees with Julia.
https://pierrebarrat.github.io/TreeTools.jl/
MIT License
6 stars 1 forks source link

add print_tree_ascii function to TreeTools #8

Closed anna-parker closed 2 years ago

anna-parker commented 2 years ago

screenshot_draw_ascii Tees can now be printed in the terminal as in Bio.Phylo.draw_ascii using the print_tree_ascii command directly in julia without having to use a python wrapper (PyCall). I noticed PyCall has some strange behavior changes when moving from VScode to jupyter and vice versa so thought it might be good to add this.

PierreBarrat commented 2 years ago

Nice!! Some comments:

  1. Does not work for trees that have missing branch length. Capture du 2022-04-11 17-22-13

    Maybe we could assign a default branch length in this case?

  2. Since this display of trees is much nicer than the current one, we should change the show(t::Tree) function to call print_tree_ascii

anna-parker commented 2 years ago

Hi! I hope this sorts out your comments, I have just opted for the easy approach when any branch length is unknown the tree will be constructed using unit branch lengths and will print that it is doing so, as shown below: ascii_fix

PierreBarrat commented 2 years ago

Looking good :smiley: