cogent3 / cogent3

Comparative Genomics Toolkit 3
https://cogent3.org
BSD 3-Clause "New" or "Revised" License
102 stars 54 forks source link

dists.build_phylogeny broken #106

Closed GavinHuttley closed 5 years ago

GavinHuttley commented 5 years ago

Original report by GavinH (Bitbucket: 557058:e40c23e1-e273-4527-a2f8-5de5876e870d, ).


from cogent3 import LoadSeqs

aln = LoadSeqs("/Users/gavin/repos/PyCogent3/tests/data/brca1.fasta", array_align=False, moltype='dna')
dists = aln.distance_matrix('TN93')
tree = nd.build_tree()

produces

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-12-f618db56db84> in <module>
----> 1 tree = nd.build_tree()

~/repos/PyCogent3Apps/cogent3/evolve/fast_distance.py in build_tree(self, show_progress)
    683         if not dists or dists.shape[0] == 1:
    684             raise ValueError('Too few distances to build a tree')
--> 685         dists = dists.todict(flatten=True)
    686         return gnj(dists, show_progress=show_progress)

TypeError: todict() got an unexpected keyword argument 'flatten'
GavinHuttley commented 5 years ago

Original comment by GavinH (Bitbucket: 557058:e40c23e1-e273-4527-a2f8-5de5876e870d, ).


BUG: updated DistanceMatrix.build_tree() to latest DictArray.todict API, fix #106