error using render function ete3 in python

211 views Asked by At

I try to render a tree using ete3 in python. This is my basic code:

from ete3 import Tree, TreeStyle
t = Tree( "((a,b),c);" )
circular_style = TreeStyle()
circular_style.mode = "c" # draw tree in circular mode
circular_style.scale = 20
t.render("mytree.png", w=183, units="mm", tree_style=circular_style)

And I get this error message:

Traceback (most recent call last):
  File "test.py", line 9, in <module>
    t.render("mytree.png", w=183, units="mm", tree_style=circular_style)
  File "/usr/local/bioinfo/src/python/current/lib/python2.7/site-packages/ete3/coretype/tree.py", line 1362, in render
    units=units, dpi=dpi)
  File "/usr/local/bioinfo/src/python/current/lib/python2.7/site-packages/ete3/treeview/drawer.py", line 104, in render_tree
    tree_item, n2i, n2f = render(t, img)
  File "/usr/local/bioinfo/src/python/current/lib/python2.7/site-packages/ete3/treeview/qt4_render.py", line 302, in render
    render_node_content(node, n2i, n2f, img)
  File "/usr/local/bioinfo/src/python/current/lib/python2.7/site-packages/ete3/treeview/qt4_render.py", line 628, in render_node_content
    node_ball = _CircleItem(node)
  File "/usr/local/bioinfo/src/python/current/lib/python2.7/site-packages/ete3/treeview/qt4_render.py", line 84, in __init__
    self.setBrush(QtGui.QBrush(QtGui.QColor(self.node.img_style["fgcolor"])))
TypeError: unable to convert a Python 'str' object to a C++ 'QString' instance

It seems that the render function doesn't work but I don't see where is the issue. Does anybody have a clue? Could it be a matter of version?

Thanks!

0

There are 0 answers