Repository navigation
Conversation
|
Thanks for the contribution. This reasoning makes sense to me. However: This would break compatibility between versions as it is. It would be safer to add a flag like allow_integer_names (similar to values_are_confidence and comments_are_confidence) to enable this behavior on new scripts. But if the alternative is basically unusable, then we would want to just fix it. The current behavior derives from the Bio.Nexus module, so I'd like to hear from the original authors why they chose this behavior. (Is Frank on Github?) |
|
Does the problem happen if using the |
|
The Bio.Phylo Newick parser is a port rather than a wrapper of the Bio.Nexus.Trees parser; I left this behavior the same under the assumption that the original authors had specific reasons for wanting these options and default behaviors, but we're free to diverge if we have good reasons (I agree with @bsmith89 that this patch is better default behavior). Bio.Phylo's Nexus parser does call out to Bio.Nexus to parse trees, so if we change the behavior here, we should also change Bio.Nexus.Trees similarly so that Bio.Phylo's "newick" and "nexus" formats behave the same. |
|
I don't think Frank is on GitHub - best bring this up on the biopython-dev list for comment? |
|
It looks like a bug to me; it should clearly be parsed as 3 taxa name 0, 1 and 2 |
|
I think (without looking at the code) this is because these values (separated with a column) originally were to be interpreted as branch lengths and confidence values, which is on purpose. Support for labels was added later (was that me, actually...?). |
|
Sounds like it would be OK to just fix this in Bio.Phylo.NewickIO without a On Mon, Sep 22, 2014 at 3:40 AM, Frank [email protected] wrote:
|
|
Merged. Thanks, everyone. I would like to make the equivalent change in Bio.Nexus.Trees to keep the behavior consistent, but I'm not sure how to do it. Would anyone else like to give it a shot? |
|
RE: #898 (comment) - Thank you Byron! |
Numeric taxa names in Newick trees are parsed as branch confidence.
For instance a newick file
would be parsed as a tree with three, unnamed terminal nodes with confidence values of 0, 1, and 2.
I believe this is a bug, since
branches to(edit 9/12) terminal nodes shouldn't have confidence values.I've edited
Bio/Phylo/NewickIO.pyso that it behaves as I would expect, and written a unit test.