[Biopython-dev] [Bug 3036] New: PhyloXML cannot read node colors created by PhyloXML

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Fri Mar 26 22:28:10 UTC 2010


http://bugzilla.open-bio.org/show_bug.cgi?id=3036

           Summary: PhyloXML cannot read node colors created by PhyloXML
           Product: Biopython
           Version: Not Applicable
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main Distribution
        AssignedTo: biopython-dev at biopython.org
        ReportedBy: joelb at lanl.gov


Using a simple example file provided:

>>> tree = Phylo.read('bcl_2.xml','phyloxml')
>>> tree.clade[0].color = Phylo.PhyloXML.BranchColor(255,0,255)
>>> tree.clade[0].color
BranchColor(blue='255', green='0', red='255')
Phylo.write(tree,'colored.phyloxml','phyloxml')
1
>>> tree2=Phylo.read('colored.phyloxml','phyloxml')
Traceback (innermost last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.6/site-packages/Bio/Phylo/_io.py", line 57, in read
    tree = tree_gen.next()
  File "/usr/lib64/python2.6/site-packages/Bio/Phylo/_io.py", line 42, in parse
    for tree in getattr(supported_formats[format], 'parse')(file):
  File "/usr/lib64/python2.6/site-packages/Bio/Phylo/PhyloXMLIO.py", line 317,
in parse
    yield self._parse_phylogeny(elem)
  File "/usr/lib64/python2.6/site-packages/Bio/Phylo/PhyloXMLIO.py", line 342,
in _parse_phylogeny
    phylogeny.root = self._parse_clade(elem)
  File "/usr/lib64/python2.6/site-packages/Bio/Phylo/PhyloXMLIO.py", line 388,
in _parse_clade
    clade.clades.append(self._parse_clade(elem))
  File "/usr/lib64/python2.6/site-packages/Bio/Phylo/PhyloXMLIO.py", line 410,
in _parse_clade
    setattr(clade, tag, getattr(self, tag)(elem))
  File "/usr/lib64/python2.6/site-packages/Bio/Phylo/PhyloXMLIO.py", line 518,
in color
    return PX.BranchColor(red, green, blue)
  File "/usr/lib64/python2.6/site-packages/Bio/Phylo/PhyloXML.py", line 432, in
__init__
    ), "Color values must be integers between 0 and 255."
AssertionError: Color values must be integers between 0 and 255.

This is not a problem with an example file not written by biopython:
>>> tree = Phylo.parse('made_up.xml','phyloxml').next()
>>> tree.clade[0].color
BranchColor(blue='28', green='220', red='128')

Also, forester/archaeoptryx is able to correctly read colors written by
biopython.


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list