Error in diversity core-metrics-phylogenetic

Hi! I am doing phylogenetic diversity analysis in qiime2-2022.8, the commands are as following:

qiime feature-table filter-features \
--i-table table179_correct_count.qza \
--o-filtered-table tab179_correct_100_20.qza \
--p-min-frequency 100 \
--p-min-samples 20

qiime fragment-insertion sepp \
--i-representative-sequences rep_seqs179.qza \
--i-reference-database sepp-refs-gg-13-8.qza \
--o-tree tree179.qza \
--o-placements tree_placements179.qza \
--p-threads 16 \
--verbose

qiime diversity core-metrics-phylogenetic \
--i-table tab179_correct_100_20.qza \
--i-phylogeny tree179.qza \
--m-metadata-file metadata179.txt \
--p-sampling-depth 8000 \
--p-n-jobs-or-threads 16 \
--output-dir core_metircs179

Then I received the error:

Plugin error from diversity:
Command'['faithpd', i','/tmp/qiime2/yaoxq/data/5d16822a-4875-4fda-8037-1db0c6b8319/data/feature-table.biom',/tmp/qiime2/yaoxq/data/9bb83a57-1b12-417d-96d-38e644e63fc2/data/tree.nwk'-0','/tmp/q2-AlphaDiversityFormat-7g5yscuu']'retuned non-zero exit status 1.
Debug info has been saved to /tmp/qiime2-q2cli-err-zyk5k0_9.log

The details in the log shows:

/public/yaoxq/miniconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/sklearn/metrics/pairwise.py:1776: DataConversionWarning: Data was converted to boolean for metric jaccard
  warnings.warn(msg, DataConversionWarning)
Running external command line application. This may print messages to stdout and/or stderr.
The command being run is below. This command cannot be manually re-run as it will depend on temporary files that no longer exist.

Command:

faithpd -i /tmp/qiime2/yaoxq/data/5d16822a-4875-4fda-8037-1db0c61b8319/data/feature-table.biom -t /tmp/qiime2/yaoxq/data/9bb83a57-1b12-417d-967d-38e644e63fc2/data/tree.nwk -o /tmp/q2-AlphaDiversityFormat-7q5yscuu

Compute failed in faith_pd_one_off: Table observation IDs are not a subset of the tree tips. This error can also be triggered if a node name contains a single quote (this is unlikely).
Traceback (most recent call last):
  File "/public/yaoxq/miniconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/q2cli/commands.py", line 339, in __call__
    results = action(**arguments)
  File "<decorator-gen-441>", line 2, in core_metrics_phylogenetic
  File "/public/yaoxq/miniconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/qiime2/sdk/action.py", line 234, in bound_callable
    outputs = self._callable_executor_(scope, callable_args,
  File "/public/yaoxq/miniconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/qiime2/sdk/action.py", line 475, in _callable_executor_
    outputs = self._callable(scope.ctx, **view_args)
  File "/public/yaoxq/miniconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/q2_diversity/_core_metrics.py", line 62, in core_metrics_phylogenetic
    faith_pd_vector, = faith_pd(table=cr.rarefied_table,
  File "<decorator-gen-554>", line 2, in faith_pd
  File "/public/yaoxq/miniconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/qiime2/sdk/action.py", line 234, in bound_callable
    outputs = self._callable_executor_(scope, callable_args,
  File "/public/yaoxq/miniconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/qiime2/sdk/action.py", line 381, in _callable_executor_
    output_views = self._callable(**view_args)
  File "<decorator-gen-257>", line 2, in faith_pd
  File "/public/yaoxq/miniconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/q2_diversity_lib/_util.py", line 69, in _disallow_empty_tables
    return wrapped_function(*args, **kwargs)
  File "<decorator-gen-256>", line 2, in faith_pd
  File "/public/yaoxq/miniconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/q2_diversity_lib/_util.py", line 112, in _validate_requested_cpus
    return wrapped_function(*bound_arguments.args, **bound_arguments.kwargs)
  File "/public/yaoxq/miniconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/q2_diversity_lib/alpha.py", line 53, in faith_pd
    _omp_cmd_wrapper(threads, cmd)
  File "/public/yaoxq/miniconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/q2_diversity_lib/_util.py", line 128, in _omp_cmd_wrapper
    return _run_external_cmd(cmd, verbose=verbose, env=env)
  File "/public/yaoxq/miniconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/q2_diversity_lib/_util.py", line 122, in _run_external_cmd
    return subprocess.run(cmd, check=True, env=env)
  File "/public/yaoxq/miniconda3/envs/qiime2-2022.8/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['faithpd', '-i', '/tmp/qiime2/yaoxq/data/5d16822a-4875-4fda-8037-1db0c61b8319/data/feature-table.biom', '-t', '/tmp/qiime2/yaoxq/data/9bb83a57-1b12-417d-967d-38e644e63fc2/data/tree.nwk', '-o', '/tmp/q2-AlphaDiversityFormat-7q5yscuu']' returned non-zero exit status 1.

How to solve it? thanks for your time!

Hi @wqrao,

I think you might have skipped a step. That is, after you run qiime fragment-insertion sepp ... you'll want to run the following command to remove features from your table that were not inserted into the tree:

 qiime fragment-insertion filter-features \
    --i-table tab179_correct_100_20.qza \
    --i-tree tree179.qza \
    --o-filtered-table tab179_correct_100_20_fi.qza \
    --o-removed-table tab179_correct_100_20_nofi.qza

# next step is optional, 
# just to keep your sequences in sync with your table,
# should you need them:

qiime feature-table filter-seqs \
    --i-data rep_seqs179.qza  \
    --i-table tab179_correct_100_20_fi.qza \
    --o-filtered-data rep_seqs179_fi.qza

From here you can run qiime diversity core-metrics-phylogenetic ...

3 Likes

Hello @SoilRotifer, Your solution worked! Thanks!

2 Likes

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