Updating my Newick parser
Back in 2003 I wrote a small parser for the Newick tree format. It is pretty straightforward Python code, and basically just something I hacked up because I needed to manipulate some trees for a project.
Figuring that others might also find it useful I put it on my webpage and that’s about it for the story of my Newick parser. I’ve used it in a few other projects, but haven’t really developed it further from the initial code, and haven’t really received much feedback on it.
Except for this weekend where I got three emails about it. I might have received one email a year until now.
It was a few bug reports and some questions, and because of the bug reports I’ve now made a new release, version 1.3.
I also have a Newick parser for C++. Actually, I have more than one, since there are two different parsers in QDist and SplitDist, but the one I have in mind is more stand-alone and can probably be used by others.
It is a recursive decent parser I wrote in Boost.Spirit as an exercise to learn the Spirit language.
I think I will clean it up a bit and put it up on the web…
October 3rd, 2008 at 6:58 am
Ooh, a Spirit-based newick parser. I could use that for when I redo Dawg.
October 3rd, 2008 at 7:13 am
Let me just clean up the code and I’ll put it on the web. I just need to remove some bits and pieces from other projects, that do not really belong with the parser.
October 3rd, 2008 at 8:37 am
[...] the Newick parser for C++ I mentioned in a previous post. It is written in Boost.Spirit, so it is a recursive decend parser. This might give you [...]
July 1st, 2009 at 7:40 pm
I just had a look at your newick parser in python. Looks like it might be just what
I need. Can you tell me how to use it?
Thanks, Alan
July 1st, 2009 at 7:47 pm
Alan: I’d love to, but let me know what your problem is first. I thought I explained that on the web page, but if there are any problems I need to update the description there, so your help in letting me know where I am unclear would be much appreciated!
January 15th, 2010 at 9:45 am
Hi Thomas,
I added support for internal node labels to your parser, but probably broke support for bootstraps (which I don’t need at the moment). See:
http://blog.mckuhn.de/2010/01/newick-parser-for-python-supporting.html
http://bitbucket.org/mkuhn/newick/
best wishes, Michael