Plugin error from diversity (on rarefaction)


I guess there were some discussion about my error here, but they are closed, and my situation is somewhat different, I got errors on rarefaction.

Ok this is my command and what I got :
(qiime2-2017.11) [r.restuadi@delta017 fastq_2]$ qiime diversity alpha-rarefaction \

–i-table table_sh_10thr_2.qza
–i-phylogeny rooted-tree.qza
–p-max-depth 4000
–m-metadata-file mapping_16Jan2018.txt
–o-visualization alpha-rarefaction_4k.qzv

Plugin error from diversity:

Missing samples in metadata: {‘R4286’, ‘R2406’}

Debug info has been saved to /scratch/tmp/

I’ve checked that my mapping is containing those 2 samples, and they are in table_sh_10thr_2.qza too.

Could you help me to figure out, what’s wrong here?

Thank you very much,


Hi @Restuadi!

Are those sample ids listed in exactly the same way in the metadata file and your table? ID matching is exact, so if you have hyphens versus underscores, or upper/lowercase letters, those will be read as different IDs (please note, the metadata behavior described here might not be applicable in future releases of QIIME 2 - we are currently overhauling the metadata handling in the framework).

Some ways you can make sure your IDs match:

If you are still stuck after investigating those three files, can you please provide us with the three visualizations above? Thanks! :t_rex:


Yes, I guess, I’m still pretty stuck, since the number seems to match.

I cannot find any attachment functionality in this forum, so for the time being, I put the visualization here:

Please let me know if you need anything else,
thank you very much,


Hi @Restuadi! Thanks for the files - that was super helpful!

You have extra spaces (' ') after the listed sample IDs in your metadata file ('R4286 ' instead of 'R4286' & 'R2406 ' instead of 'R2406'). If you delete those spaces in your metadata file, you should be good to go.

We are currently in the middle of overhauling metadata handling in QIIME 2 --- once those changes land, one important change is that leading and trailing whitespace will not be significant --- it will be stripped off, so this wouldn't have even been an issue for you. We will let you know when this is made available in a future release - stay tuned!

Thanks :t_rex:

PS - you can attach files by clicking this icon in the edit menu bar:
54 PM


YES…! It Works.
Awesome, Thank you very much.


1 Like

In the QIIME 2 2018.2 release, Metadata ignores any leading or trailing whitespace characters in cells, avoiding the issue reported in this topic.

There are a number of other changes to QIIME 2 Metadata in the 2018.2 release. See this forum announcement for details on what changed, as well as the updated Metadata tutorial. :sun_with_face:

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