[Biopython] problems with Phylo.draw

Vincent Davis vincent at vincentdavis.net
Thu May 8 22:24:51 UTC 2014


I am working with some code that used to work (6 months ago) , I am not
sure what has changed other than upgrading to the current Biopython and
iPython versions.
I am using anaconda python 2.7
Development build of Biopython
Development built of iPython

You can download the file from Dropbox
here<https://dl.dropboxusercontent.com/u/1340248/homolog__1274p.clustalwF-gb.phylip_phyml_tree.txt>

t = 'old/phylo_tools/temp/homolog__1274p.clustalwF-gb.phylip_phyml_tree.txt'
tree = Phylo.read(t, 'newick')
Phylo.draw(tree, ext)
#Phylo.draw_ascii(tree)




Populating the interactive namespace from numpy and matplotlib

---------------------------------------------------------------------------TypeError
                                Traceback (most recent call
last)<ipython-input-30-aa4094a6cf41> in <module>()      4 t =
'old/phylo_tools/temp/homolog__1274p.clustalwF-gb.phylip_phyml_tree.txt'
     5 tree = Phylo.read(t, 'newick')----> 6 Phylo.draw(tree, ext)
 7 # Phylo.draw_ascii(tree)
/home/vincent/.local/lib/python2.7/site-packages/Bio/Phylo/_utils.pyc
in draw(tree, label_func, do_show, show_confidence, axes,
branch_labels, *args, **kwargs)    459
draw_clade(child, x_here, color, lw)    460 --> 461
draw_clade(tree.root, 0, 'k', plt.rcParams['lines.linewidth'])    462
   463     # If line collections were used to create clade lines, here
they are added
/home/vincent/.local/lib/python2.7/site-packages/Bio/Phylo/_utils.pyc
in draw_clade(clade, x_start, color, lw)    440
y_here=y_here, x_start=x_start, x_here=x_here, color=color, lw=lw)
441         # Add node/taxon labels--> 442         label =
label_func(clade)    443         if label not in (None,
clade.__class__.__name__):    444             axes.text(x_here,
y_here, ' %s' % label, verticalalignment='center')
TypeError: 'str' object is not callable


 Vincent Davis



More information about the Biopython mailing list