Plugin error from diversity core-metrics-phylogenetic during a re-analysis

I'm not finding a hit for this particular error on the forum, so...

I was re-running a diversity core-metrics-phylogenetic analysis using an updated feature table, otherwise no changes to any files that I'm aware of. Suddenly I'm getting the following error:

Plugin error from diversity:
Command '['faithpd', '-i', '/tmp/qiime2/user/data/cbae4d95-ee7b-41be-91c9-2fe6ad4f6ffa/data/feature-table.biom', '-t', '/tmp/qiime2/user/data/fedef14a-17c9-4245-a0fa-4fc256e430d3/data/tree.nwk', '-o', '/tmp/qiime2/user/processes/70227-1753219451.41@user/tmp/q2-OutPath-_nilfywe']' returned non-zero exit status 1.

Given the full error message, I assume this has something to do with my metadata file, but core-metrics-phylogenetic (and everything else in qiime) was working fine with the same file for the past few weeks and the file hasn't changed, so I'm at a loss. I opened the metadata file and ran a qiime metadata tabulate command and didn't notice anything weird.

My system:

  • Running qiime2-amplicon-2025.4 on a Linux virtual box in WSL
  • Conda version 24.11.3
  • Python version 3.10.4

Command:

qiime diversity core-metrics-phylogenetic \
--i-phylogeny 04_trees/18S/18S_cc_ns_rooted-tree.qza \
--i-table 02_denoised/18S/cc_ns/noUBABig_QC/18S_ASV-table_cc_ns_noUBABig_QC.qza \
--p-sampling-depth 5263 \
--m-metadata-file metadata-20250623.tsv \
--output-dir 05_diversity/18S_cc-ns_noUBABig_QC/allsamples-5263

The full error is pages long but is a series of the message below:

series[missing.index] = missing
/home/user/miniconda3/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/qiime2/metadata/metadata.py:610: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '[nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan
 nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan
 nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan
 nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan
 nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan
 nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan
 nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan
 nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan
 nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan
 nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan
 nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan
 nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan
 nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan
 nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan
 nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan
 nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan
 nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan
 nan nan nan nan nan nan nan nan]' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.

