[Biopython-dev] [Biopython - Bug #3374] (New) Newick.Tree.randomized not working

redmine at redmine.open-bio.org redmine at redmine.open-bio.org
Wed Jul 18 10:52:24 EDT 2012


Issue #3374 has been reported by Aleksey Kladov.

----------------------------------------
Bug #3374: Newick.Tree.randomized not working
https://redmine.open-bio.org/issues/3374

Author: Aleksey Kladov
Status: New
Priority: Normal
Assignee: 
Category: 
Target version: 
URL: 


My code is

<pre>
from Bio.Phylo import BaseTree, Newick

t = Newick.Tree.randomized(5)
</pre>

It throws Exeption:

<pre>
Traceback (most recent call last):
  File "/home/kladov/ab_lab/Rosalind/rosalind-problems/rosalind_problems/phyltree/__init__.py", line 55, in <module>
    t = Newick.Tree.randomized(5)
  File "/usr/local/lib/python2.7/dist-packages/Bio/Phylo/BaseTree.py", line 725, in randomized
    terminals.extend(newterms)
TypeError: 'NoneType' object is not iterable
</pre>

It looks like the problem is here(file BaseTree.py):

<pre>
newsplit = random.choice(terminals)
newterms = newsplit.split(branch_length=branch_length) #problem: split returns None...
if branch_stdev:
    # Add some noise to the branch lengths
    for nt in newterms:
    nt.branch_length = max(0,
        random.gauss(branch_length, branch_stdev))
terminals.remove(newsplit)
terminals.extend(newterms) # and now we try to extend with None =(
</pre>

I suppose that split not only should do actual split of a clade, but also return a list of two new clades.



----------------------------------------
You have received this notification because this email was added to the New Issue Alert plugin


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here and login: http://redmine.open-bio.org



More information about the Biopython-dev mailing list