SimonGreenhill / treemaker

A Python library for creating a Newick formatted tree from a set of classification strings
BSD 3-Clause "New" or "Revised" License
8 stars 2 forks source link

Add option to write newick/nexus output with node labels #20

Closed mnacamura closed 5 years ago

mnacamura commented 5 years ago

This PR adds an option to include node labels in the newick/nexus output.

I am not sure if it should be shared in public―it might be a bit niche option―and am also not sure if this is the optimal implementation to achieve it. Feel free to close this PR if it is not proper enough to be merged.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling d7f6b52fe404f9447c3dc54c2163650efb254fd2 on mnacamura:node_labels into 007c5a7a8fabdba0ac2d4189aa35dc94155d5c01 on SimonGreenhill:master.

SimonGreenhill commented 5 years ago

Thanks @mnacamura -- I'll tweak this and merge it when I get a chance! (I think I'll subclass TreeMaker)

SimonGreenhill commented 5 years ago

Thanks @mnacamura for the input, I went with a slightly different implementation. You should be able to now show nodelabels by passing the command --labels to TreeMaker, see this

mnacamura commented 5 years ago

Thanks @SimonGreenhill for the update! Version 1.3 works very well for me. I found some minor errors in the update so please check my comments on the commit https://github.com/SimonGreenhill/treemaker/commit/ff9405d56e357ab4014732af59698c59b9a8d8fb

SimonGreenhill commented 5 years ago

thanks for spotting that -- I've fixed it in https://github.com/SimonGreenhill/treemaker/commit/977553e3202ade812bad8e4239487751f58c7190