Then there's this:

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/user/data/cbae4d95-ee7b-41be-91c9-2fe6ad4f6ffa/data/feature-table.biom -t /tmp/qiime2/user/data/fedef14a-17c9-4245-a0fa-4fc256e430d3/data/tree.nwk -o /tmp/qiime2/user/processes/77609-1753221275.85@cariefrantz/tmp/q2-OutPath-v0228oi7

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 "/home/user/miniconda3/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/q2cli/commands.py", line 529, in __call__
    results = self._execute_action(
  File "/home/user/miniconda3/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/q2cli/commands.py", line 607, in _execute_action
    results = action(**arguments)
  File "<decorator-gen-681>", line 2, in core_metrics_phylogenetic
  File "/home/user/miniconda3/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/qiime2/sdk/action.py", line 221, in bound_callable
    outputs = self._callable_executor_(
  File "/home/user/miniconda3/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/qiime2/sdk/action.py", line 440, in _callable_executor_
    outputs = self._callable(ctx, **view_args)
  File "/home/user/miniconda3/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/q2_diversity/_core_metrics.py", line 65, in core_metrics_phylogenetic
    faith_pd_vector, = faith_pd(table=cr.rarefied_table,
  File "<decorator-gen-950>", line 2, in faith_pd
  File "/home/user/miniconda3/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/qiime2/sdk/context/base.py", line 90, in _callable_action_
    return self._dispatch_(args, kwargs)
  File "/home/user/miniconda3/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/qiime2/sdk/context/base.py", line 45, in _dispatch_
    results = exe(*args, **kwargs)
  File "<decorator-gen-958>", line 2, in faith_pd
  File "/home/user/miniconda3/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/qiime2/sdk/action.py", line 221, in bound_callable
    outputs = self._callable_executor_(
  File "/home/user/miniconda3/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/qiime2/sdk/action.py", line 359, in _callable_executor_
    output_views = self._callable(**view_args)
  File "<decorator-gen-391>", line 2, in faith_pd
  File "/home/user/miniconda3/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/q2_diversity_lib/_util.py", line 75, in _validate_tables
    return wrapped_function(*args, **kwargs)
  File "<decorator-gen-390>", line 2, in faith_pd
  File "/home/user/miniconda3/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/q2_diversity_lib/_util.py", line 118, in _validate_requested_cpus
    return wrapped_function(*bound_arguments.args, **bound_arguments.kwargs)
  File "/home/user/miniconda3/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/q2_diversity_lib/alpha.py", line 63, in faith_pd
    _omp_cmd_wrapper(threads, cmd)
  File "/home/user/miniconda3/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/q2_diversity_lib/_util.py", line 134, in _omp_cmd_wrapper
    return _run_external_cmd(cmd, verbose=verbose, env=env)
  File "/home/user/miniconda3/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/q2_diversity_lib/_util.py", line 128, in _run_external_cmd
    return subprocess.run(cmd, check=True, env=env)
  File "/home/user/miniconda3/envs/qiime2-amplicon-2025.4/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['faithpd', '-i', '/tmp/qiime2/user/data/cbae4d95-ee7b-41be-91c9-2fe6ad4f6ffa/data/feature-table.biom', '-t', '/tmp/qiime2/user/data/fedef14a-17c9-4245-a0fa-4fc256e430d3/data/tree.nwk', '-o', '/tmp/qiime2/user/processes/77609-1753221275.85@user/tmp/q2-OutPath-v0228oi7']' returned non-zero exit status 1.

A bit more info:
The new feature-table (18S_ASV-table_cc_ns_noUBABig_QC.qza) is a filtered version of another feature-table (18S_ASV-table_cc_ns_noUBA.qza) that was used to filter my representative sequences file (req-seq.qza) and produce aligned sequences and trees (qiime phylogeny align-to-tree-mafft-fasttree). Using those older trees should still have worked, but just in case that was the problem, I re-filtered my rep-seq file and re-generated alignments and trees. The error persisted.
Thanks for any help!

I figured out the source of the issue: a mismatch between my filtered feature-table and the rep-seq file that my trees were based on. I created my filtered feature-table from an old master feature-table and accidentally left taxa off of my --exclude list that had been excluded from the rep-seq file. When I fixed the filtered feature-table, the qiime diversity core-metrics-phylogenetic call worked fine.

Is there an easy command to check that all features in a feature-table are also present in rep-seq?

Sorry for the false alarm; hopefully this helps someone else troubleshoot their issue in the future. I was so thrown off by the metadata nan nan nan nan stuff in that error message.

2 Likes

Hello Carie,

I'm glad you found the source of the error! I appreciate that you shared the solution too.

It can be done with some plugins but it might be easier with the API:

1 Like

Thanks for that! I took what you provided and wrote the following to do what I wanted for future checks in case it's useful to anyone else. It checks the lengths of both files and gives the full list of feature ids in feature-table that are not present in rep-seq in order to help troubleshoot.

import qiime2
import pandas as pd

table_fp = "my_path/feature-table.qza"
seqs_fp = "my_path/rep-seq.qza"

table_artifact = qiime2.Artifact.load(table_fp)
seqs_artifact = qiime2.Artifact.load(seqs_fp)

table_df = table_artifact.view(pd.DataFrame)
seqs_srs = seqs_artifact.view(pd.Series)

table_ids = set(table_df.columns)
seqs_ids = set(seqs_srs.index)

difference = table_ids.difference(seqs_ids)

print("The feature table contains " + str(len(table_ids)) + " features."
      + "\nThe rep-seq list contains " + str(len(seqs_ids)) + " features."
      + "\nThere are " + str(len(difference)) + " features in the feature table that are not present in the rep-seq file:"
      )
print(*list(difference), sep = "\n")
3 Likes