[Biopython-dev] [Fwd: Bug in Biopython Phyloxml reader]

Eric Talevich eric.talevich at gmail.com
Thu Jun 16 02:29:18 UTC 2011


Folks,

I pushed a very small fix:
https://github.com/biopython/biopython/commit/db9d876ba2199efcce067241f5554ef701cb70e3

It appears I misunderstood the Nexus.Trees code while I was porting
NewickIO, so there was no good reason for this behavior to be the default.
Anyway, it behaves as expected now.

Nicolas: Bio.Phylo includes a function called 'convert' which you may also
find useful.

>>> Phylo.convert('foo.xml', 'phyloxml', 'bar.nwk', 'newick')

Cheers,
Eric


On Wed, Jun 15, 2011 at 10:20 AM, Eric Talevich <eric.talevich at gmail.com>wrote:

> Hi Nicolas and Brad,
>
> Thanks for reporting and forwarding this. The 0 -> 1 terminal branch
> lengths are another surprising default that crept in during the port of
> NewickIO; I don't see a problem with changing it to keep 0-length branches
> at the tips. The phyloXML parser and writer shouldn't be introducing this
> bug; it should just be occurring when writing in Newick or Nexus formats.
>
> I'll keep you posted on the fix, probably this weekend. If you'd like to
> try it yourself, the code to edit is in Bio/Phylo/NewickIO.py.
>
> Best,
> Eric
>
>
> On Wed, Jun 15, 2011 at 9:03 AM, Brad Chapman <chapmanb at 50mail.com> wrote:
>
>> Nicolas;
>> Thanks for reporting the problem. The Biopython mailing lists
>> (http://biopython.org/wiki/Mailing_lists) are the right place to
>> report these types of issues.
>>
>> Hopefully Eric or someone else on the list will be able to help.
>> Thanks again,
>> Brad
>>
>> ----- Forwarded message from Nicolas Rochette <
>> nicolas.rochette at univ-lyon1.fr> -----
>>
>> Date: Wed, 15 Jun 2011 14:25:09 +0200
>>
>> Sir,
>>
>> I apologize for contacting you directly, but I could not find the
>> right place for this report. Could you please forward it ?
>>
>> The bug is about 0-length terminal branches being given a length of 1
>> ; please find an example below.
>>
>> Regards,
>>
>> Nicolas Rochette
>> PhD student
>> Laboratory for Biometry and Evolutive Biology
>> Lyon, France
>>
>> //
>>
>> echo '(A:2,(B:0,C:3):0,D:5);' > foo.newick
>> java -cp forester.jar org.forester.application.phyloxml_converter
>> -f=nn -i foo.newick foo.phyloxml
>> python -c 'from Bio import Phylo;
>> Phylo.write(Phylo.read("foo.phyloxml","phyloxml"), "bar.newick",
>> "newick")'
>> cat bar.newick
>>
>> (A:2.00000,(B:1.00000,C:3.00000)0.00000:0.00000,D:5.00000)0.00:0.00000;
>>
>>
>> ----- End forwarded message -----
>> _______________________________________________
>> Biopython-dev mailing list
>> Biopython-dev at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/biopython-dev
>>
>
>



More information about the Biopython-dev mailing list