Open mortonjt opened 1 year ago
Ugh, good spot. It's most likely due to either https://github.com/biocore/improved-octo-waddle/commit/ecdf009aea7e03ac1ea38860b39da1b3c1688e2a or https://github.com/biocore/improved-octo-waddle/commit/67178735853deff4269050cbaf1b5359e7b73fa6. We had a difficult time making copy
work correctly in tax2tree for carrying over edge numbers as needed for placement data (see https://github.com/biocore/tax2tree/blob/master/t2t/util.py#L18).
In the bigger picture, I think that the TreeNode.copy
method is not ideal, and is both confusing and surprising in its operation. I remember digging into this error when exploring this before, and I think what's going on is the wrong branch is triggered in deepcopy
although the code referenced here I think has gone through some changes in recent versions of Python.
I think fixing this should be done upstream in skbio. As a work around, one possibility for a true deepcopy sans any attributes would be to serialize / deserialize:
def copy(t):
return skbio.TreeNode.parse([str(t)])
...and skbio ideally would have the ability to track edge numbers
This is a weird issue.
yields the following error
But running
tree = skbio.TreeNode.read('16S_taxa.biom.nwk').copy()
doesn't return such an error, hinting at the skbio.TreeNode conversion in this package.Now, this does not occur in iow==1.0.3 suggesting that this is a recent error.