Errors when importing biomtable and tree files created by Ucluster into QIIME2

Hello everyone,

I am working on homologous amino acid sequences of a functional protein. I would like to analyze my data in amino acid level instead of nucleotide level. I know that QIIME2 does not take amino acid sequences but it can take biomtable and tree built outside of QIIME and run analysis: Import amino acid sequences?
I clustered my sequences using Ucluster fast and I got a uc file and a centroid Fasta file. Uc file was transformed to a biom file using uc2biom from the website: Sequences in the centroid file were used as OTUs. Phylogenetic tree was built using the OTUs by FastTree. The biomtable and phylogenetic tree were converted into QIIME2 artifacts successfully. However, building core matrix was failed and the error showed that some sequence names in biomtable are missing in the tree. I checked both of my biomtable and tree file and found that they should match with each other. I also could successfully import my OTU table (converted from the biomtable) and the phylogenetic tree into phyloseq in R. I wonder if it is a file format problem? What can I do to import my data into QIIME2? It would be great if I can use QIIME2 to do some downstream analysis.

Hey there @karren_owl! Can you provide some more specifics? What commands did you run and what were the error messages you received?

Hi Matthew,

The command I used to cluster my sequences is:

usearch -cluster_fast /path/to/sequence_file -id 0.95 -centroids /path/to/centroid_output -uc /path/to/uc_output

The command I used to convert the uc_output to biomtable is:

biom from-uc -i /path/to/uc_output -o /path/to/biom

The command I used to align the centroids is:

mafft /path/to/centroid_output > /path/to/centroid_align_output

The command I used to build the phylogenetic tree is:

FastTree /path/to/centroid_align_output > /path/to/tree.nwk

The command I used to import my biomtable and tree files into Qiime2 is:

qiime tools import \
  --input-path /path/to/biom \
  --type 'FeatureTable[Frequency]' \
  --source-format BIOMV100Format \
  --output-path /path/to/feature_table.qza
qiime tools import \
  --input-path /path/to/tree.nwk \
  --output-path /path/to/tree.qza \
  --type 'Phylogeny[Unrooted]'
qiime phylogeny midpoint-root \
  --i-tree  /path/to/tree.qza \
  --o-rooted-tree  /path/to/rooted_tree.qza
qiime feature-table summarize \
  --i-table /path/to/feature_table.qza \
  --o-visualization /path/to/feature_table.qzv \
  --m-sample-metadata-file /path/to/metadata \
  --i-phylogeny  /path/to/rooted_tree.qza \
  --i-table /path/to/feature_table.qza \
  --p-sampling-depth 380 \
  --m-metadata-file /path/to/metadata \
  --output-dir /path/to/core-metrics-results

The error message is:

All ``feature_ids`` must be present as tip names in ``phylogeny``. ``feature_ids`` not corresponding to tip names (n=476): Jun8.75v_2066 May12.75v_1069 Jun22.0v_4164 Jul11.25v_1903 May12.25v_4952 Sep8.25v_1815 Aug5.50v_12201 Jul27.75v_635 ...

Thanks @karren_owl!

That error is warning you that your feature IDs in your phylogenetic tree do not match the feature IDs found in your feature table --- they need to match in order for the phylogenetic metrics to look up phylogenetic distances in the tree when evaluating your feature table.

What do the first few lines of /path/to/tree.nwk look like? What are some of the feature IDs listed in /path/to/feature_table.qzv? :qiime2:

Hi Matthew,

I think the feature IDs in my phylogenetic tree match with the feature IDs in my feature table. I checked some of the IDs shown in the error message. They are actually in both of my feature table and tree. And both of my feature table and tree have the same numbers of IDs. I am really not sure what the problem is.

My first few lines of my tree look like:

The feature IDs in the feature_table.qzv look like:

The error above mentions 476 mismatched features — just curious, how many features are present in your feature table? You can use the viz you generated above (although, your command is all messed up, looks like copy-and-paste mangled a few commands together into one…)

I ask because you have a lot of similar feature IDs, but they aren’t quite identical. For example:

  • Jul27.50v_1972
  • Jul27.50v_1414
  • Jul27.50v_1353

Both of my feature table and the tree has 923 features. There are no mismatched features when I looked into both of the feature table and the tree.
For the similar feature IDs, they represent different sequences. For example, Jul27.50v_1972 is one of the sequences from the sample July27th, 50m depth. Jul27.50v_1414 is another sequence from the sample July27th, 50m depth.

The last piece of my command looks like this:

qiime feature-table summarize \
  --i-table /path/to/feature_table.qza \
  --o-visualization /path/to/feature_table.qzv \
  --m-sample-metadata-file /path/to/metadata 
qiime diversity core-metrics-phylogenetic \
  --i-phylogeny  /path/to/rooted_tree.qza \
  --i-table /path/to/feature_table.qza \
  --p-sampling-depth 380 \
  --m-metadata-file /path/to/metadata \
  --output-dir /path/to/core-metrics-results

Sorry for the unclear paste.
Do you mean that QIIME2 is confused by the feature IDs?


Hmm, well, that isn't what QIIME 2 is seeing --- the error you posted above indicates that the feature IDs are mismatched between the two Artifacts.

In QIIME 2, ID matching is performed by directly comparing the ID string, character for character --- the IDs must match 100% in order to be collated.

When we see mismatched ID issues here it is usually because of a bookkeeping issue when importing data.

If you can't find any problems with your file bookkeeping, please send me a DM with download links to 3 files necessary to re-run your qiime diversity core-metrics-phylogenetic command above. Thanks! :qiime2:

Hi Matthew,

I still can't find any problems with my file bookkeeping, could you please have a look on my files?
The threes files necessary to run my qiime diversity core-metrics-phylogenetic command is attached below.

Thank you!

feature-table.qza (30.9 KB)
rooted-tree.qza (17.9 KB)
anotop_rtpr_qiime2_matadata_period.txt (6.5 KB)

1 Like

The IDs for your features in the table have underscores:


While the tree has spaces:

 'Sep8.5v 9015'
 'Sep8.5v 9043'
 'Sep8.5v 9109'
 'Sep8.5v 9804'

That’s weird because I can see that the IDs have underscores in both of the unrooted tree file I imported into QIIME2 and the rooted tree file I exported from QIIME2.

Can you send the unrooted tree, too?

By the way, if your tree is already rooted, import it as such, you can skip midpoint rooting.

Here it is. (11.7 KB)

My tree was not rooted.