[Biopython-dev] [Bug 3044] New: PhyloXMLIO, assigning node_id causes failures on write after re-reading

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Tue Apr 6 20:48:18 UTC 2010


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

           Summary: PhyloXMLIO, assigning node_id causes failures on write
                    after re-reading
           Product: Biopython
           Version: Not Applicable
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Main Distribution
        AssignedTo: biopython-dev at biopython.org
        ReportedBy: joelb at lanl.gov


Hi, everybody.  Thanks for the prompt attention to my previous bugs as I work
my way through a PhyloXML project.

I updated my biopython from git and archaeoptryx from cvs on Friday and now
several things work differently, mostly for the better.

I have problems with writing any phyloXML tree which was read with node_id's
defined.  Writing the tree the first time doesn't fail, and the tree can be
subsequently read, but a failure occurs on the second write.  Again, using an
example file:

>>> tree = Phylo.read('bcl_2.xml', 'phyloxml')
>>> tree.clade[0].node_id = Phylo.PhyloXML.Id('node000')
>>> Phylo.write(tree,'test1.xml','phyloxml')
1
>>> tree1 = Phylo.read('test1.xml','phyloxml')
>>> Phylo.write(tree1,'test2.xml','phyloxml')
Traceback (innermost last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.6/site-packages/Bio/Phylo/_io.py", line 82, in write
    n = getattr(supported_formats[format], 'write')(trees, file, **kwargs)
  File "/usr/lib64/python2.6/site-packages/Bio/Phylo/PhyloXMLIO.py", line 142,
in write
    return Writer(obj).write(file, encoding=encoding, indent=indent)
  File "/usr/lib64/python2.6/site-packages/Bio/Phylo/PhyloXMLIO.py", line 684,
in __init__
    self._tree = ElementTree.ElementTree(self.phyloxml(phyloxml))
  File "/usr/lib64/python2.6/site-packages/Bio/Phylo/PhyloXMLIO.py", line 705,
in phyloxml
    elem.append(self.phylogeny(tree))
  File "/usr/lib64/python2.6/site-packages/Bio/Phylo/PhyloXMLIO.py", line 656,
in wrapped
    elem.append(getattr(self, subn)(getattr(obj, subn)))
  File "/usr/lib64/python2.6/site-packages/Bio/Phylo/PhyloXMLIO.py", line 661,
in wrapped
    elem.append(getattr(self, method)(item))
  File "/usr/lib64/python2.6/site-packages/Bio/Phylo/PhyloXMLIO.py", line 656,
in wrapped
    elem.append(getattr(self, subn)(getattr(obj, subn)))
  File "/usr/lib64/python2.6/site-packages/Bio/Phylo/PhyloXMLIO.py", line 651,
in wrapped
    elem = ElementTree.Element(tag, _clean_attrib(obj, attribs))
  File "/usr/lib64/python2.6/site-packages/Bio/Phylo/PhyloXMLIO.py", line 643,
in _clean_attrib
    val = getattr(obj, key)
AttributeError: 'str' object has no attribute 'provider'

If I specify a provider using
  tree.clade[0].node_id = Phylo.PhyloXML.Id('node000',provider='LANL')
I get the same error.

I realize it's fairly pointless specifying a node_id if one wants to intermix
with Java because forester pays no attention to node_id and assigns its own.  I
think this is a bug in the Java implementation, according to the XML schema.


-- 
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