I'm trying to compute unweighted unifrac distances between samples. To do that, I generated a tree using SILVA's Alignment, Classification and Tree Service.
I read the tree in using:
from skbio import TreeNode tree=TreeNode.read("arb-silva.de_2020-10-16_id899307/arb-silva.de_2020-10-16_id899307.tree","newick")
When I run the command
But when I run the command
Uni =unweighted_unifrac(seq1, seq2, esvs, tree)
ValueError: tree must be rooted. seq1 and se2 are abundance vectors of two samples. esvs is a list of names of the sequences used to generate the tree.
I would appreaciate any help with fixing this error.
Is there a problem using trees from SILVA? Should I try to generate a tree using skbio? Is yes, how do I do it with either a fasta file, or a pandas dataframe containing the sequences and the names?
EDIT: From the suggestion here I added
Uni =unweighted_unifrac(seq1, seq2, esvs, tree, validate=False)
But this gives the error:
ValueError: Buffer dtype mismatch, expected 'DTYPE_t' but got 'long'
PS: I've also asked this question here