SeqMotifFace

52 views
Skip to first unread message

jba4...@gmail.com

unread,
Aug 13, 2015, 1:42:58 AM8/13/15
to The ETE toolkit
I am trying to get the SeqMotifFace module to work, so I created a simple test script:


#########################################################################
#!/usr/bin/python

from ete2 import Tree, TreeStyle, TextFace, SeqMotifFace
from ete2.treeview.faces import add_face_to_node

tree = Tree( "(a,b);" )

# Basic tree style
ts = TreeStyle()
ts.show_leaf_name = True

my_motif = [[1,10,'[]', None, 10, 'red', 'red']]

def lof(node):

if node.is_leaf():
seqFace = SeqMotifFace(my_motif)
add_face_to_node(seqFace, node, 1, position="aligned")
ts.layout_fn = lof
#t.render("motifs.png", w=1200, dpi=300, tree_style=ts)
tree.show(tree_style = ts)
########################################################################

When I try to run this, I get the error:

Traceback (most recent call last):
File "/home/joseph/bin/motif_test.py", line 20, in <module>
tree.show(tree_style = ts)
File "/usr/local/lib/python2.7/dist-packages/ete2/coretype/tree.py", line 1335, in show
tree_style=tree_style, win_name=name)
File "/usr/local/lib/python2.7/dist-packages/ete2/treeview/drawer.py", line 76, in show_tree
tree_item, n2i, n2f = render(t, img)
File "/usr/local/lib/python2.7/dist-packages/ete2/treeview/qt4_render.py", line 254, in render
set_style(n, layout_fn)
File "/usr/local/lib/python2.7/dist-packages/ete2/treeview/qt4_render.py", line 770, in set_style
func(n)
File "/home/joseph/bin/motif_test.py", line 16, in lof
seqFace = SeqMotifFace(None, my_motif)
File "/usr/local/lib/python2.7/dist-packages/ete2/treeview/faces.py", line 1627, in __init__
self.build_regions()
File "/usr/local/lib/python2.7/dist-packages/ete2/treeview/faces.py", line 1654, in build_regions
start, end, typ, w, h, fg, bg, name = mf
ValueError: need more than 7 values to unpack


What am I doing wrong?
Reply all
Reply to author
Forward
0 new messages