Plugin error from diversity: metadata error

Hello all,
First of all, I sincerely apologize for posting this question again in the forum even though it has been posted by others.

I have imported my data using the fastq manifest format. I am trying to run the following command :
qiime diversity core-metrics-phylogenetic --i-phylogeny rooted-tree.qza --i-table table_collapse/collapsed_table.qza --p-sampling-depth 12456 --m-metadata-file METADATA.tsv --output-dir core-metrics-results

And I am getting the following error:
Plugin error from diversity:

None of the sample identifiers match between the metadata and the coordinates. Verify that you are using metadata and coordinates corresponding to the same dataset.

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

/usr/local/Miniconda3-4.5.4-Linux-x86_64/envs/qiime2-2018.11/lib/python3.5/site-packages/sklearn/utils/validation.py:475: DataConversionWarning: Data with input dtype float64 was converted to bool by check_pairwise_arrays.
warnings.warn(msg, DataConversionWarning)
/usr/local/Miniconda3-4.5.4-Linux-x86_64/envs/qiime2-2018.11/lib/python3.5/site-packages/skbio/stats/ordination/_principal_coordinate_analysis.py:152: RuntimeWarning: The result contains negative eigenvalues. Please compare their magnitude with the magnitude of some of the largest positive eigenvalues. If the negative ones are smaller, it's probably safe to ignore them, but if they are large in magnitude, the results won't be useful. See the Notes section for more details. The smallest eigenvalue is -0.02201283769778756 and the largest is 3.4624479741962055.
RuntimeWarning
Traceback (most recent call last):
File "/usr/local/Miniconda3-4.5.4-Linux-x86_64/envs/qiime2-2018.11/lib/python3.5/site-packages/q2cli/commands.py", line 274, in call
results = action(**arguments)
File "", line 2, in core_metrics_phylogenetic
File "/usr/local/Miniconda3-4.5.4-Linux-x86_64/envs/qiime2-2018.11/lib/python3.5/site-packages/qiime2/sdk/action.py", line 231, in bound_callable
output_types, provenance)
File "/usr/local/Miniconda3-4.5.4-Linux-x86_64/envs/qiime2-2018.11/lib/python3.5/site-packages/qiime2/sdk/action.py", line 455, in callable_executor
outputs = self._callable(scope.ctx, **view_args)
File "/usr/local/Miniconda3-4.5.4-Linux-x86_64/envs/qiime2-2018.11/lib/python3.5/site-packages/q2_diversity/_core_metrics.py", line 51, in core_metrics_phylogenetic
metadata=metadata, n_jobs=n_jobs)
File "", line 2, in core_metrics
File "/usr/local/Miniconda3-4.5.4-Linux-x86_64/envs/qiime2-2018.11/lib/python3.5/site-packages/qiime2/sdk/action.py", line 231, in bound_callable
output_types, provenance)
File "/usr/local/Miniconda3-4.5.4-Linux-x86_64/envs/qiime2-2018.11/lib/python3.5/site-packages/qiime2/sdk/action.py", line 455, in callable_executor
outputs = self._callable(scope.ctx, **view_args)
File "/usr/local/Miniconda3-4.5.4-Linux-x86_64/envs/qiime2-2018.11/lib/python3.5/site-packages/q2_diversity/_core_metrics.py", line 37, in core_metrics
results += emperor_plot(pcoa=pcoa, metadata=metadata)
File "", line 2, in plot
File "/usr/local/Miniconda3-4.5.4-Linux-x86_64/envs/qiime2-2018.11/lib/python3.5/site-packages/qiime2/sdk/action.py", line 231, in bound_callable
output_types, provenance)
File "/usr/local/Miniconda3-4.5.4-Linux-x86_64/envs/qiime2-2018.11/lib/python3.5/site-packages/qiime2/sdk/action.py", line 424, in callable_executor
ret_val = self._callable(output_dir=temp_dir, **view_args)
File "/usr/local/Miniconda3-4.5.4-Linux-x86_64/envs/qiime2-2018.11/lib/python3.5/site-packages/q2_emperor/_plot.py", line 65, in plot
custom_axes=custom_axes, plot_name='plot')
File "/usr/local/Miniconda3-4.5.4-Linux-x86_64/envs/qiime2-2018.11/lib/python3.5/site-packages/q2_emperor/_plot.py", line 41, in generic_plot
procrustes=procrustes, remote='.')
File "/usr/local/Miniconda3-4.5.4-Linux-x86_64/envs/qiime2-2018.11/lib/python3.5/site-packages/emperor/core.py", line 241, in init
ignore_missing_samples)
File "/usr/local/Miniconda3-4.5.4-Linux-x86_64/envs/qiime2-2018.11/lib/python3.5/site-packages/emperor/core.py", line 312, in _validate_metadata
raise ValueError('None of the sample identifiers match between the'
ValueError: None of the sample identifiers match between the metadata and the coordinates. Verify that you are using metadata and coordinates corresponding to the same dataset.

I tried modifying my metadata file as per manifest file but it seems like I have missed a point discussed in the forum. Follwing are my manifest and metadata files:
manifestmanifest.csv (6.4 KB)
original metadata file: METADATA.tsv (1.7 KB)
modified metadata files:
new_metadata.tsv (2.0 KB)
new_met.tsv (1.7 KB)

I wil be very grateful for any help regarding this.
Thank you.

Hi @pmehta!

Don't worry, I often run into problems that others have seen before, but the reasons for my error are totally different. It takes a lot of practice to disentangle those kinds of situations.

The key here is that our metadata and ordination coordinates disagree on sample names. You've probably seen this from other topics, but I think the reason you are having this problem is here:

It looks like you are providing a collapsed table. That's no problem at all, but you need to make sure your sample IDs in your metadata are similarly collapsed, otherwise this table, will eventually produce an ordination with the same collapsed IDs and you'll see the error above.

Hope that's helpful! If you try fixing it and you are still having problems, could you provide a feature-table summary of your collapsed table? Then we could provide specific recommendations on how to relabel your samples for this particular step.

2 Likes

Thank you so much for your advice.

I tried the following command :

qiime diversity core-metrics-phylogenetic --i-phylogeny rooted-tree.qza --i-table dada2out/table.qza --p-sampling-depth 12456 --m-metadata-file METADATA.tsv --output-dir core-metrics-results

But I am still getting the following error:

Plugin error from diversity:

None of the sample identifiers match between the metadata and the coordinates. Verify that you are using metadata and coordinates corresponding to the same dataset.

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

Please the attached visualization file: collapsed_table.qzv (359.0 KB)

1 Like

Hi @pmehta,

Thanks for the summary, it looks like there's just a casing problem.

This metadata file almost matches, but Sample is capitalized, whereas in the feature-table you have sample without the capitalization.

I would recommend just making all of your samples lowercase in your new_metadata.tsv file to match your collapsed table, as it's usually easier than renaming the IDs in your table (though that can be done via feature-table group if you wanted to).

2 Likes

Thank you so much. :slight_smile:
Yep, that was the issue.

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