[Biopython-dev] [biopython] Bugfix in test_Phylo; branch length formatter for Newick trees (#7)

Eric Talevich eric.talevich at gmail.com
Fri May 27 14:30:08 UTC 2011


On Fri, May 27, 2011 at 9:52 AM, Peter Cock <p.j.a.cock at googlemail.com>wrote:

> On Fri, May 27, 2011 at 2:48 PM, Erick Matsen <matsen at fhcrc.org> wrote:
> > Hello everyone--
> >
> >
> > Hope you don't mind my chiming into this discussion.
> >
> >> Good to know. The format for confidences is also hard-coded ("%1.2f"),
> do
> >> you suppose that should be given the same treatment?
> >
> > I think this would be entirely appropriate. There are some cases (eg
> > bootstrap) where the confidence is actually a count, and being able to
> > express it as such might be convenient.
>

OK, this should be easy enough to fix.



>  > I have one related point to discuss if you don't mind. In
> >
> > https://github.com/biopython/biopython/blob/master/Bio/Phylo/<https://github.com/biopython/biopython/blob/master/Bio/Phylo/NewickIO.py#L246>
>
>>
>> Peter
>>
> NewickIO.py#L246<https://github.com/biopython/biopython/blob/master/Bio/Phylo/NewickIO.py#L246>
> >
> > trees without confidence values get written out as trees with confidence
> > values of zero. These are of course two different things.
> >
> > I realize that if we want to write out a tree without confidence values
> > we can specify branchlengths_only, but it would seem to me that the most
> > natural behavior would be to just write out confidence values when they
> > are specified.
> >
> > In particular, it surprises me that reading a tree and then writing it
> > with the default settings changes the meaning of the tree.
> >
> > I realize that changing the behavior like this might not be possible
> > because this is a large group project, but I thought I would point it
> > out.
> >
> > Thank you for your great work here!
> >
> > Erick
>
> That is a very good point. Can we use None for no confidence value?
>
>
Yes, that should be the case, and also NewickIO should not add confidence
values of 0.0 during serialization where clade.confidence is None. This
probably deserves another test in test_Phylo.py.

I don't see a problem with changing this behavior in Bio.Phylo, as long as
it's still creating Newick files that work with other widely-used software.

-Eric



More information about the Biopython-dev mailing list