feature ids much be present as tip names in phylogeny

Dear qiime team,

when I do diversity analysis,

qiime diversity core-metrics-phylogenetic --i-table /projects/aces/lbhuang/data/Nrate/EAA_AamoAtable.qza --i-phylogeny /projects/aces/lbhuang/data/Nrate/EAA_AamoA_rooted-tree.qza --p-sampling-depth 28600 --m-metadata-file /projects/aces/lbhuang/data/Nrate/EAAmap.txt --output-dir /projects/aces/lbhuang/data/Nrate/EAA_core-diversity

I get this error:
All feature_ids much are present as tip names in phylogeny, feature_ids are not corresponding to tip names (n=201)

please check my table.qza and tree.qzaEAA_AamoA_rootedtree.qza (42.9 KB) EAA_AamoAtable.qza (21.3 KB)

Thank you very much

Hey @laibinhuang!
Let's take a closer look at the IDs in both of those Artifacts you have shared:

import qiime2
import skbio
import biom

tree = qiime2.Artifact.load('EAA_AamoA_rootedtree.qza').view(skbio.TreeNode)
table = qiime2.Artifact.load('EAA_AamoAtable.qza').view(biom.Table)

tree_ids = {t.name for t in tree.tips()}
table_ids = set(table.ids(axis='observation'))

Then, if I print out the tree IDs:

print(tree_ids)
{'0048d0d890fb577f2bb2970047f0418734ac8df3 site4_AamoA_H03',
 '0291c9f4469e63f64ca32e459771fc35da0fb9dd site2_AamoA_B09',
 '03de94f045b2bca915282abb8316821d97bf7ba1 site2_AamoA_G07',
 '0421b40a1971dabca97588058127d77979770f6e site5_AamoA_E01',
 '04224dfed949ab420edd31d5194c973314d192f6 site4_AamoA_C08',
...

And the table IDs:

print(table_ids)
{'0048d0d890fb577f2bb2970047f0418734ac8df3',
 '0291c9f4469e63f64ca32e459771fc35da0fb9dd',
 '03de94f045b2bca915282abb8316821d97bf7ba1',
 '0421b40a1971dabca97588058127d77979770f6e',
 '04224dfed949ab420edd31d5194c973314d192f6',
 '0455c5a43462b5da9f805830b007999f9abea9a9',
...

The source of the error is the sample/metadata info that has been appended onto the end of the tree IDs. You could remove those values (I would do that at the same step you added them in), or, you could try to keep those annotations in as Newick comment fields, although I have never personally used that before.

Keep us posted!
:qiime2:

2 Likes

Hi Thermokarst,

I know that, I try to remove the smaple ID in the tree manually (open it in the excel), but it turns out I cannot save it as tree file afterwards, do you have any idea to remove them in qiime2 or R, which I can still keep it as tree file afterwards

Thank you very much
Have a great day
Laibin

How did you create the tree and table? That is the step that I would look at correcting to ensure the feature IDs are uniform.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.