issues with downstream analysis after importing output from DADA2 in R to Qiime2

Hello,

I usually run DADA2 in Qiime2 using imported raw sequence files (fastq), but I was just given some outputs from DADA2 ran in R that I want to import and use in Qiime 2. I am having difficulty with the rep-seqs. The DADA2 output that I was given included an .fna file. After looking at the forum, related posts on this topic cover creating the .fna file and then importing. Seeing as I have the .fna file already, I went ahead and imported the file as a .qza. This seemed to work fine, and I was able to create the phylogenetic trees. Here is the code I used up to this point:

qiime tools import
--input-path sv.seqs.fna
--output-path cl_sequences.qza
--type 'FeatureData[Sequence]'

qiime phylogeny align-to-tree-mafft-fasttree
--i-sequences cl_sequences.qza
--o-alignment aligned-rep-seqs.qza
--o-masked-alignment masked-aligned-rep-seqs.qza
--o-tree unrooted-tree.qza
--o-rooted-tree rooted-tree.qza

I also imported the feature table using this code:

qiime tools import
--input-path feature-table2.biom
--type 'FeatureTable[Frequency]'
--input-format BIOMV210Format
--output-path feature-table2.qza

I ran a few basic filtering steps on the table (to remove low frequency features). The feature table looked normal when I ran the summarize command:

qiime feature-table summarize
--i-table feature-table2.qza
--o-visualization feature-table2.qzv
--m-sample-metadata-file sr_metadata.tsv

And I used the feature table to select the minimum sampling depth for the diversity analyses. I ran this command:

qiime diversity core-metrics-phylogenetic
--i-phylogeny rooted-tree.qza
--i-table feature-table2.qza
--p-sampling-depth 25000
--m-metadata-file sr_metadata.tsv
--output-dir core-metrics-results

And I got this error:

Plugin error from diversity:

The table does not appear to be completely represented by the phylogeny.

I re-ran with --verbose:

/Users/jenniferweinert/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/sklearn/metrics/pairwise.py:1776: DataConversionWarning: Data was converted to boolean for metric jaccard
warnings.warn(msg, DataConversionWarning)
Traceback (most recent call last):
File "/Users/jenniferweinert/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/q2cli/commands.py", line 329, in call
results = action(**arguments)
File "", line 2, in core_metrics_phylogenetic
File "/Users/jenniferweinert/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/qiime2/sdk/action.py", line 244, in bound_callable
outputs = self.callable_executor(scope, callable_args,
File "/Users/jenniferweinert/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/qiime2/sdk/action.py", line 484, in callable_executor
outputs = self._callable(scope.ctx, **view_args)
File "/Users/jenniferweinert/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/q2_diversity/_core_metrics.py", line 61, in core_metrics_phylogenetic
faith_pd_vector, = faith_pd(table=cr.rarefied_table,
File "", line 2, in faith_pd
File "/Users/jenniferweinert/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/qiime2/sdk/action.py", line 244, in bound_callable
outputs = self.callable_executor(scope, callable_args,
File "/Users/jenniferweinert/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/qiime2/sdk/action.py", line 390, in callable_executor
output_views = self._callable(**view_args)
File "", line 2, in faith_pd
File "/Users/jenniferweinert/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/q2_diversity_lib/_util.py", line 57, in _disallow_empty_tables
return wrapped_function(*args, **kwargs)
File "/Users/jenniferweinert/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/q2_diversity_lib/alpha.py", line 49, in faith_pd
result = unifrac.faith_pd(table_str, tree_str)
File "unifrac/_api.pyx", line 162, in unifrac._api.faith_pd
ValueError: The table does not appear to be completely represented by the phylogeny.

Plugin error from diversity:

The table does not appear to be completely represented by the phylogeny.

See above for debug info.

Based on what I read on the forum, I understood that this error means that all the features in the table are not in rep-seqs file (at least that is how I interpreted it - correct me if I am wrong!). So I converted the rep-seqs file to a .qzv so I could see what might be missing. I noticed 2 things: 1 - it seems like all the features in the table (and more) are present in the rep-seqs file, at least as far as I can tell. 2 - The rep-seqs.qzv looks different than when I have generated others through DADA2 in Qiime2. So am I missing a step somewhere in converting the .fna file? Or am I completely off-base in my approach to this? Please help!

I have uploaded rep-seqs and feature table .qza files that I generated as well as my metadata file.
cl_sequences.qza (277.0 KB)
feature-table2.qza (13.6 KB)
sr_metadata.tsv (1.3 KB)
Let me know if there is any additional information I need to provide. Thanks!

Hello @jrw187 apologies for the delay in response, yes that error indicates that your table contains features that are not in the tree and thus weren't in the rep-seqs. It sounds like you filtered the table, but you didn't filter the rep-seqs in any way correct? That is a fairly common cause of errors like this. As far as more in-depth instructions for using a .fna file goes, I will defer to other @moderators for that because I am not sure, but your approach sounds reasonable to me assuming that .fna file contained the necessary features. Again apologies for the delayed response. It has been a busy time for the core dev team with the release and the holidays coming up.

Hello,

I checked both of your files - there are all table sequences in representative sequences, but not the other way around. The commands should work anyway.

Please, send the output of the tree command, because it appears that code breaks there.

Cheers
Valentyn

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