ANCOM error: All values in `grouping` are unique

Hello,
sorry I want to run ANCOM for my data which contains features from 3 different kinds of meat. as you mentioned in the moving pictures tutorial I filtered the data to only beef (for example).
the metadata includes just 3 columns: sample-id, meat-kind and sample.
after I filtered and used psudocount command, when I wanted to run ANCOM there is an error which is: All values in grouping are unique
I cannot understand what’s the problem because I think its just like the moving pictures tutorial. you filtered to the body site and just analyzed gut samples as same as I did I just tried to analyze beef samples. you chose the “subject” column for ANCOM which includes subject1 and subject2 and I chose the “sample” column which includes beef1, beef2, beef3, and beef4.
could you please let me know what’s the difference and what’s the problem and how can I run ANCOM for my data?
qiime feature-table filter-samples
–i-table table-dada2.qza
–m-metadata-file upmnewmetadata.tsv
–p-where “[meat-kind]=‘beef’”
–o-filtered-table Beef-table-for-ancom.qza

qiime composition add-pseudocount
–i-table Beef-table-for-ancom.qza
–o-composition-table beef-table-for-ancom-comp.qza

qiime composition ancom
–i-table comp-beef-table.qza
–m-metadata-file upmnewmetadata.tsv
–m-metadata-column meat-kind
–o-visualization ancom_status.qzv

but the error is:
All values in grouping are unique. This method cannot operate on a grouping vector with only unique values (e.g., there are no ‘within’ variance because each group of samples contains only a single sample).

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

thank you in advance.

Hello!
You filtered your dataset based on ‘meat-kind’ column to retain only ‘beef’ samples. After you are running ANCOM test to see differences between following groups:

But in ancom composition command, you provided ‘meat-kind’ column again:

So I guess ANCOM is pointed to the wrong column in your metadata. Could you try to run ancom composition with ‘sample’ column instead? Hope that will help.

1 Like

Thank you @timanix but the problem has not solved as you see the error in the picture.

cccc
the second picture is metadata.

Hi!
It looks like you do not have replicates in your dataset, if you want to compare beef1 vs beef2 and so on, as you described earlier. To perform statistical analysis, including ANCOM, you need replicates.
With metadata you provided, you can only perform analysis on ‘meat-kind’ column, but you don’t need to filter your table then, and in the output you will receive comparisons between beef, chicken and pork samples.

thank you very much @timanix . you mean I should not filter the table, right?
so if I consider all of the samples like chicken pork and beef, then what about the assumptions? I think more than 25% of the features are different in these kinds of meats. no problem?

You are right. The only purpose of my comment above was to explain why you are receiving an error. Technically you can perform ANCOM test on your dataset without filtering the table, but whether you should do so or not is another question you need to decide based on experimental design and aims of the study.

1 Like