Python package for building, comparing, annotating, manipulating and visualising trees. It provides a comprehensive API and a collection of command line tools, including utilities to work with the NCBI taxonomy tree.
I have used your tool previously to draw some trees. Now, coming back to edit some minor things, I can't get it to work.
Firstly, I've tried installing ete3 using your instructions. I'm on Mac OS.
conda install -c etetoolkit ete3 ete_toolchain
which fails with an error
Encountered problems while solving:
- package ete_toolchain-3.0.0-h73706c9_0 requires pmodeltest 1.4.*, but none of the providers can be installed
Trying to remove ete_toolchain like so
conda install -c etetoolkit ete3
yield this dependency issue
Encountered problems while solving:
- nothing provides qt 4.8.* needed by pyqt-4.11.4-py27_0
OK, so the recommended way fails due to dependency issues. I tried to install it from conda-forge which has your latest 3.1.2 release. It works, presumably due to upscaling the Pyqt version to PyQt5. However, the simplest example fails with an exception:
from ete3 import Tree
t = Tree( "((a,b),c);" )
t.render('%%inline')
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[1], line 4
1 from ete3 import Tree
3 t = Tree( "((a,b),c);" )
----> 4 t.render('%%inline')
File ~/conda/miniconda3/envs/ete/lib/python3.11/site-packages/ete3/coretype/tree.py:1392, in TreeNode.render(self, file_name, layout, w, h, tree_style, units, dpi)
1388 return drawer.get_img(self, w=w, h=h,
1389 layout=layout, tree_style=tree_style,
1390 units=units, dpi=dpi, return_format=file_name)
1391 else:
-> 1392 return drawer.render_tree(self, file_name, w=w, h=h,
1393 layout=layout, tree_style=tree_style,
1394 units=units, dpi=dpi)
File ~/conda/miniconda3/envs/ete/lib/python3.11/site-packages/ete3/treeview/drawer.py:111, in render_tree(t, imgName, w, h, layout, tree_style, header, units, dpi)
109 scene.addItem(scene.master_item)
110 if imgName.startswith("%%inline"):
--> 111 imgmap = save(scene, imgName, w=w, h=h, units=units, dpi=dpi)
112 else:
113 x_scale, y_scale = save(scene, imgName, w=w, h=h, units=units, dpi=dpi)
File ~/conda/miniconda3/envs/ete/lib/python3.11/site-packages/ete3/treeview/main.py:752, in save(scene, imgName, w, h, dpi, take_region, units)
750 else:
751 targetRect = QRectF(0, 0, w, h)
--> 752 ii= QImage(w, h, QImage.Format_ARGB32)
753 ii.fill(QColor(Qt.white).rgb())
754 ii.setDotsPerMeterX(dpi / 0.0254) # Convert inches to meters
TypeError: arguments did not match any overloaded call:
QImage(): too many arguments
QImage(size: QSize, format: QImage.Format): argument 1 has unexpected type 'float'
QImage(width: int, height: int, format: QImage.Format): argument 1 has unexpected type 'float'
QImage(data: bytes, width: int, height: int, format: QImage.Format): argument 1 has unexpected type 'float'
QImage(data: PyQt5.sip.voidptr, width: int, height: int, format: QImage.Format): argument 1 has unexpected type 'float'
QImage(data: bytes, width: int, height: int, bytesPerLine: int, format: QImage.Format): argument 1 has unexpected type 'float'
QImage(data: PyQt5.sip.voidptr, width: int, height: int, bytesPerLine: int, format: QImage.Format): argument 1 has unexpected type 'float'
QImage(xpm: List[str]): argument 1 has unexpected type 'float'
QImage(fileName: str, format: typing.Optional[str] = None): argument 1 has unexpected type 'float'
QImage(a0: QImage): argument 1 has unexpected type 'float'
QImage(variant: Any): too many arguments
Alright, the next thing I try is to install the newest version from GitHub.
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[3], line 4
1 from ete4 import Tree
3 t = Tree( "((a,b),c);" )
----> 4 t.render('%%inline')
File ~/Projects/ete_sandbox/ete/ete4/coretype/tree.pyx:1375, in ete4.coretype.tree.Tree.render()
File ~/Projects/ete_sandbox/ete/ete4/treeview/drawer.py:65, in render_tree(t, imgName, w, h, layout, tree_style, header, units, dpi)
63 n.add_prop("_nid", nid)
64 scene, img = init_scene(t, layout, tree_style)
---> 65 tree_item, n2i, n2f = render(t, img)
67 scene.init_values(t, img, n2i, n2f)
68 tree_item.setParentItem(scene.master_item)
File ~/Projects/ete_sandbox/ete/ete4/treeview/qt4_render.py:212, in render(root_node, img, hide_root)
209 na_face = faces.AttrFace("name", fsize=10, ftype="Arial", fgcolor="black")
211 for n in root_node.traverse(is_leaf_fn=_leaf):
--> 212 set_style(n, layout_fn)
214 if img.show_branch_length:
215 n.add_face(bl_face, 0, position="branch-top")
File ~/Projects/ete_sandbox/ete/ete4/treeview/qt4_render.py:731, in set_style(n, layout_func)
726 def set_style(n, layout_func):
727 #if not isinstance(getattr(n, "img_style", None), NodeStyle):
728 # print "Style of", n.name ,"is None"
729 # n.set_style()
730 # n.img_style = NodeStyle()
--> 731 n.add_prop("_temp_faces", _FaceAreas())
734 for func in layout_func:
735 func(n)
File ~/Projects/ete_sandbox/ete/ete4/treeview/main.py:522, in _FaceAreas.__init__(self)
520 def __init__(self):
521 for a in FACE_POSITIONS:
--> 522 setattr(self, a, FaceContainer())
File ~/Projects/ete_sandbox/ete/ete4/treeview/main.py:527, in _FaceAreas.__setattr__(self, attr, val)
525 if attr not in FACE_POSITIONS:
526 raise AttributeError("Face area [%s] not in %s" %(attr, FACE_POSITIONS) )
--> 527 return super(_FaceAreas, self).__setattr__(attr, val)
TypeError: super(type, obj): obj must be an instance or subtype of type
OK, so, at this point, I gave up.
So, please, dear developers, provide at least a single working version of your tool so that the people like me who relied on it in the past (and cited your work) can at least edit their own code. Thanks for your attention.
Hello, folks,
I have used your tool previously to draw some trees. Now, coming back to edit some minor things, I can't get it to work.
Firstly, I've tried installing
ete3
using your instructions. I'm on Mac OS.which fails with an error
Trying to remove
ete_toolchain
like soyield this dependency issue
OK, so the recommended way fails due to dependency issues. I tried to install it from
conda-forge
which has your latest3.1.2
release. It works, presumably due to upscaling the Pyqt version toPyQt5
. However, the simplest example fails with an exception:Alright, the next thing I try is to install the newest version from GitHub.
It all works fine and, as a result, I get
Again, trying the example above
I get this error:
Alright, after installing Matplotlib with
and rerunning the example above I get the same error as with the old
ete=3.1.2
After reading the traceback, I tried replacing the line
Which leads to an error below:
Again, I tried casting to the correct type
which lead me to the following error
OK, so, at this point, I gave up.
So, please, dear developers, provide at least a single working version of your tool so that the people like me who relied on it in the past (and cited your work) can at least edit their own code. Thanks for your attention.