Error with beta-rarefaction analysis

Hi to all,
I'm using QIIME 2 diversity beta rarefaction for some meta-genomic samples. I ran this code line:

qiime diversity beta-rarefaction \
--i-table 5_Silox_table_2.qza \
--i-phylogeny 5_roo-Silox.qza \
--p-clustering-method nj \
--p-iterations 999 \
--p-sampling-depth 13000 \
--p-metric "jaccard" \
--m-metadata-file Meta_barcode_NoNAs.tsv \
--o-visualization 5_Silox_jacc_beta_rarefaction.qzv

But at the end, shows me this error:

Plugin error from diversity:
  Distance matrices must have at least 3 matching IDs between them (i.e., minimum 3x3 in size).

I searched and saw that the metadata shouldn't contain "N/A" values, so I removed them.. but the problem still persists, could someone please help me with this?

Thanks in advance :slight_smile:

Hi @ANDRES_ORTIZ_ARDILA,

Thanks for reaching out! Before moving forward with troubleshooting this issue, can you please provide us with the following information:

  • Version of QIIME 2 you are running, and how it is installed (e.g. Virtualbox, conda, etc.)
  • What is the exact error message? If you didn't run the command with the --verbose flag, please re-run and copy-and-paste the results.

Thanks! :lizard:

Hi @lizgehret
Thank you very much for your response, I'm using QIIME2 in Virtualbox, my version is the 2021.8.
I run the command with the --verbose flag, and this is what I got:

home/qiime2/miniconda/envs/qiime2-2021.8/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 "/home/qiime2/miniconda/envs/qiime2-2021.8/lib/python3.8/site-packages/q2cli/commands.py", line 329, in __call__
    results = action(**arguments)
  File "<decorator-gen-461>", line 2, in beta_rarefaction
  File "/home/qiime2/miniconda/envs/qiime2-2021.8/lib/python3.8/site-packages/qiime2/sdk/action.py", line 245, in bound_callable
    outputs = self._callable_executor_(scope, callable_args,
  File "/home/qiime2/miniconda/envs/qiime2-2021.8/lib/python3.8/site-packages/qiime2/sdk/action.py", line 453, in _callable_executor_
    ret_val = self._callable(output_dir=temp_dir, **view_args)
  File "/home/qiime2/miniconda/envs/qiime2-2021.8/lib/python3.8/site-packages/q2_diversity/_beta/_beta_rarefaction.py", line 67, in beta_rarefaction
    heatmap_fig, similarity_df = _make_heatmap(
  File "/home/qiime2/miniconda/envs/qiime2-2021.8/lib/python3.8/site-packages/q2_diversity/_beta/_beta_rarefaction.py", line 115, in _make_heatmap
    sm_df = skbio.stats.distance.pwmantel(
  File "/home/qiime2/miniconda/envs/qiime2-2021.8/lib/python3.8/site-packages/skbio/stats/distance/_mantel.py", line 416, in pwmantel
    stat, p_val, n = mantel(x, y, method=method, permutations=permutations,
  File "/home/qiime2/miniconda/envs/qiime2-2021.8/lib/python3.8/site-packages/skbio/stats/distance/_mantel.py", line 272, in mantel
    raise ValueError("Distance matrices must have at least 3 matching IDs "
ValueError: Distance matrices must have at least 3 matching IDs between them (i.e., minimum 3x3 in size).

Sorry for the long message, please let me know if I can do anything else.
Have a nice day!
Thank you

Hi @ANDRES_ORTIZ_ARDILA,

Happy New Year! :fireworks: Thanks for providing those details - I think I see where the issue is coming from, so let's try something out (if you don't mind).

Can you try running your analysis again, by just copy/pasting the slightly modified command below:

qiime diversity beta-rarefaction \
--i-table 5_Silox_table_2.qza \
--i-phylogeny 5_roo-Silox.qza \
--p-clustering-method nj \
--p-iterations 999 \
--p-sampling-depth 13000 \
--p-metric jaccard \
--m-metadata-file Meta_barcode_NoNAs.tsv \
--o-visualization 5_Silox_jacc_beta_rarefaction.qzv

I want to make sure the quotations you added around jaccard for your --p-metric parameter aren't the problem - please let me know if you run into the same error, and we'll keep troubleshooting from there!

Cheers :lizard:

Hi @lizgehret
Thank you very much for your good wishes! I hope you have a really nice and happy new year.
I copy and paste the code as you send me but still have the same problem, same message appears:
"Distance matrices must have at least 3 matching IDs between them (i.e., minimum 3x3 in size)"
It can be possible that I have something wrong with my data??
thank you in advance!
regards
Andrés

Hi @ANDRES_ORTIZ_ARDILA,

Thanks for giving that a try! I do think that this may have something to do with your feature table, and I'm curious to see what it looks like. Could you run the following command for me:

qiime feature-table summarize \
--i-table 5_Silox_table_2.qza \
--m-sample-metadata-file Meta_barcode_NoNAs.tsv \
--o-visualization 5_Silox_table_2.qzv \

This will provide you with a visualization of your feature table, which will allow us to inspect it further. Could you then upload it to QIIME 2 View and share a full page screenshot of the 'Interactive Sample Detail' tab, with the sampling depth of 13000 that you used in your above command?

Sharing the actual .qzv file would be helpful as well, if you feel comfortable doing that either in this thread or in a direct message. Thanks! :lizard:

1 Like

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