[Bioperl-guts-l] [Bug 1854] New: TreeIO cannot parse some Nexus
tree files, causing next_tree to fail silently
bugzilla-daemon at portal.open-bio.org
bugzilla-daemon at portal.open-bio.org
Sat Sep 10 15:37:16 EDT 2005
http://bugzilla.open-bio.org/show_bug.cgi?id=1854
Summary: TreeIO cannot parse some Nexus tree files, causing
next_tree to fail silently
Product: Bioperl
Version: main-trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Core Components
AssignedTo: bioperl-guts-l at bioperl.org
ReportedBy: kliu_cali at yahoo.com
I'm posting a problem I ran across while using Bio::TreeIO to convert trees
from Nexus to Newick format.
Line 150 in nexus.pm reads:
if( /^\s+(\S+)\s+([^\s\,\;]+)\s*([\,\;])?\s*$/ ) {
It should really at least be changed to:
if( /^\s*(\S+)\s+([^\s\,\;]+)\s*([\,\;])?\s*$/ ) {
Thus, nexus.pm expects at least one space in front of each line in the
Translate block of the Nexus tree file.
Something like the sample Nexus tree file at
http://workshop.molecularevolution.org/resources/fileformats/tree_formats.php
doesn't work! This ate up a bunch of my time until I went through Jason
Stajich's nexus.pm code. (file below)
#NEXUS
Begin trees; [Treefile saved Wed Jul 26 19:40:41 2000]
[output from your data run]
Translate 1 TRXEcoli, 2 TRXHomo, 3 TRXSacch, 4 erCaelA, 5 erCaelB, 6 erCaelC, 7
erHomoA, 8 erHomoB, 9 erHomoC, 10 erpCaelC ; tree PAUP_1 = [&U]
(1,((2,3),((((4,10),(5,8)),(6,9)),7))); End;
INSTEAD, It needs to be something like:
#NEXUS
Begin trees; [Treefile saved Wed Jul 26 19:40:41 2000]
[output from your data run]
Translate
1 TRXEcoli,
2 TRXHomo,
3 TRXSacch,
4 erCaelA,
5 erCaelB,
6 erCaelC,
7 erHomoA,
8 erHomoB,
9 erHomoC,
10 erpCaelC ;
tree PAUP_1 = [&U] (1,((2,3),((((4,10),(5,8)),(6,9)),7))); End;
That will parse.
What's annoying is that there aren't any error messages in the event that
there is a parse error - it just fails silently, and then next_tree returns
Undef as if there were no tree. :(
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the Bioperl-guts-l
mailing list