Pythogenies

I had to teach myself a bit of Python recently, so decided to do it by implementing this parse_phylogeny.py thing (it’s uploaded here as a text file). It takes a nice intuitive mark-down for phylogenetic trees (below) and spits out a Newick file (-f nwk), or a Wikipedia clade format (-f wp). It’s not amazing (hey, it was my first attempt at Python in anger) and I know there’s a bunch of repetitious stuff in the functions that could be lifted out, but whatever. Maybe you’ll find a use for it.

-Embryophyta
  -Liverworts
    -_____
      -_____
        -Hornworts
        -Tracheophytes
          -Euphyllophytes
            -Spermatophytes
              -Gymnosperms
              -Angiosperms
            -Ferns
          -Lycopods
    -Mosses

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.