Plugin Error With Diversity Analysis

Dear Thermokarst,

Plugin Error while performing diversity analysis

I would like to add that, I have used the dereplicate command to generate the table.qza and rep-seq.qza files.
As I am working with publicly available dataset, dada2-denoising leads to sample loss (as quality of reads falls below 20).
Hence, for a uniformity I am using "Trimmomatic" for quality trimming.

After doing Trimmomatic, I am importing the files to convert to "qiime artifact" using the command.

qiime tools import --type 'SampleData[SequencesWithQuality]' \
   --input-format SingleEndFastqManifestPhred33V2 \
   --input-path ~/Metagenomics/Project/manifest-Project.tsv \
   --output-path ~/Metagenomics/Project/se-demux-Project.qza;

qiime demux summarize \
   --i-data ~/Metagenomics/Project/se-demux-Project.qza \
   --o-visualization ~/Metagenomics/Project/se-demux-Project-summary.qzv;

Followed by I am using the dereplicate command as mentioned below to generate Table and rep seq file

qiime vsearch dereplicate-sequences \
    --i-sequences /home/devika/Metagenomics/Project/se-demux-Project.qza \
    --o-dereplicated-table /home/devika/Metagenomics/Project/table-trim-Project.qza \
    --o-dereplicated-sequences /home/devika/Metagenomics/Project/rep-seq-trim-Project.qza ;

qiime feature-table summarize \
    --i-table /home/devika/Metagenomics/Project/table-trim-Project.qza \
    --o-visualization /home/devika/Metagenomics/Project/table-trim-Project.qzv \
    --m-sample-metadata-file /home/devika/Metagenomics/Project/metadata-Project.tsv;

qiime feature-table tabulate-seqs \
    --i-data /home/devika/Metagenomics/Project/rep-seq-trim-Project.qza \
    --o-visualization /home/devika/Metagenomics/Project/rep-seq-trim-Project.qzv

I am performing diversity

qiime diversity core-metrics-phylogenetic \
   --i-table table-dada2-Project.qza \
   --i-phylogeny rooted-tree-Project.qza \
   --p-sampling-depth 5342 \
   --m-metadata-file metadata_Project.tsv \
   --output-dir core-metrics-phylogenetic;

Error Encountering

Plugin error from diversity:

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

Debug info has been saved to /tmp/qiime2-q2cli-err-0oopses9.log

I would also like to add that, the same diversity was working out perfectly when using dada2 to generate the table.qza

So is it something with the table.qza file generated with dereplicate command ?
Please let me know if I am not clear or share any more data.

Hi @devika_CIBA, thanks for sharing your commands!

You haven't mentioned where/how your tree came to be, can you please explain that? I ask because the error message is saying that the phylogenetic tree is missing features that are found within your feature table - understanding how you created the tree might help us understand the nature of the error. Also, please rerun the core-metrics-phylogenetic command with the --verbose flag and share all of the output here - thanks!

:qiime2:

1 Like

Dear Thermokarst,

The Following command was used to generate the tree

qiime phylogeny align-to-tree-mafft-fasttree
--i-sequences rep-seq-trim-PRJNA387510.qza
--o-alignment aligned-rep-seq-trim-PRJNA387510.qza
--o-masked-alignment masked-aligned-rep-seq-trim-PRJNA387510.qza
--o-tree unrooted-tree-trim-PRJNA387510.qza
--o-rooted-tree rooted-tree-trim-PRJNA387510.qza

Reran the core-metrics-phylognentic by including the --verbose

qiime diversity core-metrics-phylogenetic
--i-table table-trim-PRJNA387510.qza
--i-phylogeny rooted-tree-trim-PRJNA387510.qza
--p-sampling-depth 404
--m-metadata-file metadata-PRJNA387510.tsv
--output-dir core-metrics-PRJNA387510
--verbose

/home/devika/.conda/envs/qiime2/lib/python3.6/site-packages/sklearn/metrics/pairwise.py:1761: DataConversionWarning: Data was converted to boolean for metric jaccard
warnings.warn(msg, DataConversionWarning)
Traceback (most recent call last):
File "/home/devika/.conda/envs/qiime2/lib/python3.6/site-packages/q2cli/commands.py", line 329, in call
results = action(**arguments)
File "", line 2, in core_metrics_phylogenetic
File "/home/devika/.conda/envs/qiime2/lib/python3.6/site-packages/qiime2/sdk/action.py", line 245, in bound_callable
output_types, provenance)
File "/home/devika/.conda/envs/qiime2/lib/python3.6/site-packages/qiime2/sdk/action.py", line 484, in callable_executor
outputs = self._callable(scope.ctx, **view_args)
File "/home/devika/.conda/envs/qiime2/lib/python3.6/site-packages/q2_diversity/_core_metrics.py", line 62, in core_metrics_phylogenetic
phylogeny=phylogeny)
File "", line 2, in faith_pd
File "/home/devika/.conda/envs/qiime2/lib/python3.6/site-packages/qiime2/sdk/action.py", line 245, in bound_callable
output_types, provenance)
File "/home/devika/.conda/envs/qiime2/lib/python3.6/site-packages/qiime2/sdk/action.py", line 390, in callable_executor
output_views = self._callable(**view_args)
File "", line 2, in faith_pd
File "/home/devika/.conda/envs/qiime2/lib/python3.6/site-packages/q2_diversity_lib/_util.py", line 49, in _disallow_empty_tables
return wrapped_function(*args, **kwargs)
File "/home/devika/.conda/envs/qiime2/lib/python3.6/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 156, in unifrac._api.faith_pd
ValueError: The table does not appear to be completely represented by the phylogeny.

As mentioned in my post - I dont have this issue if generating the table and rep seq with dada2.

Hi @devika_CIBA - I've seen this problem before - vsearch adds some information to the comment section of the FASTA header, which mafft and/or fasttree propagates as tree IDs. I don't have a great solution here - can you use a different tree-building method, instead? There are a few in q2-phylogeny, or you could use q2-fragment-insertion.

:qiime2:

Sure,
Will regenerate the tree with either with q2-phylogeny or q2-fragment-insertion and get back to you !

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